Decoding an attachment

2008-07-31 Thread robinsiebler
I figured out how to save an e-mail message as a text file, but I'm not sure how to decode the encoded part as I am not sure how much I need to include to decode it properly. Here is what a message looks like: Received: from INGESTOR2SQA ([10.220.83.198]) by sqaserver300 with Microsoft SMTPSVC(6

saving an e-mail attachement

2008-07-31 Thread robinsiebler
I'm trying to figure out how to save an e-mail attachment from a POP3 mailbox. I've scoured the web, but -none- of the examples I have found have actually worked. For instance, in this example: http://groups.google.com/group/comp.lang.python/browse_thread/thread/8423cad79ff21730/0d8922943a164ccf?

Re: Floating point bug?

2008-02-14 Thread robinsiebler
I did try searching, but I never found what I was looking for. This thread has been very useful and informative. Thanks for all your help! I was able to fix my problem. :) -- http://mail.python.org/mailman/listinfo/python-list

Floating point bug?

2008-02-13 Thread robinsiebler
I've never had any call to use floating point numbers and now that I want to, I can't! *** Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)] on win32. *** >>> float (.3) 0.2 >>> foo = 0.3 >>> foo 0.2 >>> -- http://mail.python.org/mailman/

Re: Weird errors when trying to access a dictionary key

2007-07-20 Thread robinsiebler
Ignore my previous response. :p I figured out what my problem was. I had [song].keys() when I really meant song.keys() and really needed str(song.keys()). I just got a little too bracket happy. :p -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird errors when trying to access a dictionary key

2007-07-20 Thread robinsiebler
> You are converting the dictionary to a list on this line, and lists do > not have keys> rpt_file.writelines('\t' + > [song].keys() \ > How am I converting it to a list? > Note the first line has braces, not brackets so it is a > dictionary. Braces? What 1st line

Weird errors when trying to access a dictionary key

2007-07-20 Thread robinsiebler
;C:\Program Files\ActiveState Komodo 3.5\lib\support\dbgp \pythonlib\dbgp\client.py", line 520, in __init__ exec code in globals, locals File "", line 0, in TypeError: 'str' object is not callable song {"I Don't Wanna Stop": 1} song.keys() ["I Don't Wanna Stop"] For the complete script and data file, go to http://members.dslextreme.com/users/robinsiebler/python/ -- http://mail.python.org/mailman/listinfo/python-list

Best way to add values from keys

2007-07-12 Thread robinsiebler
I have a data structure that looks like this: dates = {}; last_song = [] #; year = {}; week = {}; date = {}; artist = []; song = {} #dates = {'2007': {'25': {'06/23/07': {'aerosmith': [{'sweet emotion': 1}, {'dream on': 2}], # 'Metallica': [{'Fade t

None returned?

2007-07-05 Thread robinsiebler
I can't figure out -what- is going wrong here. When the code reaches the 'return' line, there is data to be returned, but when it exits out to the calling function, 'None' is returned! import mx.DateTime def get_weeks(weeks, year, dates, date_list={}): if dates.has_key(year): date_li

Extracting arbitrary amounts of data from a dictionary.

2007-07-05 Thread robinsiebler
I had nothing better to do, so I thought I would make a database that contained the songs played on the internet radio station I listen to (hardradio.com) so I could see how many differents songs/artists they played. I stored the data like this: dates = {} #; year = {}; week = {}; date = {};

Re: Searching for text

2006-08-28 Thread robinsiebler
The other thing I failed to mention is that I need to ensure that I find the fsType *before* I find the next FontName. -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching for text

2006-08-28 Thread robinsiebler
> You omit what you want to do with the results when you find > them...or what should happen when they both appear on the same > line (though you hint that they're a couple lines apart, you > don't define this as a "this is always the case" sort of scenario) I don't do anything, per se. I just n

Searching for text

2006-08-28 Thread robinsiebler
I have a batch of files that I am trying to search for specific text in a specific format. Each file contains several items I want to search for. Here is a snippet from the file: ... /FontName /ACaslonPro-Semibold def /FontInfo 7 dict dup begin /Notice (Copyright 2000 Adobe Systems Incorporated.

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-19 Thread robinsiebler
Try 4NT (http://www.jpsoft.com). It is like cmd on steroids. I've been using it for years and it is the *only* thing that makes powerful batch files possible on Windows. It has a slew of features, including batch file debugging. -- http://mail.python.org/mailman/listinfo/python-list