I am having a beginner mistake and i can't see where I have gone wrong.
I am trying to break the program if commandline argument[0] is empty.
I'm running python on macports.
import sys
script = sys.argv[0]
ip = sys.argv[1]
port = sys.argv[2]
if script is None:
print 'script argv is: ' + script
break
print "[+] The script name is: " + script
print "[+] The IP is: " +IP+" and the port is: " +port
I keep getting this error.
mars13:python beebs$ python sys.py
File "sys.py", line 9
break
SyntaxError: 'break' outside loop
Line 9 refers to break.
breakstatement when there is no loop yourifstatement is not a loop