[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
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
> 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
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
[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
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