[Edu-sig] How do I import from __future__ at startup?

Gregor Lingl glingl at aon.at
Sun Feb 27 23:40:34 CET 2005


One way to accomplish this is to start Python with
the -Qnew switch:

python -Qnew

If you want to run a script with this option,
e.g. the script division.py with this content:

print 11/3

then use

c:\Python24\python -Qnew division.py
3.6666666667

(or something similar on a Linux system)

Regards, Gregor

Christian Mascher schrieb:
> Hello all,
> 
> I managed to do this once, but I forgot.
> 
> I want division always to be imported from __future__ at startup.
> 
> Putting
> from __future__ import division
> in a file sitecustomize.py doesn't work (which I think is 
> counterintuitive). Do I have to use PYTHONSTARTUP variable? Is there any 
> way at all?
> 
> I searched google and python.org but didn't find a quick answer to this.
> Perhaps somebody can help me out?
> 
> Thanks,
> 
> Christian
> 
> 
> _______________________________________________
> Edu-sig mailing list
> Edu-sig at python.org
> http://mail.python.org/mailman/listinfo/edu-sig
> 
> 

-- 
Gregor Lingl
Reisnerstrasse 3/19
A-1030 Wien

Telefon: +43 1 713 33 98
Mobil:   +43 664 140 35 27

Autor von "Python für Kids"
Website: python4kids.net


More information about the Edu-sig mailing list