[Tutor] how to stop output to terminal

Luke Paireepinart rabidpoobear at gmail.com
Sat May 12 05:51:45 CEST 2007

shawn bright wrote:
> lo there all,
> i have a simple thread that i want to run without piping any output to 
> the terminal.
> like if i do an
> x = os.system("ping -c 1 www.google.com <http://www.google.com>")
> i don't want it to show all the stuff in the terminal.
if you use os.popen or the subprocess module you can execute system 
commands and have their output stored in file-like objects.
then if you don't want any output, don't read from them.
> can i disable it for only certain lines?
yeah, just read in all lines and display the ones which meet your criteria.
> thanks
> ------------------------------------------------------------------------
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

More information about the Tutor mailing list