Skip to content

Option to set startup directory in IDLE #72961

Open

Description

@rhettinger
BPO 28775
Nosy @rhettinger, @terryjreedy, @Shredder13, @tonybaloney

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 = 'https://github.com/terryjreedy'
closed_at = None
created_at = <Date 2016-11-22.17:54:11.977>
labels = ['3.8', 'expert-IDLE', 'type-feature', '3.7']
title = 'Option to set startup directory in IDLE'
updated_at = <Date 2020-03-13.00:37:26.033>
user = 'https://github.com/rhettinger'

bugs.python.org fields:

activity = <Date 2020-03-13.00:37:26.033>
actor = 'terry.reedy'
assignee = 'terry.reedy'
closed = False
closed_date = None
closer = None
components = ['IDLE']
creation = <Date 2016-11-22.17:54:11.977>
creator = 'rhettinger'
dependencies = []
files = []
hgrepos = []
issue_num = 28775
keywords = []
message_count = 8.0
messages = ['281494', '281554', '281645', '281807', '281823', '329974', '341653', '364059']
nosy_count = 4.0
nosy_names = ['rhettinger', 'terry.reedy', 'Nofar Schnider', 'anthonypjshaw']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'test needed'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue28775'
versions = ['Python 3.7', 'Python 3.8']

Activity

  1. rhettinger commented on Nov 22, 2016

    @rhettinger
    ContributorAuthor

    In my Python courses, Windows users frequently ask about how to set a startup directory so they can run from their Desktop or a custom directory.

    The usual answer is to create a short-cut and then alter the properties on that shortcut. However, other programs they are used to will allow the startup directory to be specified from within the program (in our case, the preferences menu).

    Also, we should change the default directory from C:\\Python27 which is almost never the right place. A documents directory would be more appropriate.

  2. terryjreedy commented on Nov 23, 2016

    @terryjreedy
    Member

    I agree. I have had in mind (but cannot find an issue) to change the default to a user's home directory, as the best general default. But even that is not really the proper place that many would want. I can adapt and reuse the code used to browse and validate custom help files.

  3. rhettinger commented on Nov 24, 2016

    @rhettinger
    ContributorAuthor

    Terry, if you're open to it, I would like to have one of our new aspiring core developers work on this patch under your direction. Nofar Schnider has expressed an interest.

  4. terryjreedy commented on Nov 27, 2016

    @terryjreedy
    Member

    Raymond: yes, I am definitely open to collaboration on this issue. The timing is good as I just started, a month ago, expanding configure dialog testing beyond the trivial one of creating an instance without raising. Real tests are needed preparation for making other changes, including adding other new options in 3.6+. I would like to include this one in 3.6.1, 4 to 6 months from now.

    Doing so may require more information about IDLE on *nix and Mac than I currently have. Which of those have you run IDLE on? Or helped people with in your classes?

    Nofar: welcome. I have two immediate questions. 1) Which OS do you primarily work with? (I am using Win 10.) Can you test on anything else? 2) Are you only interested in this issue, or might you be open to working on other issues if this one is successful?

    Idlelib is not an easy codebase to get into. The +-60 modules are listed in README.txt. There is also a mapping from menu items to implementation code. However, the README does not cover the addition of a new option. I will write and upload a design document or roadmap for this one.

  5. Shredder13 commented on Nov 27, 2016

    Shredder13mannequin
    Mannequin

    Thanks Terry.
    I am working on my Macbook Pro so my OS is macOS Sierra. Would love to test on it and also, I am able to test on several VMs with different Unix distributions.
    I am interested in anything that: 1) can help the Python community. 2) I could learn from. So the answer is YES.

    Just let me know where to start!

  6. terryjreedy commented on Nov 15, 2018

    @terryjreedy
    Member

    This is partially a duplicate of bpo-22121, but that focused most on the default startup directory on Windows.

  7. tonybaloney commented on May 6, 2019

    tonybaloneymannequin
    Mannequin

    Hi Nofar are you still interested on working on this request?

  8. terryjreedy commented on Mar 13, 2020

    @terryjreedy
    Member

    The rule for whether to switch to the configured directory might be
    if sys.stdout is None: chdir...

    On windows, this is true when starting in the console with
    pyw(pythonw) -m idlelib
    But there is no need to include the (Windows-only) 'w'. It is meant to be used in the Windows icon shortcut. The option to start in the configured directory even from the console might be seen as a plus.

  9. transferred this issue fromon Apr 10, 2022
  10. terryjreedy commented on Jul 16, 2023

    @terryjreedy
    Member

    In half-duplicate issue #106786, Raymond wrote

    The startup directory problem is especially irritating because by default IDLE starts up in a hidden path. So any locally created .py files can't easily be found using Windows Explorer. If the users do save new .py files to a new folder on their Desktop, then then can't easily import the files they just made. This makes it difficult when teaching how to import their own modules. This issue can be solved letting IDLE's config specify a startup directory much like MS Word does.

    Currently on Windows, the IDLE startup directory is now the directory of the python binary that is running IDLE. This may or may not be 'hidden', depending on the install location. But it is still not useful for most people. On macOS, it is now the user's Documents directory. Regardless, the startup directory affects the initial directory for Open and for pure Shell sessions that did not start running code from the editor. (When restarting from an edited file, the initial directory is the file's directory, and that must not change.)

    I checked a folder on my desktop with Windows Explorer. When it said [__] > This PC / Desktop / Games, clicking on the blue [__] box turn the entry to C:\Users\Terry\Desktop\Games, with the address selected for copying, which is the text a user would need to enter (or paste) into an IDLE dialog entry box. The right click context menu also had copy entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions