Where does my output go?

Gerhard Häring g.haering at ___skynamics.com.invalid
Wed Sep 5 12:01:06 EDT 2001


Michael Abbott wrote:
> "Maan M. Hamze" <mmhamze at pleiades.net> wrote in 
> news:tpcfiohb7crq2c at corp.supernews.com:
> 
>>"Michael Abbott" <michael at rcp.co.uk> wrote in message
>>news:Xns91139DA18A194michaelrcpcouk at 194.238.50.13...
>>
>>>So, I write a small bit of Python (one line):
>>>
>>>write.py
>>>--------
>>>    print 'hello'
>>>--------
>>>
>>>I then run it from the command line:
>>>
>>>    C:\TEMP>write
>>>    Hello
>>>
>>>
>>I do not understand this step here.  How are you running write as an
>>executable? and why is it printing Hello not hello?
>>
> 
> Oops.  My mistake.  I cut and pasted the output, but unfortunately, I 
> didn't cut and paste the source code!  The source code should, of course, 
> be
> 
>     	print 'Hello'
> 
> As to why running it from the command line (with or without a .py 
> extension) works?  Indeed, that is a mystery, one of the many mysteries of 
> this <irony>marvellous</irony> operating system we use.
>     	It's something to do with how the .py extension is registered, I know 
> that much.
> 

C:\temp\e>copy con: write.py
print "Hello."
^Z
         1 Datei(en) kopiert.
C:\temp\e>write.py
Hello.
C:\temp\e>write.py >out.txt
C:\temp\e>type out.txt
Hello.
C:\temp\e>echo %OS%
Windows_NT

Actually version 5 SP2 aka Windows 2000. Windows 9x/ME console is known 
to be buggy.

Gerhard
-- 
Gerhard Häring
skynamics AG
g.haering at skynamics.com
http://www.skynamics.com




More information about the Python-list mailing list