Code: Select all
if response == 0:
print(hostname, "is up")
if option == 1:
print(option, "is the option')
print('this is option number 1')
elif option == 2:
print(option, "is the option')
print('this is option number 2')
else:
print(option, "is the other option')
print('this is the result of other option')
Code: Select all
with open("test.txt", "a") as myfile:
myfile.write("appended text")
Code: Select all
09:10 192.168.0.1 is up
09:10 1 is the option
09:11 this is option number 1
11:15 192.168.0.1 is up
11:10 1 is the option
11:11 this is option number 1
13:10 192.168.0.1 is up
13:10 3 is the other option
13:11 this is the result of other option