[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

importing modules at IDLE startup



Le lundi 16 novembre 2009 à 13:15 -0800, Mark Voorhies a écrit :

> One such hackish solution is to use a modified version 
> of /usr/bin/idle-python2.5 that invokes the python interpreter with "new" 
> division, e.g.:
> ------------------------------------
> #!/usr/bin/python2.5 -Qnew
> 
> from idlelib.PyShell import main
> if __name__ == '__main__':
>     main()
> --------------------------------------
> idlelib.PyShell.main will parse command line arguments, so invoking with -s 
> will still see your PYTHONSTARTUP script.
OK, now I have the "new" division active, both when starting idle
through  the command line and with gnome menu! Unfortunately, when
starting idle with gnome menu, I cannot use sqrt(2) (but it works when
runing idle in a command line with -s option). I hardly believe that
PYTHONSTARTUP is not set up, because according to env PYTHONSTARTUP is
set to /home/fred/.pythonrc.py. I tried to create an .xsession file in
my home (after reading the link you gave), but had to remove it because
X could not start.

I really don't understand this difference between running idle-python2.5
through command line (which works) and through gnome menu. Fixing this
would definitively solve my problem... I still try to fix this point.
 
Thank you very much for your help. I fully understand that it is best to
teach students setting up the environment at the beginning of their
script, but here my goal is really not to teach programming, only the
first steps in a introductory (and very basic) course on algorithmic.

  Frédéric.


Reply to: