hello,
Can you show me some reference datas for python web programming?Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks a lot.
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
How to send an array via socket to the other end?Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
I do need sorting a dict via its values.
Please help give some reference or code samples.
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
I'm reading the book of "Dive into Python" and got these code pieces:
class UserDict:
def __init__(self, dict=None): self.data = {}
if dict is not None: self.update(dict)
My question is,for the statement of:
if dict is not None: self.update(dic
[quote]The idea behind that class is to act "as-if" it were a real
dictionary.
Dicts have an update method, and UserDict should too. But it's not listed
in the book (should appear a few lines below that code); this is a
possible implementation:
def update(self, other):
for key in ot
Thanks a lot.I've got it.
En Tue, 13 Feb 2007 13:01:59 -0300, <[EMAIL PROTECTED]> escribió:
> But I'm still confused that what's the "real dictionary"?I can't know
> this
> point.Please help and thanks again.
I'm talking about a Python dictionary (a "real" one, as opposed to
UserDic
>>> from UserDict import UserDict
>>> d = {1:2,3:4,5:6}
>>> d1 = UserDict(d)
>>> d1
{1: 2, 3: 4, 5: 6}
>>> d1.data
{1: 2, 3: 4, 5: 6}
Here why both d1 and d1.data have the same values?As shown below,they're
different types.
>>> type(d1)
>>> type(d1.data)
Please help.Thanks!
--
http
Hello,
I got this similar sample script from books:
$ cat sampdict.py
#!/usr/bin/python
class SampDict(dict):
def __init__(self, filename=None):
self["name"] = filename
But when I run it I got the errors:
>>> from sampdict import SampDict
>>> SampDict("/etc/passwd")
Traceback (mo
> Hello,
> I got this similar sample script from books:
> $ cat sampdict.py
> #!/usr/bin/python
> class SampDict(dict):
> def __init__(self, filename=None):
> self["name"] = filename
> Are you sure you copied it exactly as it appears? Where did you find it?
Thank you for the help,Gabri
10 matches
Mail list logo