Issue23665
Created on 2015-03-14 23:33 by rhettinger, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg238108 - (view) | Author: Raymond Hettinger (rhettinger) * ![]() |
Date: 2015-03-14 23:33 | |
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. |
|||
| msg238207 - (view) | Author: Saimadhav Heblikar (Saimadhav.Heblikar) * | Date: 2015-03-16 14:11 | |
http://bugs.python.org/issue5680 Also had submitted a patch for it. Could you post your review there? (I was learning the CPython style then, so excuse obvious mistakes :) ) |
|||
| msg238728 - (view) | Author: Terry J. Reedy (terry.reedy) * ![]() |
Date: 2015-03-20 22:03 | |
#5680 has 3 different patches. I have not reviewed them yet. I will link to Raymond's message there. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:13 | admin | set | github: 67853 |
| 2016-09-09 21:40:57 | mcepl | set | nosy:
+ mcepl |
| 2015-03-20 22:03:37 | terry.reedy | set | status: open -> closed superseder: Simulate command-line arguments for program run in IDLE nosy:
+ terry.reedy |
| 2015-03-16 14:11:25 | Saimadhav.Heblikar | set | nosy:
+ Saimadhav.Heblikar messages: + msg238207 |
| 2015-03-14 23:33:44 | rhettinger | create | |
