We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import subprocess as sp
status = sp.call(['tcping', '-c', '1', '-t', '1', 'github.com'], stdout=sp.DEVNULL, stderr=sp.DEVNULL) print(status)
status = sp.run(['tcping', '-c', '1', '-t', '1', 'github.com'], stdout=sp.DEVNULL, stderr=sp.DEVNULL) print(status)
上面这段代码我在测试的时候发现,不管github.com 这个位置填写的 ip地址还是域名是否能连通,它返回的都会返回0,按您上面描述0等于可以ping通。不知道是为什么。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
import subprocess as sp
Print the return code (status=0 mean ping success)
status = sp.call(['tcping', '-c', '1', '-t', '1', 'github.com'], stdout=sp.DEVNULL, stderr=sp.DEVNULL)
print(status)
OR print the full message
status = sp.run(['tcping', '-c', '1', '-t', '1', 'github.com'], stdout=sp.DEVNULL, stderr=sp.DEVNULL)
print(status)
上面这段代码我在测试的时候发现,不管github.com 这个位置填写的 ip地址还是域名是否能连通,它返回的都会返回0,按您上面描述0等于可以ping通。不知道是为什么。
The text was updated successfully, but these errors were encountered: