title: TypeError: __init__() missing 3 required positional arguments:
body: <p>I'm writing code for a chat app in Python for a school project, it's split into a client.py file and a server.py file, and for some reason every time I run it, it gives me the following error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\me\client.py&quot;, line 90, in &lt;module&gt;
      Client()
  TypeError: __init__() missing 3 required positional arguments: 'msg', 'gui_thread', and 'receive_thread'
  </code></pre>
  <p>The code for the file is as follows:</p>
  <pre><code>from operator import truediv
  import socket
  import threading 
  import tkinter
  import tkinter.scrolledtext
  from tkinter import simpledialog
  
  
  class Client:
  
      def __init__(self, msg, gui_thread, receive_thread):
          self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
          self.sock.connect(('localhost', 1234))
  
          msg = tkinter.Tk()
          msg.withdraw()
  
          self.nickname = simpledialog.askstring(&quot;Nickname&quot;, &quot;Please choose a nickname&quot;, parent=msg)
  
          self.gui_done = False 
          self.running = True
  
          gui_thread = threading.Thread(target=self.gui_loop)
          receive_thread = threading.Thread(target=self.receive)
  
          gui_thread.start()
          receive_thread.start()
  
      def gui_loop(self):
          self.win = tkinter.Tk()
          self.win.configure(bg=&quot;lightgray&quot;)
          
          self.chat_label = tkinter.Label(self.win, text=&quot;Chat:&quot;, bg=&quot;lightgray&quot;)
          self.chat_label.config(font=(&quot;Arial&quot;, 12))
          self.chat_label.pack(padx=20, pady=5)
  
          self.text_area = tkinter.scrolledtext.ScrolledText
          self.text_area.pack(padx=20, pady=5)
          self.text_area.config(state='disabled')
  
          self.msg_label = tkinter.Label(self.win, text=&quot;Message:&quot;, bg=&quot;Lightgray&quot;)
          self.msg_label.config(font=(&quot;Arial&quot;, 12))
          self.msg_label.pack(padx=20, pady=5)
  
          self.input_area = tkinter.Text(self.win, height=3)
          self.input_area.pack(padx=20, pady=5)
  
          self.send_button = tkinter.Button(self.win, text=&quot;Send&quot;, command=self.write)
          self.send_button.config(font=(&quot;Arial&quot;, 12))
          self.end_button.pack(padx=20, pady=5)
  
          self.gui_done = True
  
          self.win.protocol(&quot;WM_DELETE_WINDOW&quot;, self.stop)
  
          self.win.mainloop()
  
      def write(self):
          message =f&quot;{self.nickname}: {self.input_area.get('1.0', 'end')}&quot;
          self.sock.send(message.encode('utf-8'))
          self.input_area.delete('1.0', 'end')
  
  
      def stop(self):
          self.running = False
          self.win.destroy()
          self.sock.close()
          exit(0)
  
      def receive(self):
          while self.running:
              try:
                  message = self.sock.recv(1024).decode('utf-8')
                  if message == 'NICK':
                      self.server.send(self.nickname.encode('utf-8'))
                  else:
                      if self.gui_done:
                          self.text_area.config(state='normal')
                          self.text_area.insert('end', message)
                          self.text_area.yview('end')
                          self.text_area.config(state='disabled')
              except ConnectionAbortedError:
                  break
              except:
                  print(&quot;Error&quot;)
                  self.sock.close()
                  break
  
      
  
  Client()
  </code></pre>