I have a Bokeh server application. I would like to pass it custom options on the command line:
bokeh serve /path/to/script.py --my-option foo
Is this possible? Will Bokeh pass these options through somehow?
Yes, use the --args
command line option described in the User's Guide. Everything you put after the --args
option will just appear in sys.argv
for the app code, just as you would expect with any normal python script.
Running this app:
import sys
print(sys.argv)
With this invocation:
bokeh serve foo.py --args -x 1 bar --baz
Then opening a session will result in this being printed:
['foo.py', '-x', '1', 'bar', '--baz']
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