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
#2
I'm not sure if you can come up with function names that way but you could put your methods in a list and just loop through the list like

methods=[method1, method2, method3]

for i in range(len(methods)):
    Do your check here 
    
I'm not entirely sure if that's what you're looking for but hope it helps
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 Atekka - Oct-18-2020, 10:48 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 469 Jan-08-2024, 01:27 PM
Last Post: Drone4four
  i want to use type= as a function/method keyword argument Skaperen 9 1,977 Nov-06-2022, 04:28 AM
Last Post: Skaperen
  function/method help myv5285 3 2,864 May-17-2020, 04:19 AM
Last Post: buran
  Accessing method as function object ClassicalSoul 2 2,056 Feb-14-2020, 09:31 PM
Last Post: wavic
  got SyntaxError while building simple function zarize 2 2,160 Feb-14-2020, 10:51 AM
Last Post: zarize
  function vs method prateekshaw 2 2,233 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,486 Jul-04-2019, 01:43 AM
Last Post: ichabod801
  function method problems drchar 2 2,955 Dec-11-2018, 02:38 PM
Last Post: buran
  Understanding Method/Function robdhunter 2 2,678 Mar-10-2018, 11:57 PM
Last Post: robdhunter
  How to pass value from method to function iFunKtion 11 8,874 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