title: AttributeError in Python program
body: <pre><code>import subprocess
  data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors=&quot;backslashreplace&quot;).split(&quot;\n&quot;)
  profiles = [i.split(&quot;:&quot;)[1][1:-1] for i in data if&quot;All User Profile&quot; in i]
  for i in profiles:
      try:
          results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8', errors=&quot;blackslashreplace&quot;).split(&quot;\n&quot;)
          results = [b.split(&quot;:&quot;)[1][1:-1] for b in results if&quot;Key Content&quot; in b]
          try:
              print(&quot;{:&lt;30}| {:&lt;}&quot;.format(i.results[0]))
          except IndexError:
              print(&quot;{:&lt;30}| {:&lt;}&quot;.format(i, &quot;&quot;))
      except subprocess.CalledProcessError:
          print(&quot;{:&lt;30}| {:&lt;}&quot;.format(i, &quot;ENCODING ERROR&quot;))
      input(&quot;&quot;)
  </code></pre>
  <p>That is my code, which for some reason throws that error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\manis\PycharmProjects\WiFi_Hacker\Hack.py&quot;, line 9, in &lt;module&gt;
      print(&quot;{:&lt;30}| {:&lt;}&quot;.format(i.results[0]))
  AttributeError: 'str' object has no attribute 'results'
  </code></pre>