All Samples(99432) | Call(99432) | 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/u/n/unladen-swallow-HEAD/Mac/Demo/example0/checktext.py unladen-swallow(Download)
def main():
pathname = EasyDialogs.AskFileForOpen(message='File to check end-of-lines in:')
if not pathname:
sys.exit(0)
fp = open(pathname, 'rb')
try:
data = fp.read()
src/i/n/IncPy-HEAD/Mac/Demo/example0/checktext.py IncPy(Download)
def main():
pathname = EasyDialogs.AskFileForOpen(message='File to check end-of-lines in:')
if not pathname:
sys.exit(0)
fp = open(pathname, 'rb')
try:
data = fp.read()
src/s/l/SlopPy-HEAD/Mac/Demo/example0/checktext.py SlopPy(Download)
def main():
pathname = EasyDialogs.AskFileForOpen(message='File to check end-of-lines in:')
if not pathname:
sys.exit(0)
fp = open(pathname, 'rb')
try:
data = fp.read()
src/p/y/python2.6-HEAD/Mac/Demo/example0/checktext.py python2.6(Download)
def main():
pathname = EasyDialogs.AskFileForOpen(message='File to check end-of-lines in:')
if not pathname:
sys.exit(0)
fp = open(pathname, 'rb')
try:
data = fp.read()
src/p/e/pexpect-HEAD/pexpect/examples/chess3.py pexpect(Download)
def read_until_cursor (self, r,c):
fout = open ('log','a')
while 1:
k = self.child.read(1, 10)
self.term.process (k)
fout.write ('(r,c):(%d,%d)\n' %(self.term.cur_r, self.term.cur_c))
fout.flush()
def do_scan (self):
fout = open ('log','a')
while 1:
c = self.child.read(1,10)
self.term.process (c)
fout.write ('(r,c):(%d,%d)\n' %(self.term.cur_r, self.term.cur_c))
fout.flush()
c2 = white.term.get_abs(17,59)
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()
white.do_move('c2c4')
white.read_until_cursor (19,60)
c1 = white.term.get_abs(17,58)
c2 = white.term.get_abs(17,59)
c3 = white.term.get_abs(17,60)
c4 = white.term.get_abs(17,61)
fout = open ('log','a')
src/n/l/nltk-HEAD/nltk-old/contrib/nltk_contrib/unimelb/460/2003/robertgm/sample.py nltk(Download)
#they have given us a filename
else:
fp = open(filename)
self.text = []
#loop through each paragraph
def write(self, filename):
fp = open(filename, 'w')
fp.write(len(self.text).__repr__()+'\n')
for paragraph in self.text:
for sentence in paragraph.type():
fp.write(sentence.type()+'. ')
fp.write('\n')
src/c/l/clearversion-HEAD/clearVersion/etc/subversion/hooks/examples/svn2feed.py clearversion(Download)
(file, ext) = os.path.splitext(self.feed_file)
self.pickle_file = file + ".pickle"
if os.path.exists(self.pickle_file):
self.rss = pickle.load(open(self.pickle_file, "r"))
else:
self.rss = self.PyRSS2Gen.RSS2(
title = self.feed_title,
def write_output(self):
s = pickle.dumps(self.rss)
f = open(self.pickle_file, "w")
f.write(s)
f.close()
f = open(self.feed_file, "w")
self.pickle_file = self.feed_file + ".pickle"
if os.path.exists(self.pickle_file):
self.document = pickle.load(open(self.pickle_file, "r"))
self.feed = self.document.getElementsByTagName('feed')[0]
else:
self._init_atom_document()
def write_output(self):
s = pickle.dumps(self.document)
f = open(self.pickle_file, "w")
f.write(s)
f.close()
f = open(self.feed_file, "w")
src/p/y/pythonwine-HEAD/Mac/Demo/example0/checktext.py pythonwine(Download)
def main():
pathname = EasyDialogs.AskFileForOpen(message='File to check end-of-lines in:')
if not pathname:
sys.exit(0)
fp = open(pathname, 'rb')
try:
data = fp.read()
src/s/p/spike-HEAD/vendor/stackless/v2.5.1/Tools/modulator/EXAMPLE.py spike(Download)
m.methodlist = ['newsimple', 'newnumberish', 'newott']
m.objects = [o, o2, o3]
fp = open('EXAMPLEmodule.c', 'w')
genmodule.write(fp, m)
fp.close()
src/s/p/spike-HEAD/vendor/stackless/current/Tools/modulator/EXAMPLE.py spike(Download)
m.methodlist = ['newsimple', 'newnumberish', 'newott']
m.objects = [o, o2, o3]
fp = open('EXAMPLEmodule.c', 'w')
genmodule.write(fp, m)
fp.close()
Previous 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 Next