Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: apply()?

Reply
Thread Tools

Re: apply()?

 
 
jepler@unpythonic.net
Guest
Posts: n/a
 
      12-06-2005
First, get the method with getattr() and then use the *-notation or
apply to call it with args.
getattr(obj, func_name)(*args)
or
apply(getattr(obj, func_name), args)

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDlNVIJd01MZaTXX0RAuxFAKCpZuMh589lrVsMYMkXb7 Zinb+EQQCdFgPF
S94/NDVkIl0wb+pjhB+XutI=
=7Hhb
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments