HI All,
My name is s0ur and I am not a programmer. Isn't that the first step to recovery?
I am hoping that the experts can help a noob. I am trying to write a python script that will run on windows login. it should do the following:
1) ping IP address
2) analyze response
3a) if true (there is a response) run another command and wait 300 sec.
3b) if no response wait 300 sec.
4) repeat until log out.
It sounds simple when I write it like that but when I try to write it in python - I become an idiot. If someone can help me out on this I would appreciate it. If you have recommendations on an online python course for non-programmers I would also appreciate it. Teach a man to fish, right?
Cheers
s0ur
import os
import time
import sys
import subprocess
ip = " my secret ip"
def pingping (
subprocess.Popen("ping -w 200 -n 1 " + ip, stdout=subprocess.PIPE)):
result_str = pingping.stdout.read():
"0% loss" in result_str:
return;
# Then I become an idiot...
pingping(true);
if pingping == true
subprocess.Popen("secret windows command here")
waitasec
waitasec
# As you can see there is little hope for me at this point.
Thanks