How to start IDLE (Python editor) without using the shortcut on Windows Vista?
Asked Answered
L

13

50

I'm trying to teach Komodo to fire up IDLE when I hit the right keystrokes. I can use the exact path of the shortcut in start menu in the Windows Explorer location bar to launch IDLE so I was hoping Komodo would be able to use it as well. But, giving this path to Komodo causes it to say that 1 is returned. This appears to be a failure as IDLE doesn't start up.

I thought I'd avoid the shortcut and just use the exact path. I go to the start menu, find the shortcut for IDLE, right click to look at the properties. The target is grayed out, but says "Python 2.5.2". The "Start in" is set to, "C:\Python25\". The "Open File Location" button is also grayed out.

How do I find out where this shortcut is really pointing? I have tried starting python.exe and pythonw.exe both in C:\Python25, but neither starts up IDLE.

Leatri answered 22/9, 2008 at 23:44 Comment(3)
I think nobody answered your question: "How do I find out where this shortcut is really pointing?". How did they find out their answers? What do I do when I see this kind of shortcut and want to find where it is leading?Isidora
If you check the Properties (right-click menu) of a shortcut, it should tell you where it points. The question and the title don't exactly match up, now that you point it out @Sunny88.Commando
@Commando The problem is that this seems like the logical thing to do on windows, but it surprisingly gives no information in this case. I'm not a windows expert, but it's downright weird to have a shortcut like this that successfully points to a file and not be able to figure out what that file is.Xenomorphic
L
69

There's a file called idle.py in your Python installation directory in Lib\idlelib\idle.py.

If you run that file with Python, then IDLE should start.

c:\Python25\pythonw.exe c:\Python25\Lib\idlelib\idle.py

Lundin answered 22/9, 2008 at 23:49 Comment(5)
For another version of python, use C:\PythonXX\pythonw.exe C:\PythonXX\Lib\idlelib\idle.py Replace the XX with your version, ie: C:\Python27\pythonw.exe C:\Python27\Lib\idlelib\idle.pyEcstatic
When I try to write to a file directly in the C drive, I get PermissionDeniedError. I'm speculating this is because I haven't launched in "Administrator Mode". How can I do the same, except in Administrator mode?Barrens
@Ecstatic That seems to work well when running multiple versions of Python.Genteel
How to assign this path so that all my .py files open in idle for editing. Right now when I double click it runs it on python.exe which executes the program.Vitrescence
Where is it for python 3.10 on windows 10?Chlorophyll
C
17

In Python 3.2.2, I found \Python32\Lib\idlelib\idle.bat which was useful because it would let me open python files supplied as args in IDLE.

Commando answered 12/9, 2011 at 21:48 Comment(0)
E
10

Here's another path you can use. I'm not sure if this is part of the standard distribution or if the file is automatically created on first use of the IDLE.

C:\Python25\Lib\idlelib\idle.pyw
Eachern answered 22/9, 2008 at 23:56 Comment(0)
A
10

If you just have a Python shell running, type:

import idlelib.PyShell
idlelib.PyShell.main()
Adah answered 23/11, 2011 at 4:35 Comment(1)
The two lines in this answer can and should be replaced by import idlelib.idle.Silviasilviculture
S
4

there is a .bat script to start it (python 2.7).

c:\Python27\Lib\idlelib\idle.bat
Schapira answered 21/2, 2016 at 11:33 Comment(0)
G
3

Python installation folder > Lib > idlelib > idle.pyw

Double click on it and you're good to go.

Guerrilla answered 2/8, 2013 at 18:5 Comment(1)
correct this way works for me when launching it in Windows 8.1Tenuto
N
1

You can also assign hotkeys to Windows shortcuts directly (at least in Windows 95 you could, I haven't checked again since then, but I think the option should be still there ^_^).

Nickola answered 8/10, 2009 at 10:51 Comment(0)
A
1

The idle shortcut is an "Advertised Shortcut" which breaks certain features like the "find target" button. Google for more info.

You can view the link with a hex editor or download LNK Parser to see where it points to.

In my case it runs:
..\..\..\..\..\Python27\pythonw.exe "C:\Python27\Lib\idlelib\idle.pyw"

Alded answered 6/11, 2015 at 18:6 Comment(0)
R
1

I setup a short cut (using windows) and set the target to

C:\Python36\pythonw.exe c:/python36/Lib/idlelib/idle.py

works great

Also found this works

with open('FILE.py') as f:
    exec(f.read())
Rucker answered 11/4, 2017 at 23:10 Comment(0)
C
1

Another option for Windows that will automatically use the most recent version of Python installed, and also doesn't make you look for the installation path:

Target: pyw -m idlelib
Start in: Wherever you want

Confluence answered 29/12, 2019 at 0:48 Comment(0)
F
0

I got a shortcut for Idle (Python GUI).

  • Click on Window icon at the bottom left or use Window Key (only Python 2), you will see Idle (Python GUI) icon
  • Right click on the icon then more
  • Open File Location
  • A new window will appears, and you will see the shortcut of Idle (Python GUI)
  • Right click, hold down and pull out to desktop to create a shortcut of Python GUI on desktop.
Fiend answered 30/7, 2017 at 20:20 Comment(0)
P
0

Python installation folder > Lib > idlelib > idle.pyw

send a shortcut to desktop.

From the desktop shortcut you can add it to taskbar too for quickaccess.

Hope this helps.

Pennington answered 8/4, 2019 at 20:2 Comment(1)
Where is the installation folder by default, it's not in program files, not in C root, not in appadata, I hope it's not hidden in WindowsProgram hidden and encrypted folder.Chlorophyll
C
0

If it's installed on windows 10 without changing default location, it seem it is in "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1776.0x64__{BUNCHOFRANDOMSTRINGS}" and you won't be able to open it.

Good luck finding how open .py by default with idle.

Chlorophyll answered 24/8, 2022 at 20:17 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Bechuanaland

© 2022 - 2024 — McMap. All rights reserved.