how to stop info output on screen

Steve Holden steve at
Fri Sep 30 15:03:00 CEST 2005 at wrote:
> Hi,
> Does someone know how to stop "the information output on screen"? Now
> when I run my code, it outputs a lot of message when calling other
> libraries, together with the info with the print command I used.
> How can I mask these info on screen when calling other libraries and
> how I can mask the info output produced by the print command? Is there
> a way to mask them separately.
> Thanks a lot if anyone knows it.
> Kind regards of your help
> Midday
Since you appear to be adding your own code, with your own print 
statements, to an existing Python program the easiest thing to do is 
make sure your own code writes to a place of your choice. This is most 
easily done with

   myFile = open("myfile.txt", "w")
   print >> myFile, this, that, the other
   print >> myFile, moreStuff(things)

Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC           
PyCon TX 2006        

More information about the Python-list mailing list