[issue5680] Command-line arguments when running in IDLE

2019-06-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Can be bump this up in priority?  The patch has been awaiting review for a good 
while.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2017-06-21 Thread veganaiZe

veganaiZe added the comment:

I've created a simple work-around for those who don't want to wait for the next 
release(s) of IDLE.  It's available on SO:

https://stackoverflow.com/a/44687632/5039027

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2017-06-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Running with arguments is only one requested or possible deviation from the 
standard F5 mode.  See #19042, msg296498, for many more.  I am thinking that 
there should be one menu entry (Custom Run, Alt-F5)? that brings up a box with 
alternatives, initially defaulting to the F5 values, then persisting.

The order of execution should be a) Syntax check by compile, b) Run options, if 
requested, c) Restart Shell, if requested, d) Execute code object.

I want to start with setting sys.args, but with a mind to adding other things.  
Running without explicit saving might be next.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2017-06-20 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +louielu

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2017-06-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I closed #28889, with a 4th patch, in favor of this one.

Gabriel, you somehow never signed the PSF Contributor License Agreement.  Until 
you do, I will assume that anything you did is covered by the other 3 patches.

--
versions: +Python 3.7 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2017-06-20 Thread Louie Lu (old)

Changes by Louie Lu (old) :


--
pull_requests: +2353

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2017-06-19 Thread veganaiZe

Changes by veganaiZe :


--
nosy: +veganaiZe

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2016-09-09 Thread Matej Cepl

Changes by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2015-11-23 Thread Terry J. Reedy

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2015-11-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

When  file is run with command line args, it might be nice to add an additional 
separator line with the line entered.  That way, if someone ran a series of 
experiments with different command lines, they would have the command line and 
output together as documentation that can be saved.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2015-04-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Pending application of a patch, the following will work to only add args to 
sys.argv when running from an Idle editor.

import sys
# ...
if __name__ == '__main__':
if 'idlelib.PyShell' in sys.modules:
sys.argv.extend(('a', '-2'))  # add your argments here.
print(sys.argv)  # in use, parse sys.argv after extending it
# ['C:\\Programs\\python34\\tem.py', 'a', '-2']

--

___
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



[issue5680] Command-line arguments when running in IDLE

2015-04-16 Thread Wolfgang Maier

Changes by Wolfgang Maier wolfgang.ma...@biologie.uni-freiburg.de:


--
nosy: +wolma

___
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



[issue5680] Command-line arguments when running in IDLE

2015-03-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I closed #23665 in favor of this one.  Raymond's take: msg238108

--

___
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



[issue5680] Command-line arguments when running in IDLE

2015-03-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

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.

--
nosy: +rhettinger

___
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



[issue5680] Command-line arguments when running in IDLE

2014-10-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I have a recent idea that there should be a separate and persistent execution 
process for each file run.  This would make it easy to persist the cmd lines 
args for a particular module.

--
versions: +Python 3.4, Python 3.5 -Python 3.1, Python 3.2

___
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



[issue5680] Command-line arguments when running in IDLE

2014-03-22 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

Submitting a patch for 3.4.

1. Allows the user to set command line arguments via a dialog box
2. Parsing - Maps the string which user entered into a list i.e. the same 
results are produced as when run via terminal/command prompt. The parsing 
methods returns a list, which is similar to the sys.argv, when you run script 
from command line.
3. Adds tests for the parsing method
4. Extends mock_idle for point 3

I am on Debian and don't have access to a windows machine. please try to run 
the tests on windows machine and see if its OK.(cmd handles arguments rather 
differently.)

Also, should we persist the command line argument that user entered across 
sessions?

--
nosy: +sahutd
Added file: http://bugs.python.org/file34568/cmd-arg.patch

___
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



[issue5680] Command-line arguments when running in IDLE

2014-02-04 Thread Tal Einat

Changes by Tal Einat talei...@gmail.com:


--
nosy:  -taleinat

___
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



[issue5680] Command-line arguments when running in IDLE

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

___
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



[issue5680] Command-line arguments when running in IDLE

2012-03-31 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
assignee:  - asvetlov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5680
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2012-03-26 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5680
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2010-07-28 Thread Mark Lawrence

Mark Lawrence breamore...@yahoo.co.uk added the comment:

Putting tjr and tal on nosy list cos it's IDLE.  Apologies if I've got it wrong.

--
nosy: +BreamoreBoy, taleinat, tjreedy
versions: +Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5680
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2010-02-04 Thread Gabriel Genellina

Gabriel Genellina gagsl-...@yahoo.com.ar added the comment:

A different patch to solve the same issue.
This one uses a standard tkSimpleDialog to prompt for the command line, and 
follows the directives found at the top of the source (only took 8 years to 
implement... not so bad :) )

XXX GvR Redesign this interface (yet again) as follows:

- Present a dialog box for ``Run Module''

- Allow specify command line arguments in the dialog box

--
nosy: +gagenellina
Added file: http://bugs.python.org/file16139/issue5680-patch2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5680
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2009-04-26 Thread Daniel Diniz

Changes by Daniel Diniz aja...@gmail.com:


--
nosy: +gpolo
priority:  - normal
stage:  - patch review
versions: +Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5680
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5680] Command-line arguments when running in IDLE

2009-04-03 Thread Matthew Barnett

New submission from Matthew Barnett pyt...@mrabarnett.plus.com:

Patch idle-args.diff adds a dialog for entering command-line arguments
for a script from within IDLE itself.

--
components: IDLE
files: idle-args.diff
keywords: patch
messages: 85341
nosy: mrabarnett
severity: normal
status: open
title: Command-line arguments when running in IDLE
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file13600/idle-args.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5680
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com