python: IndexError: list index out of range (file = sys.argv[1]) -
if __name__ == "__main__": file = sys.argv[1] f = fst("q0") #f.addstate("1", true) #f.addstate("2", true) #f.addstate("3", true)
in line file = sys.argv[1]
getting error. can please me out.
the sys.argv
list populated when command line arguments script present. sys.argv[0]
name of script running. sys.argv[1]
first command line argument passed script. need call script like:
python script_name first_arg
Comments
Post a Comment