47

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.

Jason Dagit
  • 13,034
  • 8
  • 31
  • 54
  • 5
    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? – Sunny88 Mar 21 '13 at 12:23
  • 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. – 2rs2ts Jun 11 '13 at 17:32
  • 2
    @2rs2ts 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. – David Berger Dec 03 '14 at 03:02

12 Answers12

66

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

Ahmed Ashour
  • 4,209
  • 10
  • 29
  • 46
Florian Bösch
  • 26,034
  • 11
  • 45
  • 52
  • 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.py` – TrinitronX May 15 '12 at 05:37
  • 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? – The Red Pea Sep 06 '15 at 19:25
  • @TrinitronX That seems to work well when running multiple versions of Python. – Jim Aho Sep 28 '15 at 10:21
  • 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. – Abhishek Agarwal Jun 12 '17 at 04:02
16

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.

2rs2ts
  • 9,020
  • 6
  • 44
  • 80
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
Dara Kong
  • 1,198
  • 2
  • 13
  • 11
10

If you just have a Python shell running, type:

import idlelib.PyShell
idlelib.PyShell.main()
Roger
  • 881
  • 7
  • 6
4

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

c:\Python27\Lib\idlelib\idle.bat
Ohad Cohen
  • 4,387
  • 2
  • 29
  • 31
3

Python installation folder > Lib > idlelib > idle.pyw

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

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 ^_^).

Lakshman Prasad
  • 76,135
  • 46
  • 128
  • 164
fortran
  • 67,715
  • 23
  • 125
  • 170
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"

cbeytas
  • 11
  • 1
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())
goto
  • 7,020
  • 10
  • 40
  • 50
1amdadmt
  • 33
  • 1
  • 6
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.
Dwhitz
  • 1,155
  • 6
  • 23
  • 33
ted
  • 1
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.

0

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

Dennis
  • 832
  • 2
  • 10