[lxml-dev] Version 1.2.1 not working?
Robert Dailey
rcdailey at gmail.com
Wed Jul 11 23:31:12 CEST 2007
One more thing:
I just tested again. Running my python script through the command line works
fine. However, running it through my IDE (PyScripter), it crashes on the
second time I run it. Interesting.
On 7/11/07, Roger Patterson <rogerpatterson at gmail.com> wrote:
>
> Hi Robert,
>
> Firstly, you don't need to read your XML file into a string and then
> convert it to a StringIO object. You can just feed the file handle to
> etree.parse().
> But other than that, your XML file parsed fine for me, and I'm using
> lxml 1.2.1
> You may want to make sure you've installed correctly.
> -Roger
>
> Robert Dailey wrote:
> > Hi,
> >
> > I have the following Python code:
> >
> >
> > from lxml import etree
> > from StringIO import StringIO
> >
> > def loadXMLFile( filename ):
> > f = open( filename, 'r' )
> > xmldata = f.read()
> > root = etree.parse( StringIO( xmldata ) )
> > f.close()
> > return root
> >
> >
> > Python either crashes or hangs at the etree.parse() call. Below is the
> > contents of the XML file I'm opening:
> >
> > <Page>
> > <Frame type="Root">
> >
> > <!-- Check idle time for attract mode -->
> > <OnIdleTime time="10000">
> > <StartAttractMode dispatch="GAME"/>
> > </OnIdleTime>
> >
> > <!-- Title Screen Image -->
> > <Frame type="Image" value="Interface/Titlescreen.spr">
> > <OnInput key="KEY_ACCEPT" require_focus="false">
> > <!--<GoToPage dispatch="GUI" page="LeaderboardMenu"/>-->
> > <GoToPage dispatch="GUI" page="MainMenu"/>
> > <PlaySound dispatch="GAME" file="InterfaceSchwing"/>
> > </OnInput>
> > </Frame>
> >
> > </Frame>
> > </Page>
> >
> > Anyone know why it isn't working? Thanks!
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > lxml-dev mailing list
> > lxml-dev at codespeak.net
> > http://codespeak.net/mailman/listinfo/lxml-dev
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/lxml-dev/attachments/20070711/86177c39/attachment.htm
More information about the lxml-dev
mailing list