Skip to content
Snippets Groups Projects
Commit 3d12da1f authored by Robin Christen's avatar Robin Christen
Browse files

Adding Command-Line Interpreter

parent 4d5c89a5
No related branches found
No related tags found
1 merge request!8Command-Line Interpreter
File added
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
\ No newline at end of file
Python Command-Line Interface
\ No newline at end of file
pip install -e .
\ No newline at end of file
import sys
from .classmodule import MyClass
from .funcmodule import my_function
def main():
print('in main')
args = sys.argv[1:]
print('count of args :: {}'.format(len(args)))
for arg in args:
print('passed argument :: {}'.format(arg))
my_function('Hello World')
my_object = MyClass('Robin')
my_object.say_name()
if __name__ == '__main__':
main()
class MyClass():
def __init__(self, name):
self.name = name
def say_name(self):
print('name is {}'.format(self.name))
def my_function(text_to_display):
print('text from my_function :: {}'.format(text_to_display))
from setuptools import setup
setup(
name = 'CLI',
version = '0.1.0',
packages = ['pycli'],
entry_points = {
'console_scripts': [
'pycli = pycli.__main__:main'
]
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment