[Idle-dev] auto-loading at shell start and shell restart

Noam Raphael noamraph at gmail.com
Fri Feb 24 01:18:58 CET 2006


Hello,

You can try to set the environment variable PYTHONSTARTUP to a file
with all those lines that you always run when you start working. It
should work fine with Python-in-a-terminal - perhaps you should test
it first.

IDLE should run those commands on startup, if given the -s flag. It
doesn't re-run it if you restart the shell. I worked with a friend of
mine on fixing this, and perhaps I'll post it as a patch.

Have a good day,
Noam

On 2/17/06, Mark Summerfield <M.N.SUMMERFIELD.405728 at swansea.ac.uk> wrote:
> Hi,
>
> I love using IDLE, both for experimenting with python and for
> calculations.
>
> But every time I start IDLE for calculations I have to type in:
>
>     from __future__ import division
>     from math import *
>
> which would be bearable if I only had to do it once a day... but when I
> experiment I often have my code in a separate python file, so I do:
>
>     import mycode
>
> then do my experiments, then, when I've hit problems or want to move
> forward, I do Shell|Restart, and use ^P a few times to get the import
> line back. Which is fine, except that if I've done a lot between imports
> and I want to switch between testing mycode.py and some calculations I
> end up having to type
>
>     from __future__ import division
>     from math import *
>
> time after time.
>
> I wish there was some standard way (i.e. in Options) of having a list of
> python commands to issue whenever the shell is started or restarted.
>
> Regards.
>
> --
> Mark Summerfield
>
> _______________________________________________
> IDLE-dev mailing list
> IDLE-dev at python.org
> http://mail.python.org/mailman/listinfo/idle-dev
>


More information about the IDLE-dev mailing list