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/p/w/PwnBerryPi-HEAD/src/pexpect-2.3/examples/script.py   PwnBerryPi(Download)
    print "Script recording started. Type ^] (ASCII 29) to escape from the script shell."
    p.interact(chr(29))
    fout.close()
    return 0
 

src/g/a/gae-twitter-oauth-example-HEAD/werkzeug/contrib/cache.py   gae-twitter-oauth-example(Download)
                    f = file(self._get_filename(key))
                    if load(f) > now and idx % 3 != 0:
                        f.close()
                        continue
                except:
                    f.close()
                    return load(f)
            finally:
                f.close()
            os.remove(filename)
        except:
                dump(value, f, HIGHEST_PROTOCOL)
            finally:
                f.close()
        except (IOError, OSError):
            pass

src/t/r/traitsui-HEAD/examples/demo/Standard_Editors/File_Dialog/File_Open_with_Custom_Extension.py   traitsui(Download)
            fh   = file( self.file_name, 'rb' )
            data = fh.read()
            fh.close()
        except:
            return ''

src/b/a/baepython_sdk-HEAD/examples/weibotest/0/web/utils.py   baepython_sdk(Download)
    f = file(filename + '.tmp', 'w')
    f.write(content)
    f.close()
    os.rename(f.name, path)
 

src/p/y/pybrain-HEAD/pybrain/tools/example_tools.py   pybrain(Download)
    def loadWeights(self, filename):
        filepointer = file(filename)
        self.agent.learner.current = load(filepointer)
        filepointer.close()
        self.agent.learner.gd.init(self.agent.learner.current)
    def saveWeights(self, filename, w):
        filepointer = file(filename, 'w+')
        dump(w, filepointer)
        filepointer.close()
 
    # Method for saving the weight matrix    
    def saveResults(self, filename, results):
        filepointer = file(filename, 'w+')
        dump(results, filepointer)
        filepointer.close()

src/p/y/PyBrain-0.3/pybrain/tools/example_tools.py   PyBrain(Download)
    def loadWeights(self, filename):
        filepointer = file(filename)
        self.agent.learner.current = load(filepointer)
        filepointer.close()        
        self.agent.learner.gd.init(agent.learner.current)
    def saveWeights(self, filename, w):
        filepointer = file(filename, 'w+')
        dump(w, filepointer)
        filepointer.close()
 
    # Method for saving the weight matrix    
    def saveResults(self, filename, results):
        filepointer = file(filename, 'w+')
        dump(results, filepointer)
        filepointer.close()

src/q/t/Qt-Python-Binding-Examples-HEAD/windows/auto_save_win_geometry.py   Qt-Python-Binding-Examples(Download)
            f = file(config_path)
            buf = f.read()
            f.close()
        else:
            buf = None
            f = file(config_path)
            buf = f.read()
            f.close()
        else:
            buf = None

src/q/t/Qt-Python-Binding-Examples-HEAD/package_maker/py2app/with_image/setup.py   Qt-Python-Binding-Examples(Download)
    f = file(dst, "w")
    f.write(_QT_CONF_TPL)
    f.close()
 
 

src/q/t/Qt-Python-Binding-Examples-HEAD/package_maker/py2app/simple/setup.py   Qt-Python-Binding-Examples(Download)
    f = file(dst, "w")
    f.write(_QT_CONF_TPL)
    f.close()
 
 

src/g/a/gae-twitter-oauth-example-HEAD/werkzeug/debug/__init__.py   gae-twitter-oauth-example(Download)
                return Response(f.read(), mimetype=mimetype)
            finally:
                f.close()
        return Response('Not Found', status=404)
 

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