On 14 June 2013 13:35, Dave Angel <da...@davea.name> wrote: > >> MS batch file py27.bat >> >> python2.7 -i -c "import os;os.chdir('c:/python27/**jimprogs');del(os) >> >> > That seems rather silly. Why not > > ------py27.bat------- > c: > cd \python27\jimprogs > python2.7 %$ > --------------------- >
That's certainly easier, but since I was looking at Python --help and saw the -c command I thought I'd try passing a program in as a string, since I hadn't done that. I'm still learning and may try out weird stuff. I just broke PyScripter and IDLE running some Fermat numbers, but discovered they printed out just fine, at a dizzying speed, in the DOS box. It's a useless program where you can barely read the results, but it was very useful to find out the DOS box does something when the my IDE and IDLE choke. Midrange machine -this might actually work in a better IDE on a high end machine: import math fermat = ["x is {} and y is {}".format(x,y) for x in range(1000) for y in range(1000) if not isinstance(math.sqrt(x**2 + y**2),int)] print(fermat) DOS started printing almost instantly, which means DOS is much, much faster than my IDE, since the entire list had to be figured before printing (which took a long time in the IDEs ;') Which means the IDE could fool me into thinking something takes forever to run when it gallops in DOS. Useful to know. Jim
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor