Re: SAX parsing problem
In article <[EMAIL PROTECTED]>, David M. Cooke <[EMAIL PROTECTED]> wrote: > anon <[EMAIL PROTECTED]> writes: > > > So I've encountered a strange behavior that I'm hoping someone can fill > > me in on. i've written a simple handler that works with one small > > exception, when the parser encounters a line with '&' in it, it > > only returns the portion that follows the occurence. > > > > For example, parsing a file with the line : > > mykeysome%20&%20value > > > > results in getting "%20value" back from the characters method, rather > > than "some%20&%20value". > > > > After looking into this a bit, I found that SAX supports entities and > > that it is probably believing the & to be an entity and processing > > it in some way that i'm unware of. I'm using the default > > EntityResolver. > > Are you sure you're not actually getting three chunks: "some%20", "&", > and "%20value"? The xml.sax.handler.ContentHandler.characters method > (which I presume you're using for SAX, as you don't mention!) is not > guaranteed to get all contiguous character data in one call. Also check > if .skippedEntity() methods are firing. Ya, skippedEntity() wasn't firing, but you are correct about receiving three chunks. The characters handler routine is fired 3 times for a single text block. Why does it do this? Is there a way to prevent doing this? Much thanks. gh -- http://mail.python.org/mailman/listinfo/python-list
Re: Intsalling wxPython
On Monday, 6 April 2015 22:54:26 UTC-4, Sepi wrote: > Hi, > > I installed wxpython through command line but when I want to use it, python > gives me an error: File "/Users/sepidehghanavati/Desktop/test.py", line 1, > in > import wx > ImportError: No module named 'wx' > > When I check my python path it is version 3.3 > (/Library/Frameworks/Python.framework/Versions/3.3/) but when I try to > install wxpython via python setup.py install --user it installs in > /Users/sepidehghanavati/Library/Python/2.7/bin/ > > I don't know how to change this. I got the answer! Just using python 3 instead of python in the command line -- https://mail.python.org/mailman/listinfo/python-list
Re: Intsalling wxPython
On Monday, 6 April 2015 23:27:54 UTC-4, Sepi Gh wrote: > On Monday, 6 April 2015 22:54:26 UTC-4, Sepi wrote: > > Hi, > > > > I installed wxpython through command line but when I want to use it, python > > gives me an error: File "/Users//Desktop/test.py", line 1, in > > import wx > > ImportError: No module named 'wx' > > > > When I check my python path it is version 3.3 > > (/Library/Frameworks/Python.framework/Versions/3.3/) but when I try to > > install wxpython via python setup.py install --user it installs in > > /UsersLibrary/Python/2.7/bin/ > > > > I don't know how to change this. > > I got the answer! Just using python 3 instead of python in the command line But I get this error now: File "/Users//Library/Python/3.3/lib/python/site-packages/wx_py/PyWrap.py", line 27 print "Please specify a module name." ^ SyntaxError: invalid syntax -- https://mail.python.org/mailman/listinfo/python-list