Terry J. Reedy added the comment:

Today on SO: 
https://stackoverflow.com/questions/33866724/read-data-from-file-idle.  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 ScriptBinding.py 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 argumentDialog.py. 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?

----------
assignee: asvetlov -> terry.reedy
nosy: +markroseman
type: behavior -> enhancement
versions: +Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5680>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to