Did I find the right examples for you? yes no

All Samples(8543)  |  Call(8543)  |  Derive(0)  |  Import(0)
close() -> None or (perhaps) an integer.  Close the file.

Sets data attribute .closed to True.  A closed file cannot be used for
further I/O operations.  close() may be called more than once without
error.  Some kinds of file objects (for example, opened by popen())
may return an exit status upon closing.

src/a/c/activepapers-python-HEAD/examples/test_internal_files.py   activepapers-python(Download)
            def close(self):
                self.subclass_closed = True
                file.close(self)
 
        with C(TESTFN, 'w') as f:

src/s/h/shedskin-HEAD/examples/rdb.py   shedskin(Download)
    a.fromstring(f.read())
    PState=a.tolist()
    f.close()
  except IOError,EOFError:
    del PState[:]
    f=file("iPod_Control/iTunes/iTunesPState","wb")
    array.array('B',PState).tofile(f)
    f.close()
  except IOError:
    log("FAILED.")
            Rules.append(p)
#    Rules+=filter(None,map(ParseRuleLine,f.read().split("\n")))
    f.close()
  except IOError:
    pass
  except (IOError,EOFError):
    pass
  if iTunesSD: iTunesSD.close()
 
  if len(header)==51:
    iTunesSD.seek(0)
    iTunesSD.write("\0%c%c"%(total_count>>8,total_count&0xFF))
    iTunesSD.close()
  except IOError:
    log("ERROR: Some strange errors occured while writing iTunesSD.")

src/p/y/pyobjc-HEAD/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/TinyTinyEdit/TinyTinyEdit.py   pyobjc(Download)
    def writeToFile_ofType_(self, path, tp):
        f = file(path, "w")
        text = self.textView.string()
        f.write(text.encode("utf8"))
        f.close()
    def readFromUTF8(self, path):
        f = file(path)
        text = unicode(f.read(), "utf8")
        f.close()
        self.textView.setString_(text)

src/p/e/personis-0.933/personis/examples/aelog/httplib2/__init__.py   personis(Download)
            f = file(cacheFullPath, "rb")
            retval = f.read()
            f.close()
        except IOError:
            pass
    def set(self, key, value):
        cacheFullPath = os.path.join(self.cache, self.safe(key))
        f = file(cacheFullPath, "wb")
        f.write(value)
        f.close()

src/q/t/Qt-Python-Binding-Examples-HEAD/qcommons/qwinutils.py   Qt-Python-Binding-Examples(Download)
            f = file(config_path)
            buf = f.read()
            f.close()
        else:
            buf = None
        f = file(path, "w")
        f.write(content)
        f.close()
 
    def _load_win_geo(self):
            f = file(config_path)
            buf = f.read()
            f.close()
        else:
            buf = None

src/e/n/enterprise-toolkit-HEAD/api_sample/third_party/httplib2/__init__.py   enterprise-toolkit(Download)
            f = file(cacheFullPath, "rb")
            retval = f.read()
            f.close()
        except IOError:
            pass
    def set(self, key, value):
        cacheFullPath = os.path.join(self.cache, self.safe(key))
        f = file(cacheFullPath, "wb")
        f.write(value)
        f.close()

src/r/e/retro-HEAD/Examples/_Attic/Wiki/Wiki.py   retro(Download)
		f = file(p, 'r')
		c = f.read()
		f.close()
		return c
 
		f = file(self.pagePath(page), 'w')
		c = f.write(content)
		f.close()
		return content
 

src/m/u/music-player-HEAD/mac/pyobjc-framework-Cocoa/Examples/AppKit/TinyTinyEdit/TinyTinyEdit.py   music-player(Download)
    def writeToFile_ofType_(self, path, tp):
        f = file(path, "w")
        text = self.textView.string()
        f.write(text.encode("utf8"))
        f.close()
    def readFromUTF8(self, path):
        f = file(path)
        text = unicode(f.read(), "utf8")
        f.close()
        self.textView.setString_(text)

src/g/a/gae-twitter-oauth-example-HEAD/httplib2/__init__.py   gae-twitter-oauth-example(Download)
            f = file(cacheFullPath, "rb")
            retval = f.read()
            f.close()
        except IOError:
            pass
    def set(self, key, value):
        cacheFullPath = os.path.join(self.cache, self.safe(key))
        f = file(cacheFullPath, "wb")
        f.write(value)
        f.close()

src/p/y/pyglossary-HEAD/doc/non-gui_examples/takeFileWords.py   pyglossary(Download)
print len(words), 'words found. writing to file...'
wordsFile.write('\n'.join(words) + '\n')
wordsFile.close()
fp.close()
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next