Am Mon, 17 Sep 2012 14:45:41 -0400 schrieb Philip Webb <purs...@ca.inter.net>:
> 120917 David W Noon wrote: > > On Mon, 17 Sep 2012 13:14:27 -0400, Philip Webb wrote re Python 2/3 : > >> print ' ',eval(expression) > > The above line uses obsolete syntax. Try using > > #!/usr/bin/python2 -3 > > for your hash-bang line on all your old Python scripts. > > Well, thanks for the info -- which is what I suspected -- , > but just what is the correct Python3 syntax for that simple print line ? > This is my only Python script, which I got from somewhere long forgotten, > & I generally don't have a need to do Python programming. print ' ',eval(expression) becomes print(' ',eval(expression)) > While this subject is open, can anyone tell me > how to get Python3 started from CLI automatically to load the math item ? > -- ie to do 'from math import *' without my having to type it ? > That would make it possible to use 'python' instead of my script, > which would then allow me to use variables, sometimes an advantage. Sorry, I don't know, and skimming through the python man page didn't turn up anything except "-m <module>", which executes a python module as a script. Perhaps someone else knows a possibility. Apart from that, I don't really understand what you want to do from there. Could you maybe explain in more detail? HTH -- Marc Joliet -- "People who think they know everything really annoy those of us who know we don't" - Bjarne Stroustrup
signature.asc
Description: PGP signature