Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168733
Image: ubuntu2004
import urllib from xml.dom import minidom # - hash is a comment # there are other xml data files to be found at http://dev.electrostallion.com/archive/wave_data/ # #doc = '2009-03-19_114057.xml' #doc = '2009-03-19_110401.xml' #doc = '2009-03-19_132739.xml' doc = '2009-04-09_125542.xml' url = 'http://dev.electrostallion.com/archive/wave_data/' + doc xml_data = minidom.parse(urllib.urlopen(url)) S = [] arraysFound = 0 for a in xml_data.childNodes: for b in a.childNodes: if b.nodeName == "dict": for c in b.childNodes: if c.nodeName == "array": if arraysFound == 2: for d in c.childNodes: if d.nodeName == "array": x = float(d.childNodes[1].firstChild.data) y = float(d.childNodes[3].firstChild.data) S.append((x,y)) else: arraysFound = arraysFound + 1 Sp = list_plot(S,rgbcolor=(.5,.5,.5)) show (Sp, figsize=[25,5])