[Tutor] Olle-Olla
Alan Gauld
alan.gauld at freenet.co.uk
Tue Apr 18 20:03:53 CEST 2006
> Is it possible to replace the print statement with one of mine function ?
No precisely because the print statement is a statement (or more accurately
a command) not a function.
But of course you can create your own print *function*, just call it
a slightly different name - printit(), or display(), or logit(), or
somesuch.
> Is it any extra reason why print isn't similar to the functions I can make
> with def ?
Guido's call. Guido has intimated that he thinks this was one
of his (few) mistakes in building Python.
> In reality, I would like to replace the print in my PyCrust app with the
> log.write() function.
You will need to do a search/replace of all print statements with your
new function, but its doable.
HTH,
Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld
More information about the Tutor
mailing list