Kent Johnson tds.net> writes:
[snip]
> You still aren't doing anything with newdic. The absence of 'newdic' in the
> code
> after 'read.close()' should be a clue
>
> I think you want to overwrite the saved dict, but with the new dict instead
> of
> with a filename string...
Hi Kent,
Firs
Barnaby Scott wrote:
For anyone who doesn't like lambda, how about
import os
def get_fles(exts, upd_dir):
return [i for i in os.listdir(upd_dir) if i.split('.')[-1] in exts]
Better would be:
def get_fles(exts, upd_dir):
return [fname for fname in os.listdir(upd_dir) if \
Kent Johnson wrote:
>>> import re
>>> def hexify(match):
... return '%%%X' % ord(match.group(0))
Ah, should be '%%%02X' ...
Kent
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Luis N wrote:
How would I best turn this string:
'2005-01-24 00:00:00.0'
into this string:
'2005%2D01%2D24%2000%3A00%3A00%2E0'
In order to call a URL.
urllib.quote_plus() is intended for this purpose though it doesn't have the
result you ask for:
>>> import urllib
>>> s='2005-01-24 00:00:00.0'
I got this from spyce
http://spyce.sourceforge.net
_url_ch = re.compile(r'[^A-Za-z0-9_.!~*()-]') # RFC 2396 section 2.3
def url_encode(o, **kwargs):
'''Return URL-encoded string.'''
return _url_ch.sub(lambda match: "%%%02X" % ord(match.group(0)),
str(o))
It was just the first thing I found in
On Jan 24, 2005, at 23:29, Luis N wrote:
How would I best turn this string:
'2005-01-24 00:00:00.0'
into this string:
'2005%2D01%2D24%2000%3A00%3A00%2E0'
In order to call a URL.
I've hunted through the standard library, but nothing seemed to jump
out.
The pathname2url in urllib seems to do wha
How would I best turn this string:
'2005-01-24 00:00:00.0'
into this string:
'2005%2D01%2D24%2000%3A00%3A00%2E0'
In order to call a URL.
I've hunted through the standard library, but nothing seemed to jump out.
Thank You.
___
Tutor maillist - Tuto
Kent,
Yes you are right. I looked at your code and that makes sense now.
Thanks for explaining that.
ALL-NEW
Yahoo! Messenger
- all new features - even more fun!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/t