I am trying to write a python script that will allow a user to provide an unlimited number of positional arguments for a function. I am use to the following scheme for defining a function and its arguments:
def some_function ( x, y, z, file="false"):
Where x, y, and z are required arguments and "file=false" is an optional argument. I came across the following page pertaining to Python:
See "Unlimited Number of Positional Arguments Values"
There it explains that one could use the following syntax:
def some_function ( *args):
Now, when put this in a script and call the function in PyMOL it spits out the following error:
Traceback (most recent call last):
File "/pymol/./modules/pymol/parser.py", line 254, in parse
TypeError: some_function() got an unexpected keyword argument '_self'
Is the "*args" method simply not possible in PyMOL? I tried using "**args" which worked nicely for keyword arguments.
Any help would be greatly appreciated. Thank you for your time.
Stay on top of things, check email from other accounts!