I've got a python module with __main__.py file and I want to make it an app, which I can call from anywhere.
Something like this:
$my_app [args] or python3 my_app args
How can I do this?
I suppose, that I need to write something in setup.py. Now it looks like this:
import vk_mutual_friends_finder
from distutils.core import setup
setup(
name="vk_mutual_friends_finder",
packages=["vk_mutual_friends_finder"],
version="1.0",
description="""Finds mutual friends in social network
'vkontakte' (https://vk.com)""",
author="Stepan Kholodov",
url="https://github.com/stepuncius/vk_mutual_friends_finder",
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Intended Audience :: Developers and linux power users",
"License :: OSI Approved :: BSD",
"Environment :: Console"
"Operating System :: Linux"
],
)
I think the easiest way is to set up an alias (http://www.linfo.org/alias.html).
If you are using bash, you can add the line "alias myapp="python3 /path/to/your/app/myapp.py"" to you ~/.bashrc
After that you can call your app from everywhere with $myapp args
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With