title: Not enought values to unpack when parsing passwords file
body: <p>I am trying to write a simple login system and keep getting value error on one line</p>
  <p>error:</p>
  <pre><code>File &quot;/Users/davidjohns/Desktop/Loginsystem/hw4.py&quot;, line 44, in &lt;module&gt;
      access(option)
    File &quot;/Users/davidjohns/Desktop/Loginsystem/hw4.py&quot;, line 30, in access
      login(name,password)
    File &quot;/Users/davidjohns/Desktop/Loginsystem/hw4.py&quot;, line 9, in login
      a,b = i.split(&quot;,&quot;)
  ValueError: not enough values to unpack (expected 2, got 1)
  </code></pre>
  <pre><code>for i in file:
           a,b = i.split(&quot;,&quot;)
           b = b.strip()
           if(a==name and b==password):
               success = True
               break
  </code></pre>
  <pre><code>granted = False
  def grant():
      global granted
      granted = True
  def login(name,password):
      success = False
      file = open(&quot;passwords.txt&quot;,&quot;r&quot;)
      for i in file:
           a,b = i.split(&quot;,&quot;)
           b = b.strip()
           if(a==name and b==password):
               success = True
               break
      file.close()
      if(success):
          print(&quot;Login Successful&quot;)
          grant()
      else:
          print(&quot;wrong user name or password&quot;)
          
  def register(name,password):
      file = open(&quot;passwords.txt&quot;,&quot;a&quot;)
      file.write(&quot;\n&quot;+name+&quot;,&quot;+password)
      grant()
  def access(option):
      global name
      if(option==&quot;login&quot;):
          name = input(&quot;Enter your name: &quot;)
          password = input(&quot;Enter your password: &quot;)
          login(name,password)
      else:
          print(&quot;Enter your name and password to register&quot;)
          name = input(&quot;Enter your name: &quot;)
          password = input(&quot;Enter your password: &quot;)
          register(name,password)
  
  def begin():
      global option
      option = input(&quot;Login or Register (Login,Reg): &quot;)
      if(option!=&quot;login&quot; and option!=&quot;reg&quot;):
          begin()
          
  begin()
  access(option)
  
  if(granted):
      print(&quot;### USER DETAILS ###&quot;)
      print(&quot;Username: &quot;,name)
  </code></pre>