classification
Title: IDLE startup configuration
Type: enhancement Stage: test needed
Components: IDLE Versions: Python 3.3
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: kbk Nosy List: asvetlov, cben, gpolo, kbk, mark, terry.reedy
Priority: normal Keywords:

Created on 2009-03-29 07:20 by mark, last changed 2012-03-26 19:35 by asvetlov.

Messages (3)
msg84367 - (view) Author: Mark Summerfield (mark) Date: 2009-03-29 07:20
My suggestion is to add somewhere in the configuration dialog when users
can enter a block of Python code to be executed at startup and whenever
Restart Shell is executed.

Use case: for people who use IDLE for calculations/experiments they
might like to always have certain module imported. For me personally, it
would be:

   import os
   import re
   import sys
   from math import *

but of course the whole point is that people can write any code they
like. (Some people might want to do various from __future__ imports in
Python 2.6 to get various Python 3 features for example.)

I know that you can use the -c option, but that only works at startup,
not every time you Restart Shell.
msg101175 - (view) Author: Cherniavsky Beni (cben) * Date: 2010-03-16 17:21
Editing a block of code from inside the config dialog (and storing it in the config file?) seems a bad idea because you lose all the power of the normal IDLE editor.

Instead, you should edit the startup code in the editor, save it to a file and point the IDLESTARTUP or PYTHONSTARTUP environment variable to it (http://docs.python.org/library/idle.html#startup).

[Unfortunately, these envvars currently don't work after restart; http://bugs.python.org/issue5233 has patches to fix that.]

What does make sense is having a way to set the startup file from the  config dialog, instead of environment variables.  I suspect nobody cares enough to implement this if you don't.
msg101176 - (view) Author: Cherniavsky Beni (cben) * Date: 2010-03-16 17:39
(Another point I forgot to mention is that you must also run idle with the -s command-line option to look at these envvars.  This was silly and is also fixed by the #5233 patch.)
History
Date User Action Args
2012-03-26 19:35:31asvetlovsetnosy: + asvetlov
2011-03-09 02:10:55terry.reedysetnosy: + terry.reedy

versions: + Python 3.3, - Python 3.1, Python 2.7
2010-03-16 17:39:25cbensetmessages: + msg101176
2010-03-16 17:21:48cbensetnosy: + cben
messages: + msg101175
2009-04-26 22:23:37ajaksu2setpriority: normal
nosy: + gpolo

stage: test needed
2009-04-03 22:12:02kbksetassignee: kbk

nosy: + kbk
2009-03-29 07:20:09markcreate