I'm using PyInstaller 3.2 to package a Web.py app. Typically, with Web.py and the built-in WSGI server, you specify the port on the command line, like
$ python main.py 8091
Would run the Web.py app on port 8091 (default is 8080). I'm bundling the app with PyInstaller via a spec file, but I can't figure out how to specify the port number with that -- passing in Options only seems to work for the 3 given ones in the docs. I'm tried:
exe = EXE(pyz,
a.scripts,
[('8091', None, 'OPTION')],
a.binaries,
a.zipfiles,
a.datas,
name='main',
debug=False,
strip=False,
upx=True,
console=False )
But that doesn't seem to do anything. I didn't see anything else in the docs -- is there another way to bundle / specify / include command-line arguments to the PyInstaller spec file?
So very hacky, but what I wound up doing was to just append an argument in sys.argv
in my web.py app...
sys.argv.append('8888')
app.run()
I also thought in my spec
file I could just do:
a = Analysis(['main.py 8888'],
But that didn't work at all.
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