User Profile

Collapse

Profile Sidebar

Collapse
Anthony Keane
Anthony Keane
Last Activity: Jul 27 '10, 08:45 AM
Joined: Jul 23 '10
Location: Cork, Ireland
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Anthony Keane
    replied to Parsing XML File selected by user
    The XML looks like this :
    Code:
    <?xml version="1.0" ?><SharePrice>
    	<ShareInfo>
    		<Time> 12:00:00.01</Time>
    		<Price>  12.6</Price>
    	</ShareInfo>
    I am trying to get time in the form of a timeStamp and Price in the form of integer so that I can perform Statistical analysis on the data (and plot the Price V. Time)
    See more | Go to post

    Leave a comment:


  • Anthony Keane
    replied to Parsing XML File selected by user
    Code at Present

    Code:
    import Tkinter,tkFileDialog
    import os
    from xml.etree import ElementTree as ET
    from xml.dom import minidom
    
    
    root = Tkinter.Tk()
    fn = tkFileDialog.askopenfile(parent=root,mode='rb',title='Choose a file')
    root.mainloop()
    
    def XMLReader(fn):
        xNode = []
        yNode = []
        tree = ET.parse(open(fn, "rb"))
        xmldoc
    ...
    See more | Go to post

    Leave a comment:


  • Anthony Keane
    replied to Parsing XML File selected by user
    At the moment when I run the code I get a dialog box to pick the file, but it does not pass it onto the XMLReader. It is a multi step project. Step 1 is to get the file read into the system then get statistics things like mean etc. and to plot the data on a graph (someone suggested using scipy and numpy for this but I am not at that stage), also produce a new XML File with the original data and the statistics....
    See more | Go to post

    Leave a comment:


  • Anthony Keane
    started a topic Parsing XML File selected by user

    Parsing XML File selected by user

    I am trying to allow a user pick the XML file that they would like to parse and use a generic parser to accomplish the task. The code is taken from different websites, just wondering if the code I have so far can be integrated and if so how?

    Code:
    import Tkinter,tkFileDialog
    import os
    from xml.etree import ElementTree as ET
    
    root = Tkinter.Tk()
    file = tkFileDialog.askopenfile(parent=root,mode='rb',title='Choose
    ...
    See more | Go to post
No activity results to display
Show More
Working...