The following error occurred in my code, and I do not understand how this case can occur:
if(len(sys.argv) > 0):
doSomething()
else:
raise AttributeError("Could not parse script name")
The above code is in the python class that I import and use in some script. I use the same class with the same call in other scripts and it works great everywhere. FYI, my OS is ubuntu.
How is it possible that len (sys.argv) is <= 0?
source
share