I have a program main.py
which uses sys.argv
to run functions from other modules:
e.g:
python main.py gui
should run the main
function in gui.py
python main.py server start
should run the main
function in server.py
.
But if the program simply runs server.main()
in this example, sys.argv
is ['main.py', 'server', 'start']
when it should be [something, 'start']
.
Since server.py
also relies on the correct argv, I need to make sure that the argv used in server.py
is different from the argv recieved by main.py
. How can I change these values?