title: Updating args on the fly?
body: <p>I'm building a metronome in python and I'd like to figure out a way to update the bpm on the fly. Is there a way to structure things so I can update a functions argument(s) while it's running?</p>
  <p>My metronome is currently only accepting one argument &quot;bpm&quot; and I want to build a tap-tempo function where I'll use the time delta between two spacebar presses (and releases) to update the arguments' bpm. Here's a simplified version of what I have so far.</p>
  <pre><code>def Metronome(bpm):
      &quot;&quot;&quot;Playback specified bpm.&quot;&quot;&quot;
      while bpm &gt;= 1 and bpm &lt;= 300:
          playsound('sound.aif')    
          tpm = 60 / bpm
          time.sleep(tpm)  
          
      else:
          print('That\'s not a number between 1 and 300')
  </code></pre>
  <p>I've read a little about multiprocessing / threading but this is all new to me... I was planning to use the pynput module to capture the spacebar presses/releases.</p>
  <p>I think that being able to update the tempo (bpm) on the fly is pretty important. Let me know if you have any suggestions on how I can pull this off.</p>