Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python script pulling data from XML file for Eve-Online data
#2
Well, you guys were basically no help. Haha, no worries, though. I spent all night reading, plus trial-and-error [Note: I knew nothing about Python going into it], and eventually developed this little script:
Code:
#!/usr/bin/env python
import xml.etree.ElementTree as ET
tree = ET.parse("/home/me/eve/character.xml")

def traverse(node):
    for c in node.getchildren():
    if c.tag == "name": print c.text
        traverse(c)

root = tree.getroot()
traverse(root)

And modified the search tag for each script I was using.
So, another project down. Plus, check out my screenshot:
[Image: evescriptshot.jpg]

Sweet, right? Eh, probably not if you're not into Eve [most of you aren't]. And from here, there's actually a lot more I could do with it, such as listing my specific skills or skills I'm training on. I've discovered that XML is pretty freaking awesome!
Reply


Messages In This Thread
RE: Python script pulling data from XML file for Eve-Online data - by J4P4NM4N - 11-10-2009, 10:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Help Dεlluzion 3 1,793 09-30-2019, 12:59 AM
Last Post: samsmith001
  Fetch data from a web page hami1981 1 1,219 09-05-2014, 01:45 PM
Last Post: hami1981
  How to display variable serial data on Tkinter window. srinivas.rambha 0 947 06-17-2013, 05:54 AM
Last Post: srinivas.rambha
  Python to parse text file and get the count of items magicjack89 0 652 06-28-2012, 10:01 AM
Last Post: magicjack89
  How to Run a Python Script..? Need Help aloneak 4 1,547 05-03-2012, 06:55 AM
Last Post: Rhynorater

Forum Jump:


Users browsing this thread: 1 Guest(s)