Did I find the right examples for you? yes no

All Samples(90843)  |  Call(90843)  |  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/g/a/gaesdk-python-HEAD/lib/webob_0_9/docs/comment-example-code/example.py   gaesdk-python(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/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/s/c/scapy-real-2.2.0-dev/scapy/modules/voip.py   scapy-real(Download)
        os.system("soxmix -t .ul %s -t .ul %s -t ossdsp /dev/dsp &" % (FIFO1,FIFO2))
 
        c1=open(FIFO1,"w", 4096)
        c2=open(FIFO2,"w", 4096)
        fcntl.fcntl(c1.fileno(),fcntl.F_SETFL, os.O_NONBLOCK)

src/p/s/psycopg2da-2.0.9/examples/copy_from.py   psycopg2da(Download)
# copy_from with default arguments, from open file
 
io = open('copy_from.txt', 'wr')
data = ['Tom\tJenkins\t37\n',
        'Madonna\t\\N\t45\n',
        'Federico\tDi Gregorio\t\\N\n']
io.writelines(data)
io.close()
 
io = open('copy_from.txt', 'r')
# copy_from using custom separator, from open file
 
io = open('copy_from.txt', 'wr')
data = ['Tom:Jenkins:37\n',
        'Madonna:\N:45\n',
        'Federico:Di Gregorio:\N\n']
io.writelines(data)
io.close()
 
io = open('copy_from.txt', 'r')
# copy_from using custom null identifier, from open file
 
io = open('copy_from.txt', 'wr')
data = ['Tom\tJenkins\t37\n',
        'Madonna\tNULL\t45\n',

src/p/y/pypy-HEAD/pypy/module/test_lib_pypy/sample_aop_code.py   pypy(Download)
def write_module(name):
    f = open(_make_filename(name), 'w')
    f.write(code)
    f.close()
 

src/s/k/skeleton-0.6/skeleton/examples/basic-package/distribute_setup.py   skeleton(Download)
            # if the download is interrupted.
            data = src.read()
            dst = open(saveto, "wb")
            dst.write(data)
        finally:
    log.warn('Patching...')
    _rename_path(path)
    f = open(path, 'w')
    try:
        f.write(content)
 
    log.warn('Creating %s', pkg_info)
    f = open(pkg_info, 'w')
    try:
        f.write(SETUPTOOLS_PKG_INFO)
    pth_file = os.path.join(placeholder, 'setuptools.pth')
    log.warn('Creating %s', pth_file)
    f = open(pth_file, 'w')
    try:
        f.write(os.path.join(os.curdir, setuptools_file))
    os.mkdir(os.path.join(path, 'EGG-INFO'))
    pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
    f = open(pkg_info, 'w')
    try:
        f.write(SETUPTOOLS_PKG_INFO)

src/m/a/matplotlib-HEAD/examples/tests/backend_driver.py   matplotlib(Download)
        outfile = os.path.join(path, basename)
        tmpfile_name = '_tmp_%s.py' % basename
        tmpfile = open(tmpfile_name, 'w')
 
        future_imports = 'from __future__ import division, print_function'
        for line in open(fullpath):
            'numpy.seterr(invalid="ignore")\n',
            ))
        for line in open(fullpath):
            line_lstrip = line.lstrip()
            if (line_lstrip.startswith('from __future__ import') or

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')

src/s/c/scribus-HEAD/gsoc2009/odtsxwplugin/upstream/Scribus/scribus/plugins/scriptplugin/scripts/FontSample.py   scribus(Download)
    if not path == '':
        try:
            file = open(os.path.join(path,'fontsampler.conf'), 'w')
            data = {
                'a' : defaultPrefs,
def restore_user_conf(path):
    """Restore the data from the save file on the path specified by CONFIG_PATH."""
    try:
        file = open(os.path.join(path,'fontsampler.conf'), 'r')
        data = cPickle.load(file)

src/b/o/boodler-HEAD/core/branch/rel_2_0_4/src/boodle/sample.py   boodler(Download)
    def raw_load(self, filename, csamp):
        if (isinstance(filename, boopak.pinfo.File)):
            afl = filename.open(True)
        else:
            afl = open(filename, 'rb')
    def raw_load(self, filename, csamp):
        if (isinstance(filename, boopak.pinfo.File)):
            afl = filename.open(True)
        else:
            afl = open(filename, 'rb')
    def raw_load(self, filename, csamp):
        if (isinstance(filename, boopak.pinfo.File)):
            afl = filename.open(True)
        else:
            afl = open(filename, 'rb')
        else:
            dirname = os.path.dirname(filename)
            afl = open(filename, 'rb')
        linelist = afl.readlines()
        afl.close()

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