#bash
pip install PyCPPExecuter
#bash
python3 -m pip install PyCPPExecuter
#Python
!pip install PyCPPExecuter
To verify the gcc compiler is installed run this
#bash
gcc-install
For Google colab/jupyter Notebook
#Python
import os
os.system('gcc-install')
By specifying the code in the doc strings and invoking the compile method and execute method one after the other from the class CPPExecuter.
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
#Initialize the Code in doc string
cppcode =
executer = CPPExecuter()
executer.compile(code = cppcode)
executer.execute()
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
file_path = "path/to/your/c++/file.cpp"
executer = CPPExecuter()
executer.compile(file_path = file_path)
executer.execute()
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
executer = CPPExecuter()
cppcode =
saving_path = "path/to/save/object/file.o"
executer.create_object_file(code = cppcode, path = saving_path)
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
executer = CPPExecuter()
file_path = "path/of/the/c++/file.cpp"
saving_path = "path/to/save/object/file.o"
executer.create_object_file(file_path = file_path, path = saving_path)
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
executer = CPPExecuter()
cppcode =
saving_path = "path/to/save/object/file.asm"
executer.create_assembly_code(code = cppcode, path = saving_path)
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
executer = CPPExecuter()
file_path = "path/of/the/c++/file.cpp"
saving_path = "path/to/save/object/file.asm"
executer.create_object_file(file_path = file_path, path = saving_path)
By specifying the code in the doc strings and invoking the compile method and execute method one after the other from the class CPPExecuter.
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
#Initialize the Code in doc string
ccode =
executer = CPPExecuter(lang='C')
executer.compile(code = ccode)
executer.execute()
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
file_path = "path/to/your/c/file.c"
executer = CPPExecuter(lang='C')
executer.compile(file_path = file_path)
executer.execute()
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
executer = CPPExecuter(lang='C')
ccode =
saving_path = "path/to/save/object/file.o"
executer.create_object_file(code = ccode, path = saving_path)
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
executer = CPPExecuter(lang='C')
file_path = "path/of/the/c/file.c"
saving_path = "path/to/save/object/file.o"
executer.create_object_file(file_path = file_path, path = saving_path)
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
executer = CPPExecuter(lang='C')
ccode =
saving_path = "path/to/save/object/file.asm"
executer.create_assembly_code(code = ccode, path = saving_path)
#Python
#Import the CPPExecuter class
from PyCPPExecuter import CPPExecuter
executer = CPPExecuter(lang='C')
file_path = "path/of/the/c/file.cpp"
saving_path = "path/to/save/object/file.asm"
executer.create_object_file(file_path = file_path, path = saving_path)
Note: Please use additional forward slash(/) for
escapce sequence characters in the doc strings.
Note: Please report any Issues in the
github repository Issues page.