python Programming Glossary: self.files
How to delete files with a Python script from a FTP server which are older than 7 days? http://stackoverflow.com/questions/2867217/how-to-delete-files-with-a-python-script-from-a-ftp-server-which-are-older-than FTPDirectory object def __init__ self path '.' self.dirs self.files self.path path def getdata self ftpobj ftpobj.retrlines 'MLSD'.. 'type' target self.dirs if field_value 'dir' else self.files elif field_name in 'sizd' 'size' size int field_value elif.. time.strptime field_value Y m d H M S if target is self.files target.append FTPFile name size mtime else target.append FTPDir..
IronPython: EXE compiled using pyc.py cannot import module “os” http://stackoverflow.com/questions/6195781/ironpython-exe-compiled-using-pyc-py-cannot-import-module-os pattern self.stack directory self.pattern pattern self.files self.index 0 def __getitem__ self index while 1 try file self.files.. self.index 0 def __getitem__ self index while 1 try file self.files self.index self.index self.index 1 except IndexError # pop.. next directory from stack self.directory self.stack.pop self.files os.listdir self.directory self.index 0 else # got a filename..
Directory Walker for Python http://stackoverflow.com/questions/775231/directory-walker-for-python tree def __init__ self directory self.stack directory self.files self.index 0 def __getitem__ self index while 1 try file self.files.. self.index 0 def __getitem__ self index while 1 try file self.files self.index self.index self.index 1 except IndexError # pop next.. next directory from stack self.directory self.stack.pop self.files os.listdir self.directory self.index 0 else # got a filename..
How do I correctly clean up a Python object? http://stackoverflow.com/questions/865115/how-do-i-correctly-clean-up-a-python-object clean up a Python object class Package def __init__ self self.files # ... def __del__ self for file in self.files os.unlink file.. self self.files # ... def __del__ self for file in self.files os.unlink file __del__ self above fails with an AttributeError.. example above you'd use class Package def __init__ self self.files def __enter__ self return self # ... def __exit__ self type..
|