Hello Team,
I've been having a wierd problem with 2 of my scripts and I now know the problem was in my if statements.
code=sys.argv[1]
phone=sys.argv[2]
message=sys.argv[3]
if code == 949:
servId='62000001760'
elif code == 947:
servId='62000001840'
else:
servId='90928'
print servId
I run this script as:
sudo python printserv.py 949 254727 mesag
My result should be 62000001760, but somehow it always prints the value of else.
but if I do
if code in '949': ...
It always prints the correct thing. Someone please explain why this is so.