faqts : Computers : Programming : Languages : Python : Common Problems : IDLE

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

9 of 10 people (90%) answered Yes
Recently 8 of 9 people (89%) answered Yes

Entry

How do I get IDLE to run a script on startup?

May 25th, 2000 07:43
unknown unknown, Shae Erisson


Problem:

I've created a script called $IDLESTARTUP.py in the IDLE directory, and 
I'm running idle.pyw with the -s switch, but it doesn't appear to be 
working.  (Running IDLE 0.5 on Win98.)

Solution:

$IDLESTARTUP actually means "read the value of the environment variable
IDLESTARTUP"
That means if you add a line in your autoexec.bat that says:
SET IDLESTARTUP="C:\Program Files\Python\Tools\idle\autoidle.py"

Then the -s switch will work (as long as you have a file name
autoidle.py in the correct path that's a python file that is :)

You can of course change the value of that variable to start with any
file you prefer. For shell variables, you don't need to surround them
with double quotes if there aren't any spaces in the path you're giving
it.
ex:
SET IDLESTARTUP=C:\Python\Tools\idle\idlesetup.py
that will work fine since there aren't any spaces (like "Program Files")
in the directory specification.