if q1.upper() == "PYTHON": #Because we all love python! global f try: f = open("%s.py" % q2, "w") except IOError: pass else: f.write("#This plugin is automatic generated.\n") f.write("#Plugin by: %s\n\n" % q3) f.write("import xchat\n\n") f.write('__module_name__ = "%s"\n' % q2) f.write('__module_version__ = "1.0"\n') f.write('__module_description__ = "%s"\n' % q4) print("") print("Plugin created: %s.py" % q2) finally: f.close