title: Error parsing data from XML python "NameError: name 'XXX' is not defined"
body: <p>Code: 
  Parsing some data from an XML file as , taking user input and trying to replace a sub-string in the text parsed from the XML file.
  (This is for a upcoming HID attack framework <a href="https://github.com/SkiddieTech/HIDAAF" rel="nofollow noreferrer">https://github.com/SkiddieTech/HIDAAF</a>, part of my offensive computer security degree)</p>
  
  <pre><code>def Generate_Payload(payload):
        print " Selection : " , payload
        import xml.etree.ElementTree as ET
        payload_raw = ET.parse(payload).getroot().find('payload').text                
        print payload_raw
        shell_name = input("Please enter the name of your malicious apk :")                   
        payload_raw_filtered = payload_raw.replace('#APKNAME#', shell_name)                   
        print payload_raw_filtered
        os.system('pause')
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>           Please enter the name of your malsivus apk :apk
              Traceback (most recent call last):
                File "C:\Users\Master\Documents\GitHub\HIDAAF\hidaaf.py", line 52, in &lt;module&gt;
                  List_Payloads()
                File "C:\Users\Master\Documents\GitHub\HIDAAF\hidaaf.py", line 41, in List_Payloads
                  Generate_Payload(filenames[payload - 1 ])
                File "C:\Users\Master\Documents\GitHub\HIDAAF\hidaaf.py", line 18, in Generate_Payload
                  shell_name= input("Please enter the name of your malicious apk :")
                File "&lt;string&gt;", line 1, in &lt;module&gt;
              NameError: name 'apk' is not defined
  </code></pre>