Title: Message
Fantastic...that really did the trick! I actually made one
modification since p4python allows you to run Perforce commands by calling them
with obj.run_COMMAND(args) so the final solution was:
def _p4run(self, method,
*args): 'runs a Perforce
command'
try
On 7/21/06, Smith, Jeff <[EMAIL PROTECTED]> wrote:
I have an object and
I want to call a method that I have constructed the name for in a
string.
For
example:
str_method =
'myfun'
obj.str_method
Of course, this
fails. I know I could probably do this with exec but is there a better
Smith, Jeff wrote:
> I have an object and I want to call a method that I have constructed
> the name for in a string.
>
> For example:
> str_method = 'myfun'
> obj.str_method
>
> Of course, this fails. I know I could probably do this with exec but
> is there a better way?
Use getattr():
get
Title: Message
I have an object and
I want to call a method that I have constructed the name for in a
string.
For
example:
str_method =
'myfun'
obj.str_method
Of course, this
fails. I know I could probably do this with exec but is there a better
way?
For context, the
specific appli