Author rhettinger
Recipients Saimadhav.Heblikar, asvetlov, ggenellina, gpolo, mrabarnett, rhettinger, terry.reedy
Date 2015-03-20.22:35:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426890918.9.0.717313370604.issue5680@psf.upfronthosting.co.za>
In-reply-to
Content
Here's my comment from the duplicate tracker item:
--------------------------------------------------

A number of IDEs support menu options to set the execution environment for programs under development and testing.  In particular, it would be nice if IDLE let the user set command line arguments to be passed into sys.argv when running a script by pressing F5.

Here are some existing implementations for reference:
* Wing-IDE: https://wingware.com/doc/intro/tutorial-debugging-launch
* Visual Studio: https://www.youtube.com/watch?v=IgbQCRHKV-Y
* PyCharm: https://www.jetbrains.com/pycharm/help/run-debug-configuration-python.html

This feature will help users interactively develop and test command-line tools while retaining all the nice features of the IDE.   I would personally find it useful when teaching students about how sys.argv works.

I suggest adding an option under the Run menu for Set Command Line arguments.  It would trigger a dialog box that lets a user set a string such as "somefile.txt -r 10".  The user string would be run through shlex to break it into separate fields.  When F5 is pressed, the sys.argv list would be repopulated to include the script name and the lexed arguments.

A little more elaborate option is to add a Run menu entry for Set Execution Enviroment that let's the user 1) set the command-line  2) specify the start-up directory (using os.chdir), 3) and edit the environment variables (from os.environ) or at least be able to set PYTHONPATH.
History
Date User Action Args
2015-03-20 22:35:18rhettingersetrecipients: + rhettinger, terry.reedy, ggenellina, gpolo, mrabarnett, asvetlov, Saimadhav.Heblikar
2015-03-20 22:35:18rhettingersetmessageid: <1426890918.9.0.717313370604.issue5680@psf.upfronthosting.co.za>
2015-03-20 22:35:18rhettingerlinkissue5680 messages
2015-03-20 22:35:18rhettingercreate