All Samples(5188) | Call(5187) | Derive(0) | Import(1)
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/i/r/Iris7-1.99.0-xdistrev2/docs/iris/src/sphinxext/gen_example_directory.py Iris7(Download)
fhstatic = file(outputfile, 'w')
fhstatic.write(contents)
fhstatic.close()
# indent the contents
contents = '\n'.join([' %s'%row.rstrip() for row in contents.split('\n')])
fh.write(contents)
fh.write('\n\n\n\n\n')
fh.close()
fh.close()
fhsubdirIndex.close()
fhindex.close()
src/c/a/casadi-HEAD/trunk/documentation/examples/ctemplate/ctemplate.py casadi(Download)
linkerscript.write('#!/bin/bash\n')
linkerscript.write(linker)
linkerscript.close()
link.close()
compiler = linker.split(' ')[0] + ' ' + myflags + mydefines + ' -o "$1.o" -c "$1.%s"' % cextension
flags.close()
compilerscript = file('compiler.sh','w')
compilerscript.write('#!/bin/bash\n')
compilerscript.write(compiler)
compilerscript.close()
link.close()
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/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/n/o/noen-HEAD/server/Python/src/BinarySampleWrite.py noen(Download)
binFile.write(formatProjectChange([3,2,2]).rstrip('\n'))
binFile.write(formatInputData(1,8,'nanoseconds test:2199023255552',2199023255552,nanoSeconds).rstrip('\n'))
binFile.close()
print 'binary data written!'
binFile.write(formatOutput3Data(3,3,5,[123,789,234,9876,1000]))
binFile.close()
print 'binary data written to rows!'
src/p/y/pywebmvc-HEAD/sample-app/src/code/backend/FileBackedDB.py pywebmvc(Download)
fp = file(self.filename, "a")
fp.write(self.__marshall(entry))
fp.close()
else:
entryList = self.__readAllAddresses()
fp = file(self.filename, "w")
fp.write(data)
fp.close()
def findById(self, id):
return filter(lambda x: x.id == id, self.__readAllAddresses())[0]
def __readAllAddresses(self):
try:
fp = file(self.filename, "r")
rawData = fp.read().strip()
fp.close()
src/s/i/simpleauth-0.1.4/example/lib/httplib2/__init__.py simpleauth(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/pyobjc-framework-Cocoa-2.5.1/Examples/AppKit/TinyTinyEdit/TinyTinyEdit.py pyobjc-framework-Cocoa(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/m/a/Matplotlib--JJ-s-dev-HEAD/examples/tests/backend_driver.py Matplotlib--JJ-s-dev(Download)
tmpfile.write('\nsavefig(r"%s", dpi=150)' % outfile)
tmpfile.close()
start_time = time.time()
program = [x % {'name': basename} for x in python]
src/a/s/astLib-0.6.1/examples/CMRRestFrameConversion/CMRRestFrameConversion.py astLib(Download)
else:
outFile.write("%s = %.3f\n" % (key, float(r[key])))
outFile.close()
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next