0

If I have a function:

def run(time, message, time_span_pattern):
    ...

And a list like:

run_args = ['1s', '1 second alarm', <_sre.SRE_Pattern object at 0x100435680>]

How can I pass the list, as separate arguments, to run? Is there a builtin way to do this, or am I forced to reference each element individually and by index?

theonlygusti
  • 11,032
  • 11
  • 64
  • 119

1 Answers1

3

You're looking for:

run(*run_args)

This is explained in more detail in this StackOverflow answer about the star and double star operator

It's also covered in the python docs

Community
  • 1
  • 1
ffledgling
  • 11,502
  • 8
  • 47
  • 69