I would like to execute a script work.pyin Python after doing some initialization of the script init.py.
If I were looking for an interactive session, the execution python -i init.pyor installation PYTHONSTARTUP=/path/to/init.pywould do the trick, but I want to execute another script.
Since this is the general case, which often occurs ( init.pysets the environment and, therefore, one and the same), I would prefer not to refer to init.pyon work.py. How can I do that? Will anything change if I need this from a script instead of an invitation?
Many thanks.
source
share