Skip to content

Commit c490177

Browse files
committed
Add main module and entry point for pycmtemplate
1 parent 6ce2473 commit c490177

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

pycmtemplate/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
from .ctopy import *

pycmtemplate/__main__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from . import ctopy
2+
3+
def main():
4+
print("Hello 'pycmtemplate' Module!")
5+
print("This is the main function of the module.")
6+
print("You can run this function by calling 'pycmtemplate' module.")
7+
print()
8+
print(ctopy.functionFromCPP())
9+
print(ctopy.functionFromCPP2(1, 2))
10+
print(ctopy.variableFromCPP)
11+
print(ctopy.variableFromCPP2)
12+
13+
14+
if __name__ == '__main__':
15+
main()

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@
2323
# Required for .pyi files to be included in the package
2424
"pycmtemplate": ["py.typed"],
2525
},
26+
entry_points={
27+
# Provide a console script entry point. After pip install run `pycmtemplate` on the command line
28+
"console_scripts": [
29+
"pycmtemplate = pycmtemplate.__main__:main",
30+
],
31+
},
2632
)

0 commit comments

Comments
 (0)