title: Threading error: get() takes 0 positional arguments but 1 was given
body: <p>I have an issue with threading, the question was already asker but it didn't answer mine. I'm trying to create a chat app with socket to understand how it works better. The problem here is i can't get it to receive messages automatically, i would basically have to invoke the get() function each time i get a new message. I tried to fix that with threading but now i get an other error:</p>
  <pre><code>from tkinter import *
  import threading
  import socket
   
  try:
      s = socket.socket()
  except:
      print(&quot;Failed socket creation&quot;)     
  
  port = 12345       
  
  
  s.connect(('127.0.0.1', port))
  print(&quot;Successfuly Connected&quot;)
      
      
      
      
  def Main():
      m = tkinter.Tk()
      m.title('TrollChat(Client)')
      m.iconbitmap(&quot;troll.ico&quot;)
      m.geometry(&quot;400x400&quot;)
  
      def sendinput():
          message = e1.get()
          s.send(message.encode())
  
      tkinter.Label(m, text=&quot;Message: &quot;).grid(row=0)
      e1 = tkinter.Entry(m)
      e1.grid(row=0, column=1)
  
      button1 = tkinter.Button(m, text='Send', width=25, command=sendinput)
      button1.grid(row=0, column=3)
   
      m.mainloop()
      
  def get():
      while True:
          data = s.recv(1024).decode()
          if not data:
              pass
          print(data)
      
      
  
  
  
  if __name__ == '__main__':
      
      t1 = threading.Thread(target=Main, args=(0,))
      t1.start()
      
      t2 = threading.Thread(target=get, args=(0,))
      t2.start()
  </code></pre>
  <p>The error is:</p>
  <pre><code>Exception in thread Thread-1:
  Traceback (most recent call last):
    File &quot;E:\Bots\Thonny\lib\threading.py&quot;, line 926, in _bootstrap_inner
      self.run()
    File &quot;E:\Bots\Thonny\lib\threading.py&quot;, line 870, in run
      self._target(*self._args, **self._kwargs)
  TypeError: Main() takes 0 positional arguments but 1 was given
  
  Exception in thread Thread-2:
  Traceback (most recent call last):
    File &quot;E:\Bots\Thonny\lib\threading.py&quot;, line 926, in _bootstrap_inner
      self.run()
    File &quot;E:\Bots\Thonny\lib\threading.py&quot;, line 870, in run
      self._target(*self._args, **self._kwargs)
  TypeError: get() takes 0 positional arguments but 1 was given
  </code></pre>
  <p>Other problem:
  I tried solving the issue by replacing</p>
  <p><code>t1 = threading.Thread(target=Main, args=(0,))</code>
  and
  <code>t2 = threading.Thread(target=get, args=(0,))</code></p>
  <p>with</p>
  <p><code>t1 = threading.Thread(target=Main(), args=(0,))</code>
  and
  <code>t2 = threading.Thread(target=get(), args=(0,))</code></p>
  <p>but it stops compiling after the first thread. Can anyone help with this issue please?</p>