quick newbie question on variables. please answer

Peter Schneider-Kamp petersc at stud.ntnu.no
Fri Jun 9 01:46:57 EDT 2000


Toy wrote:
> 
> #!/usr/bin/python
> import commands
> b = commands.getstatusoutput('man %x!') % startx
> print = b

print b

print is a special case in that it is like calling
a function but you don't have to put parentheses.
print(b) would more likely be understandable from
a consistency point of view, but as print is used
so often it is a nice abbreviation to write print b
instead.

reminded-of-the-BASIC-"?"-operator-ly y'rs Peter

--
Peter Schneider-Kamp          ++47-7388-7331
Herman Krags veg 51-11        mailto:peter at schneider-kamp.de
N-7050 Trondheim              http://schneider-kamp.de




More information about the Python-list mailing list