in python 2.7, I'm trying to:
- Ping an IP address with a subprocess command without showing a console window.
- If the ping subproccess command returns anything other than 0, alert the user that the ping failed
- alert the user using an echo command via a subproccess
Steps 1 and 2 are done. I am having problems with step 3. If there is a better way to do this than what I'm trying to do, I'm open to suggestions. I just wanted a quick and easy way to display a short warning to the user.
The big issue with step 3 is the console window appears, but disappears very quickly. Ideally I'd like to leave the window open until some user feedback is received, but at this point I'll take a timeout too.
Here is what I have:
subprocess.call(['echo', 'One or more of the IPs failed to respond to their ping. Check Logs', ' & pause'])
The end result I'm looking for is the user is going about their daily business on their PC, a popup occurs that tells them a planned ping attempt did not reach its destination, the user provides feedback to close the popup.