Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide IDLE menu option to set command-line arguments #67853

Closed
rhettinger opened this issue Mar 14, 2015 · 3 comments
Closed

Provide IDLE menu option to set command-line arguments #67853

rhettinger opened this issue Mar 14, 2015 · 3 comments
Labels
topic-IDLE type-feature A feature request or enhancement

Comments

@rhettinger
Copy link
Contributor

BPO 23665
Nosy @rhettinger, @terryjreedy, @mcepl
Superseder
  • bpo-5680: Simulate command-line arguments for program run in IDLE
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-03-20.22:03:37.696>
    created_at = <Date 2015-03-14.23:33:44.295>
    labels = ['expert-IDLE', 'type-feature']
    title = 'Provide IDLE menu option to set command-line arguments'
    updated_at = <Date 2016-09-09.21:40:57.396>
    user = 'https://github.com/rhettinger'

    bugs.python.org fields:

    activity = <Date 2016-09-09.21:40:57.396>
    actor = 'mcepl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-03-20.22:03:37.696>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2015-03-14.23:33:44.295>
    creator = 'rhettinger'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 23665
    keywords = []
    message_count = 3.0
    messages = ['238108', '238207', '238728']
    nosy_count = 4.0
    nosy_names = ['rhettinger', 'terry.reedy', 'mcepl', 'Saimadhav.Heblikar']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '5680'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue23665'
    versions = ['Python 3.5']

    @rhettinger
    Copy link
    Contributor Author

    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:

    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.

    @rhettinger rhettinger added topic-IDLE type-feature A feature request or enhancement labels Mar 14, 2015
    @SaimadhavHeblikar
    Copy link
    Mannequin

    SaimadhavHeblikar mannequin commented Mar 16, 2015

    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 :) )

    @terryjreedy
    Copy link
    Member

    bpo-5680 has 3 different patches. I have not reviewed them yet. I will link to Raymond's message there.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants