-
Notifications
You must be signed in to change notification settings - Fork 334
Allow command line options to called scripts #37
Comments
Author: anonymous you can achieve this by the following: change: execfile(args[0]) to: saveargs = sys.argv # save sys.argv in scripts/pycallgraph-dot.py (version 0.4.1). Then you can supply arguments to the script after stopping argument processing with '--'. Example: The -h option is then passed to the exec'd version of pycallgraph-dot.py. Best, |
Author: anonymous Change lines 109-110 in pycallgraph-dot.py (version 0.4.1): {{{ to {{{ For this to work, we hope that the code in args[0] does not alter any globals that are needed by pycallgraph, in particular the globals that start with 'my'. Best, |
Author: gak |
2 similar comments
Author: gak |
Author: gak |
I was amazed at how simple it was to install and use pycallgraph. Just one suggestion.
It would be very helpful if you could specify sys.argv to the called script on the command line. That way I wouldn't have to make a new script file for every set of options. If you put the output filename before the scriptfile you could feed the rest of the command line to the called script. For example:
{{{
pycallgraph-dot.py test1.png myscript.py --spam=42 ham.txt eggs.txt
}}}
The text was updated successfully, but these errors were encountered: