In the code you show, c
and therefore x
are set to sys.argv[0]
, which is a string. You can't use a string to index into a list.
Did you mean to say:
if __name__ == "__main__":
if len(sys.argv) < 2:
raise Exception, "missing first parameter - row"
c = int(sys.argv[1])
dothis(c)