All Samples(87541) | Call(87541) | Derive(0) | Import(0)
open(name[, mode[, buffering]]) -> file object Open a file using the file() type, returns a file object. This is the preferred way to open a file. See file.__doc__ for further information.
src/s/h/shedskin-HEAD/examples/LZ2.py shedskin(Download)
def hardertest():
print "Reading the BentCoinFile"
inputfile = open( "testdata/BentCoinFile" , "r" )
outputfile = open( "tmp.zip" , "w" )
print "Compressing to tmp.zip"
print "DONE compressing"
inputfile = open( "tmp.zip" , "r" )
outputfile = open( "tmp2" , "w" )
print "Uncompressing to tmp2"
src/s/h/shedskin-HEAD/examples/block.py shedskin(Download)
def hardertest():
print "Reading the BentCoinFile"
inputfile = open( "testdata/BentCoinFile" , "r" )
outputfile = open( "tmp.zip" , "w" )
print "Compressing to tmp.zip"
compress_it(inputfile, outputfile)
outputfile.close(); inputfile.close()
# print "DONE compressing"
inputfile = open( "tmp.zip" , "r" )
inputfile = open( "tmp.zip" , "r" )
outputfile = open( "tmp2" , "w" )
print "Uncompressing to tmp2"
uncompress_it(inputfile, outputfile)
src/s/h/shedskin-HEAD/examples/ac_encode.py shedskin(Download)
def hardertest():
print "Reading the BentCoinFile"
inputfile = open( "testdata/BentCoinFile" , "r" )
outputfile = open( "tmp.zip" , "w" )
print "Compressing to tmp.zip"
print "DONE compressing"
inputfile = open( "tmp.zip" , "r" )
outputfile = open( "tmp2" , "w" )
print "Uncompressing to tmp2"
src/l/a/latimes-appengine-template-0.022/appengine_template/google_appengine/lib/webob/docs/comment-example-code/example.py latimes-appengine-template(Download)
return []
else:
f = open(filename, 'rb')
data = load(f)
f.close()
return data
def save_data(self, url, data):
filename = self.url_filename(url)
f = open(filename, 'wb')
src/p/e/personis-0.933/personis/examples/aelog/oauth2client/locked_file.py personis(Download)
try:
self._fh = open(self._filename, self._mode)
except IOError, e:
# If we can't access with _mode, try _fallback_mode and don't lock.
if e.errno == errno.EACCES:
self._fh = open(self._filename, self._fallback_mode)
if self._fh:
self._fh.close()
self._fh = open(self._filename, self._fallback_mode)
return
time.sleep(delay)
try:
self._fh = open(self._filename, self._mode)
except IOError, e:
# If we can't access with _mode, try _fallback_mode and don't lock.
if e.errno == errno.EACCES:
self._fh = open(self._filename, self._fallback_mode)
src/n/i/nipy-0.3.0/examples/labs/need_data/get_data_light.py nipy(Download)
datafile = os.path.join(url, filename)
fp = urlopen(datafile)
local_file = open(mask_image, 'wb')
local_file.write(fp.read())
local_file.flush()
datafile = os.path.join(url, filename)
fp = urlopen(datafile)
local_file = open(input_image, 'wb')
local_file.write(fp.read())
local_file.flush()
datafile = os.path.join(url, filename)
fp = urlopen(datafile)
local_file = open(group_data, 'wb')
local_file.write(fp.read())
local_file.flush()
datafile = os.path.join(url, 'localizer_paradigm.csv')
fp = urlopen(datafile)
local_file = open(paradigm, 'wb')
local_file.write(fp.read())
local_file.flush()
datafile = os.path.join(url, filename)
fp = urlopen(datafile)
local_file = open(raw_fmri, 'wb')
local_file.write(fp.read())
local_file.flush()
src/w/x/wxmap2-HEAD/trunk/app/src/python/pexpect-2.3/examples/chess3.py wxmap2(Download)
def read_until_cursor (self, r,c):
fout = open ('log','a')
while 1:
k = self.child.read(1, 10)
self.term.process (k)
def do_scan (self):
fout = open ('log','a')
while 1:
c = self.child.read(1,10)
self.term.process (c)
c3 = white.term.get_abs(17,60)
c4 = white.term.get_abs(17,61)
fout = open ('log','a')
fout.write ('Computer:%s%s%s%s\n' %(c1,c2,c3,c4))
fout.close()
c3 = white.term.get_abs(17,60)
c4 = white.term.get_abs(17,61)
fout = open ('log','a')
fout.write ('Computer:%s%s%s%s\n' %(c1,c2,c3,c4))
fout.close()
src/l/a/Langtangen-HEAD/src/py/examples/simviz/simviz1_ssh.py Langtangen(Download)
# make input file to the program:
f = open('%s.i' % case, 'w')
# write a multi-line (triple-quoted) string with
# variable interpolation:
# generate script to be run on the remote machine:
f = open('run_%s.py' % case, 'w')
f.write("""\
#!/usr/bin/env python
# make file with gnuplot commands:
f = open(case + '.gnuplot', 'w')
f.write("""
set title '%s: m=%g b=%g c=%g f(y)=%s A=%g w=%g y0=%g dt=%g';
src/b/a/badger-lib-HEAD/packages/pyparsing/examples/pymicko.py badger-lib(Download)
exit(1)
try:
parse = stdin if input_file == stdin else open(input_file,'r')
except Exception:
print "Input file '%s' open error" % input_file
#mc.symtab.display()
try:
out = open(output_file, 'w')
out.write(mc.codegen.code)
out.close
src/g/a/gaeframework-2.0.10/google_appengine/lib/webob/docs/comment-example-code/example.py gaeframework(Download)
return []
else:
f = open(filename, 'rb')
data = load(f)
f.close()
return data
def save_data(self, url, data):
filename = self.url_filename(url)
f = open(filename, 'wb')
Previous 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next