473,472 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to Run IDLE from startup in Windows Vista or from a commandline

1 New Member
Very basic info for beginners, by a beginner. IDLE is the learning console that comes with most Python distributions. I am new to playing with Python and wanted to get IDLE to load when I logged into my Windows profile. I searched the internet without finding the info I wanted. I also did not find the answer in the thread Help running pythonw from a command prompt with arguments and have since figured out how to do it, so I decided to post exactly what I did and why it worked.

Some background info: IDLE is a Python script, not a native Windows machine executable. In Windows it loads differently from EXE's, MSI's, COM's, BAT's, and DLL's. To run IDLE, the system first loads either python.exe or pythonw.exe. The difference between these two are that python.exe runs inside of a text console and has support for the console's features, but pythonw does not. Pythonw is the default choice to load the file idle.pyw that is IDLE, because IDLE does not use the basic text console.

Here is what I did wrong:

In Windows Vista Ultimate after I had installed a typical binary packaged Python 2.6 from Python.org I wanted IDLE to start when I logged in, so I tried adding a link to the executable PYTHONW.EXE in my startup folder. I went onto the start menu and tried to find the executable by getting the properties info off of the IDLE link. I then copied this info into another shortcut, but all that the shortcut would do was open the Python26 folder! ? The problem was the assumption that IDLE was either an EXE or COM windows executable, which was incorrect. Instead, the Python interpreter installation set up python scripts to be loadable in Windows, and python itself was the loader.

Here is what I did right. I made a batch file containing the following two lines:

start c:\python26\pythonw.exe c:\python26\Lib\idlelib\idle.pyw %1 %2 %3 %4 %5 %6
exit


I put a link to the batch file into my startup, and it worked. When I log in, IDLE comes up. Here is the explanation of how the batch file works:

When windows opens the batch file by starting a text command console and loading the batch file. The first line in the batch file directs it to load pythonw.exe. It uses the command START to load it as a separate process, so that when the EXIT command is followed pythonw.exe will continue to run. To summarize the first line loads pythonw.exe, which in turn loads idle.pyw. Finally the EXIT command orders windows to close the text command console. At that point, Pythonw.exe has loaded and it has loaded the idle.pyw. The %number items are for passing additional information to pythonw.exe or to idle.pyw. When executing batch files from a Windows command console, you may type parameters at the end of the same line; and these will be passed to pythonw.exe by means of those %numbered items. For example if I named the batch file 'StartIdle.bat' and had called it by typing "StartIdle Cat" the letters Cat would be passed into the batch file during execution and tacked onto the end of the line in place of the %1 .
Jan 2 '11 #1
1 5177
milesmajefski
10 New Member
Thanks for the beautifully written article. This worked perfectly in Windows XP SP3 with Python 3.2.1. I hope to see more articles like this!
Aug 17 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: salad | last post by:
Due to an earlier posting I read in this newsgroup regarding Office 2007 beta, I downloaded it. After I DL'd it, I got an invitation from MS to get WinVista. I am now wondering if, since both...
0
by: axlq | last post by:
While trying to learn the ins and outs of the php CURL library, I decided to write a php script that posts a form on the Chicago Board of Options (CBOE) web site, which returns an ASCII text file. ...
1
by: fredfrog22 | last post by:
The following is an extract from a C# console application that creates a Virtual Directory on IIS 5 or 6. This code works on XP, Windows 2003 Server, Windows 2000. It does not work on Windows...
6
by: j2ee.singh | last post by:
Hi, I'm looking to buy a new laptop primarily to learn & practice .NET and C#. My Question is: Is there any requirement for .NET and C# in terms of the following Operating Systems: -...
19
by: =?Utf-8?B?TWlrZTk5MDA=?= | last post by:
When there is a shortcut of our app on the desctop, the app is not run until all the security in control panel of win vista is cleared. What to do to not have this problem. We do not want to tell...
4
by: =?Utf-8?B?Q2FybGFKYWRl?= | last post by:
Can anyone help me? I need to use picture it 2000 every day and use to use it on Windows XP and had NO problems at all. If I would open up windows explorer i could be in my folder that has all of...
1
by: samhale | last post by:
Hi, I've just purchased a new machine with Windows Vista, and the cd I have for SQL Enterprise Manager (that works perfectly on Windows XP) no longer works. Is there a version for Windows...
12
by: Alan M Dunsmuir | last post by:
After having worked with Apache/MySQL/PHP for a year or so under Linux I need, purely for convenience, to set up a parallel platform under Windows. Unfortunately, since I last did this (using...
2
by: =?Utf-8?B?TG9yZW4=?= | last post by:
I have a brand new Dell computer right out of the box. It was purchased with Windows Vista Basic. I have also separately purchased Windows Vista Ultimate and I want to install it on this new...
1
by: Frank van Eijkelenburg | last post by:
Hi, I have to develop an application which must run on .net 2.0 on a Windows XP SP2 and Windows Vista Business OS. Is .net 2.0 supported at Windows Vista? If I see the supported OS at the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.