Python Forum
Building a method name in a function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Building a method name in a function
#5
Look at getattr() built-in function.
Note that with attribute name like method1, method2, etc. there is good chance you are doing something the wrong way. Better tell us what/why you are doing this and what's your code, i.e. instead of 40 methods 2 or 3 will be sufficient to demonstrate your case.
ndc85430 likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Building a method name in a function - by ffgth - Oct-18-2020, 10:41 PM
RE: Building a method name in a function - by ffgth - Oct-18-2020, 10:55 PM
RE: Building a method name in a function - by buran - Oct-19-2020, 03:27 AM
RE: Building a method name in a function - by ffgth - Oct-19-2020, 11:35 AM
RE: Building a method name in a function - by buran - Oct-19-2020, 11:57 AM
RE: Building a method name in a function - by ffgth - Oct-19-2020, 01:01 PM
RE: Building a method name in a function - by buran - Oct-19-2020, 01:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Building a DoublyLinkedList in Python - - append method Drone4four 2 460 Jan-08-2024, 01:27 PM
Last Post: Drone4four
  i want to use type= as a function/method keyword argument Skaperen 9 1,976 Nov-06-2022, 04:28 AM
Last Post: Skaperen
  function/method help myv5285 3 2,861 May-17-2020, 04:19 AM
Last Post: buran
  Accessing method as function object ClassicalSoul 2 2,053 Feb-14-2020, 09:31 PM
Last Post: wavic
  got SyntaxError while building simple function zarize 2 2,157 Feb-14-2020, 10:51 AM
Last Post: zarize
  function vs method prateekshaw 2 2,232 Nov-14-2019, 07:00 PM
Last Post: DeaD_EyE
  I'm trying to figure out whether this is a method or function call 357mag 2 2,484 Jul-04-2019, 01:43 AM
Last Post: ichabod801
  function method problems drchar 2 2,952 Dec-11-2018, 02:38 PM
Last Post: buran
  Understanding Method/Function robdhunter 2 2,673 Mar-10-2018, 11:57 PM
Last Post: robdhunter
  How to pass value from method to function iFunKtion 11 8,871 May-23-2017, 05:06 PM
Last Post: iFunKtion

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020