Wednesday, September 30, 2009



Instead of installing and configuring one by one there is one simple solution - KRASNAL-Serv-2.6.exe. I'm not sure what is my exact task, anyway this links has helped me a lot. I tested it and it works, now I have to put everything together.

- MySQL w Pythonie

import MySQLdb
conn = MySQLdb.connect(host="localhost", user="root", passwd="krasnal", db="baza")
c = conn.cursor()
c.execute("SELECT nick FROM users")
print c.fetchall()

- Parsowanie XML w Pythonie

from xml.dom import minidom
DOMTree = minidom.parse('benchmark.xml')
cNodes = DOMTree.childNodes
myre = cNodes[0].getElementsByTagName("parameter") #regular expression from XML configuration file[0].getElementsByTagName("property")[0].childNodes[0].toxml()
print myre

0 komentarze:

Post a Comment