Problem with exe from py2exe
Hi, I'm using python 2.4.1, wxPython 2.6.1.0 and py2exe 1.6.3 on Windows XP. My script runs fine with python, but the .exe produced with py2exe crashes out with: Traceback (most recent call last): File "App1.py", line 4, in ? File "wx\__init__.pyc", line 42, in ? File "wx\_core.pyc", line 3163, in ? AttributeError: 'module' object has no attribute 'wxEVT_SCROLL_ENDSCROLL' I've looked under http://starship.python.net/crew/theller/moin.cgi/Py2Exe to see if this is a known issue, but no luck. Anybody seen this one before? Thanks, Martin. -- http://mail.python.org/mailman/listinfo/python-list
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 99: ordinal not in range(128)
Hi, I don't know what I'm doing wrong here. I''m using Python 2.4 and py2exe. I get he following error: Traceback (most recent call last): File "notegui.pyc", line 34, in OnClose File "brain.pyc", line 61, in setNote File "points.pyc", line 151, in setNote File "point.pyc", line 100, in writeNote UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 99: ordinal not in range(128) The piece of code involved is: noteFileObj = open(noteFile, "wb") noteFileObj.write(note) noteFileObj.close() I would've thought that the 'b' option meant I can write any binary code I like to the file, but that's not so? Thanks for any tips, Martin. -- http://mail.python.org/mailman/listinfo/python-list
Using Beautiful Soup to entangle bookmarks.html
Hi, I'm trying to use the Beautiful Soup package to parse through the "bookmarks.html" file which Firefox exports all your bookmarks into. I've been struggling with the documentation trying to figure out how to extract all the urls. Has anybody got a couple of longer examples using Beautiful Soup I could play around with? Thanks, Martin. -- http://mail.python.org/mailman/listinfo/python-list
Re: Using Beautiful Soup to entangle bookmarks.html
Hi, thanks for the helpful reply. I wanted to do two things - learn to use Beautiful Soup and bring out all the information in the bookmarks file to import into another application. So I need to be able to travel down the tree in the bookmarks file. bookmarks seems to use header tags which can then contain a tags where the href attributes are. What I don't understand is how to create objects which can then be used to return the information in the next level of the tree. Thanks again, Martin. George Sakkis wrote: > Francach wrote: > > Hi, > > > > I'm trying to use the Beautiful Soup package to parse through the > > "bookmarks.html" file which Firefox exports all your bookmarks into. > > I've been struggling with the documentation trying to figure out how to > > extract all the urls. Has anybody got a couple of longer examples using > > Beautiful Soup I could play around with? > > > > Thanks, > > Martin. > > from BeautifulSoup import BeautifulSoup > urls = [tag['href'] for tag in > BeautifulSoup(open('bookmarks.html')).findAll('a')] > > Regards, > George -- http://mail.python.org/mailman/listinfo/python-list
Re: Using Beautiful Soup to entangle bookmarks.html
Hi George, Firefox lets you group the bookmarks along with other information into directories and sub-directories. Firefox uses header tags for this purpose. I'd like to get this grouping information out aswell. Regards, Martin. the idea is to extract. George Sakkis wrote: > Francach wrote: > > George Sakkis wrote: > > > Francach wrote: > > > > Hi, > > > > > > > > I'm trying to use the Beautiful Soup package to parse through the > > > > "bookmarks.html" file which Firefox exports all your bookmarks into. > > > > I've been struggling with the documentation trying to figure out how to > > > > extract all the urls. Has anybody got a couple of longer examples using > > > > Beautiful Soup I could play around with? > > > > > > > > Thanks, > > > > Martin. > > > > > > from BeautifulSoup import BeautifulSoup > > > urls = [tag['href'] for tag in > > > BeautifulSoup(open('bookmarks.html')).findAll('a')] > > Hi, > > > > thanks for the helpful reply. > > I wanted to do two things - learn to use Beautiful Soup and bring out > > all the information > > in the bookmarks file to import into another application. So I need to > > be able to travel down the tree in the bookmarks file. bookmarks seems > > to use header tags which can then contain a tags where the href > > attributes are. What I don't understand is how to create objects which > > can then be used to return the information in the next level of the > > tree. > > > > Thanks again, > > Martin. > > I'm not sure I understand what you want to do. Originally you asked to > extract all urls and BeautifulSoup can do this for you in one line. Why > do you care about intermediate objects or if the anchor tags are nested > under header tags or not ? Read and embrace BeautifulSoup's philosophy: > "You didn't write that awful page. You're just trying to get some data > out of it. Right now, you don't really care what HTML is supposed to > look like." > > George -- http://mail.python.org/mailman/listinfo/python-list
Re: Using Beautiful Soup to entangle bookmarks.html
Hallo George, thanks a lot! This is exactly the direction I had in mind. Your script demonstrates nicely how Beautiful Soup works. Regards, Martin. George Sakkis wrote: > Francach wrote: > > Hi George, > > > > Firefox lets you group the bookmarks along with other information into > > directories and sub-directories. Firefox uses header tags for this > > purpose. I'd like to get this grouping information out aswell. > > > > Regards, > > Martin. > > Here's what I came up with: > http://rafb.net/paste/results/G91EAo70.html. Tested only on my > bookmarks; see if it works for you. > > For each subfolder there is a recursive call that walks the respective > subtree, so it's probably not the most efficient solution, but I > couldn't think of any one-pass way to do it using BeautifulSoup. > > George -- http://mail.python.org/mailman/listinfo/python-list
wxPython - very small frame
Hi, I'd like to create a very small Frame without the usual minimise and maximise icons on the top. Does anyone know how to do this with wxPython? I've tried creating a Frame with the style wx.DOUBLE_BORDER, which gives me a nice small window. But I can't move it around the screen. Thanks, Martin. -- http://mail.python.org/mailman/listinfo/python-list