Re: I'm faint why this can't work

2007-02-16 Thread Ben Finney
[EMAIL PROTECTED] writes: > The codes got by me from the book of "Dive into Python".The original > codes are below: > > class FileInfo(dict): > "store file metadata" > def __init__(self, filename=None): > self["name"] = filename You've put the lines of code in your message without indentation

Re: I'm faint why this can't work

2007-02-16 Thread Gabriel Genellina
En Fri, 16 Feb 2007 05:27:46 -0300, <[EMAIL PROTECTED]> escribió: >> 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

Re: I'm faint why this can't work

2007-02-16 Thread JStoneGT
> 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

Re: I'm faint why this can't work

2007-02-16 Thread Gabriel Genellina
En Fri, 16 Feb 2007 03:38:43 -0300, <[EMAIL PROTECTED]> escribió: > 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 appe

Re: I'm faint why this can't work

2007-02-16 Thread Gary Herron
[EMAIL PROTECTED] wrote: > 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 impor

I'm faint why this can't work

2007-02-15 Thread JStoneGT
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