[Tutor] regular expressions question

2006-08-12 Thread nimrodx
Hi All, I am trying to fish through the history file for the Konquerer web browser, and pull out the web sites visited. The file's encoding is binary or something Here is the first section of the file: '\x00\x00\x00\x02\xb8,\x08\x9f\x00\x00z\xa8\x00\x00\x01\xf4\x00\x00\x01\xf4\x00\x00\x00t\x00f

[Tutor] Message seemed to bounce, so I will try again

2006-08-12 Thread nimrodx
Hi All, I am trying to fish through the history file for the Konquerer web browser, and pull out the web sites visited. The file's encoding is binary or something Here is the first section of the file: '\x00\x00\x00\x02\xb8,\x08\x9f\x00\x00z\xa8\x00\x00\x01\xf4\x00\x00\x01\xf4\x00\x00\x00t\x00f

Re: [Tutor] regular expressions question]

2006-08-12 Thread nimrodx
Hi Alan and other Gurus, if you look carefully at the string below, you see that in amongst the "\x" stuff you have the text I want: z tfile://home/alpha which I know to be an address on my system, plus a bit of preceeding txt. Alan Gauld wrote: >> The file's encoding is binary or something >> >>

Re: [Tutor] [whitelist] Re: regular expressions question

2006-08-17 Thread nimrodx
Hi Alan, I found a pretty complicated way to do it (Alan's way is way more elegant). In case someone is searching the archive, maybe they will find something in it that is useful. It uses the regular experessions module. import re def dehexlify_websites(fle): # get binary data inpt = open

[Tutor] os.path.walk

2006-08-22 Thread nimrodx
Hi All, I was wondering if anyone had used os.path.walk within a class or not, and what are the pitfalls... What has got me worried is that the function called by os.path.walk must be a method of the class. Now this means it will have something like this as a def: def func_called_by_walk(self

Re: [Tutor] [whitelist] Re: os.path.walk

2006-08-23 Thread nimrodx
Thanks guys, I will have a go at both of the methods. Matt Alan Gauld wrote: >> Yes, that is the right way to do it and it will work fine. Something >> like >> >> class Walker(object): >> def walk(self, base): >>os.path.walk(base, self.callback, None) >> > > >> What happens is, when

[Tutor] Sending an attatchment with SMTP lib

2006-08-25 Thread nimrodx
Hi All, How do I go about sending an attachment with SMTP lib? Thanks, Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] content disposition header: email module

2006-09-06 Thread nimrodx
Hi Python Gurus, I am trying to mail a txt file, then with another client I get the email and extract the text file. The email I send however, does not seem to turn out correctly. The content dispositon header is there, but it seems to be in the wrong place and my email client the text file just

[Tutor] How do I open my browser from within a Python program

2006-09-14 Thread nimrodx
Basically a dumb question I can't seem to find the answer to. How do I execute a bash command from within a python program. I've been looking through my book on python, and the docs, but can't seem to find something so basic (sure it is there, but I am not looking for the correct terms, I guess)