Compute pi to base 12 using Python?
M.E.Farmer
mefjr75 at hotmail.com
Mon Apr 18 00:28:18 EDT 2005
>>PS. Redirecting with > from a script whose interpreter was started by
>>windows extension association
>>doesn't work on some version of windows. To be safe, invoke the
>>interpreter explicitly, e.g.,
>> python myscript.py [whatever args here] > pi3003.txt
>Thanks very much for this.
>What kind of args could I use here?
Any that your script allows or understands.
an example:
python c:/Python22/Lib/PySourceColor.py -i- -s -l < c:/MyFile.py >
c:/tmp/myfile.html
A few things that might help you write a well behaved script:
if sys.stdin.isatty():
"direct"
else:
"redirected"
This snippet can determine if you have redirected IO.
I just found this and it looks informative.
http://www.jpsdomain.org/windows/redirection.html
hth,
M.E.Farmer
More information about the Python-list
mailing list