[PyMOL] Python Function with Unlimited Positional Arguments

2009-08-02 Thread Sean Law
Hi PyMOLers, 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"): #DO SOMETHING return Where

Re: [PyMOL] Python Function with Unlimited Positional Arguments

2009-08-02 Thread Warren DeLano
Sean, You need a keyword argument list as well, so that the effective PyMOL class instance (_self) can be passed in by keyword (actual use of _self is only strictly required when you have multiple PyMOLs active in a single Python interpreter). # pml input: python def my_fn(*arg, **kwd): pri