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

自古美人都是妖i 提交于 2019-12-17 15:47:26

问题


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.


回答1:


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




回答2:


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.




回答3:


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



回答4:


If you just have a Python shell running, type:

import idlelib.PyShell
idlelib.PyShell.main()



回答5:


Python installation folder > Lib > idlelib > idle.pyw

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




回答6:


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

c:\Python27\Lib\idlelib\idle.bat



回答7:


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




回答8:


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"




回答9:


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



回答10:


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.



回答11:


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.



来源:https://stackoverflow.com/questions/118260/how-to-start-idle-python-editor-without-using-the-shortcut-on-windows-vista

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!