Skip to content
No description, website, or topics provided.
Python C++ CMake
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CMakeLists.txt
README.md
__init__.py
hello.py
lib.cpp
lib.h
practice.py
setup.py

README.md

About

Demonstrates calling C++ code / structures from python.

Building & Running

- sudo apt-get install python3-venv 
- (gdb debugging support) sudo apt-get install gdb python3-dbg
- python3 -m venv ve
- . ve/bin/activate
- ccmake .
- (configure, generate)
- make
- python hello.py

Debugging

- gdb python
- break file:linenum or break function_name
- run script.py
- bt
- list or list n (where n is numbers around current location)

Packaging:

- python3 -m pip install --user --upgrade setuptools wheel
- python3 setup.py sdist bdist_wheel

Links

- https://docs.python.org/3/extending/building.html
- https://www.codeproject.com/articles/11805/embedding-python-in-c-c-part-i
- https://stackoverflow.com/questions/145270/calling-c-c-from-python
- http://svn.python.org/projects/ctypes/trunk/ctypes/docs/manual/tutorial.html
- https://docs.python.org/3/tutorial/modules.html#packages        
- https://packaging.python.org/tutorials/packaging-projects
- https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives
- https://stackoverflow.com/questions/4015417/python-class-inherits-object
- https://github.com/gto76/python-cheatsheet
You can’t perform that action at this time.