I found out that i could ping a system on python by typing
os.system('ping ip')
but whe开发者_Go百科n i execute it, it shows cmd.
My question is, how do i ping someone on python without showing the cmd?If you need only a ping, then it would be better to use something like ping.py.
In other cases use subprocess
as suggested by @Sentinel
Look at the
http://docs.python.org/library/subprocess.html
module.
It gives you enough options for controlling the output.
Or use standard bash redirection in order to send the output to /dev/null
See my answer to hiding console when run in os.startfile()
精彩评论