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

Option to set startup directory in IDLE #72961

Open
rhettinger opened this issue Nov 22, 2016 · 9 comments
Open

Option to set startup directory in IDLE #72961

rhettinger opened this issue Nov 22, 2016 · 9 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes topic-IDLE type-feature A feature request or enhancement

Comments

@rhettinger
Copy link
Contributor

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']

@rhettinger
Copy link
Contributor Author

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.

@terryjreedy
Copy link
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.

@rhettinger
Copy link
Contributor Author

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.

@terryjreedy
Copy link
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.

@terryjreedy terryjreedy added the type-feature A feature request or enhancement label Nov 27, 2016
@Shredder13
Copy link
Mannequin

Shredder13 mannequin commented Nov 27, 2016

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!

@terryjreedy
Copy link
Member

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

@terryjreedy terryjreedy added the 3.8 only security fixes label Dec 11, 2018
@tonybaloney
Copy link
Mannequin

tonybaloney mannequin commented May 6, 2019

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

@terryjreedy
Copy link
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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@terryjreedy
Copy link
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
Labels
3.7 (EOL) end of life 3.8 only security fixes topic-IDLE type-feature A feature request or enhancement
Projects
Status: No status
Development

No branches or pull requests

2 participants