I am installing a package using python2 setup.py install
. This package is a tkinter application which contains traditional
if __name__ == '__main__':
main()
I tried running python2 -m my_app
or python2 -m my_app.__main__
and python2 -c "import my_app"
but I either get an error or nothing happens.
I can run it ./my_app.py
from console.
How can I run my python application after installation with setup.py
?
Import module with main
function and call it
python -c "from some_module import main; main()"
but mostly modules/apps, simply expose bin/scripts, look in bin
dir of your virtualenv or setup.py
.
More info about how to expose (scripts, entry_points):
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.