This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients Saimadhav.Heblikar, asvetlov, ggenellina, gpolo, markroseman, mrabarnett, rhettinger, terry.reedy, wolma
Date 2015-11-23.18:15:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Today on SO:  Person writing script to open a file given on command line asks 'How to test from IDLE?' He found PyCharm, but I would like to add a better answer than the workaround I gave above.  It does not have to be either perfect or necessarily permanent.  There are two subissues.  

1) Get a command line from the user.  1a. What dialog?  1b. Retain it for as least the current session?  Same for all editors? Specific to file?

2) Use the command line.  2a. parse with shlex or custom parser. 2b integrate in when starting user code so code sees arguments in sys.argv.

Looking *briefly* at the patches:

M.B.: Get command line with new extension module Parse with re.findall(arg_regex).  Modifies ScriptBinding, including the deletin of a condition for setting user sys.argv.

G.G.: Get command line with tkSimpleDialog._QueryString. Split with shlex.  Reuses MB's ScriptBinding patch.

S.H.: Get command line with custom dialog. Use custom parser. Add new tests.

My inclination is to start as simple as possible.  Use a message box to get a single string (no error checking is needed).  Set for specific file only, not all.  The setting could be added to status bar.  Parse with shlex.  Question: is basic command line parsing system specific?  Does MAC stick with unix/posix rules?  Should shlex.split use non-posix mode on Windows?
Date User Action Args
2015-11-23 18:15:13terry.reedysetrecipients: + terry.reedy, rhettinger, ggenellina, gpolo, mrabarnett, asvetlov, markroseman, wolma, Saimadhav.Heblikar
2015-11-23 18:15:13terry.reedysetmessageid: <>
2015-11-23 18:15:13terry.reedylinkissue5680 messages
2015-11-23 18:15:12terry.reedycreate