Advertisement
Guest User

Untitled

a guest
Jul 6th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. from lxml import etree
  5. Ser = " "
  6. sock = " "
  7. pseud = " "
  8. passs = " "
  9.  
  10. print "Script de Configuration du bot"
  11.  
  12. Ser = raw_input ("Ip ou adresse du serveur IRC\n")
  13. sock = raw_input ("Numero de Socket\n")
  14. pseud = raw_input ("Pseudo\n")
  15. passs = raw_input ("Password\n")
  16.  
  17. ConfigBot = etree.Element("ConfigBot")
  18.  
  19. Serveur = etree.SubElement(ConfigBot,"Serveur")
  20. Serveur.text = Ser
  21.  
  22. Port = etree.SubElement(ConfigBot,"Port")
  23. Port.text = sock
  24.  
  25. Pseudo = etree.SubElement(ConfigBot,"Pseudo")
  26. Pseudo.text = psu
  27.  
  28. Password = etree.SubElement(ConfigBot,"Password")
  29. Password.text = passs
  30.  
  31. print " Configuration fini"
  32.  
  33. fichier = open("config.xml", "a")
  34. fichier.write(etree.tostring(ConfigBot, pretty_print=True))
  35. fichier.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement