barry wrote: > Having just followed this thread tangentially, I do have to say it > seems quite cool to be able to do something like the following in > Python 2.2: > > >>> s = msg['from'] > >>> parts = s.split('?') > >>> if parts[2].lower() == 'q': > ... name = parts[3].decode('quopri') > ... elif parts[2].lower() == 'b': > ... name = parts[3].decode('base64') uhuh? and how exactly is this cooler than being able to do something like the following: import quopri, base64 s = msg['from'] parts = s.split('?') if parts[2].lower() == 'q': name = quopri.decodestring(parts[3]) elif parts[2].lower() == 'b': name = base64.decodestring(parts[3]) (going through the codec registry is slower, and imports more modules, but what's so cool with that?) </F>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4