title: Passing args to a function through a Thread
body: <p>I am trying to pass two variable to a function via Thread as below:</p>
  
  <pre><code>from os import system
  from sys import exc_info
  from threading import Thread
  import time
  
  
  def play(file, priority):
  
      try:
          if priority == 0:
              system('ps aux | grep mpg321 | grep -v "grep mpg321" | awk \'{print $2}\' | xargs kill -9')
  
          statement = 'sudo -u pi mpg321 -g 1 -q -a bluetooth sound/' + file
          system(statement)
  
      except:
          print('There was an error playing the sound - ' + str(exc_info()[0]))
  
      finally:
          pass
  
  t1Sound = 'presence.mp3'
  t2Sound = 'ultra.mp3'
  
  t1 = Thread(target=play(), args=(t1Sound, 0))
  t2 = Thread(target=play(), args=(t2Sound, 1))
  
  t1.start()
  time.sleep(2)
  t2.start()
  </code></pre>
  
  <p>But somehow I keep getting the error below:</p>
  
  <pre><code>sudo python test.py
  Traceback (most recent call last):
    File "test.py", line 25, in &lt;module&gt;
      t1 = Thread(target=play(), args=(t1Sound, 0))
  TypeError: play() takes exactly 2 arguments (0 given)
  </code></pre>
  
  <p>Do you guys know how to fix this? How I am supposed to pass those variables correctly?</p>