If i do an import sys, then sys.argv, i get the following error:
2014-03-26 12:05:01: Exception: Python Error: AttributeError : ‘module’ object has no attribute ‘argv’ (Python.Runtime.PythonException)
If i do an import sys, then sys.argv, i get the following error:
2014-03-26 12:05:01: Exception: Python Error: AttributeError : ‘module’ object has no attribute ‘argv’ (Python.Runtime.PythonException)
Hey Laszlo,
The reason is because we’re currently not calling PySys_SetArgvEx to set this information:
docs.python.org/2/c-api/init.html
I just tested calling this with 0, an empty array, and 0 as the parameters, and that seems to work fine (at least, it exhibits the same behavior that running a script inside Nuke does). So we can probably do this for 6.2, although other than not resulting in an error any more, it doesn’t do much else. Out of curiosity, what were you using it for in this case?
Cheers,
Ryan
Had a generic deadline script that could be called on its own from the GUI (in which case arguments were irrelevant), but could also be called from another script with some custom arguments.
It was not a critical issue though, i refactored the base script into a module and now just have 2 head scripts that call it with different parameters. But it was surprising to see a default python parameter missing
Yeah, I was surprised that argv isn’t defined as an empty array by default. Anyway, it will now be set to an empty array in the next beta release.
Cheers,
Ryan