On 22/11/2013 14:15, Steven D'Aprano wrote:
On Fri, 22 Nov 2013 05:51:21 -0800, Himanshu Garg wrote:
I want that print "hello" should appear on screen as well as get saved
in a log file.
How can I accomplish this?
print "hello"
logfile.write("hello\n")
Does that satisfy your need? If not, please explain in more detail what
you are trying to do, what you have already tried, and what happened when
you tried it.
Fancy wasting vertical space like that, if you use a semi-colon you can
save a whole lot of it like this
print "hello";logfile.write("hello\n") # :)
--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list