Blank Line at Program Exit

Nitebirdz nitebirdz at sacredchaos.com
Sat Aug 22 17:25:16 CEST 2009


On Thu, Aug 20, 2009 at 01:31:14PM +0800, Steven Woody wrote:
> Hi,
> Any python program, even that does absolutely nothing in the code, will
> cause a blank line printed out when the program exit.  What's the reason?
>  Thanks.
> 

Chances are it is related to whichever operating system and/or shell you
are using.  For instance, this is taken from a system running Ubuntu
Linux 8.04:

-------------------------------------------------
laptop:$ cat hello.py
#!/usr/bin/env python

print "Hello, there!"
laptop:$ ./hello.py
Hello, there!
laptop:$ cat nothing.py 
#!/usr/bin/env python

laptop:$ ./nothing.py 
laptop:$ 
-------------------------------------------------


As you can see, no blank line was printed out. 




More information about the Python-list mailing list