Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(11)  |  Call(3)  |  Derive(0)  |  Import(8)
Create a file with the specified name and write 'contents' (a
sequence of strings without line terminators) to it.

        def write_file (filename, contents):
    """Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    """
    f = open(filename, "w")
    try:
        for line in contents:
            f.write(line + "\n")
    finally:
        f.close()
        


src/p/y/pyCaCORE-0.3.0/cabig/cacore/generate/commands.py   pyCaCORE(Download)
            if d == 'cabig': contents = NS_INIT
            # Yes, this might write the same file several times, not a big deal.
            file_util.write_file(os.path.join(prefix,'__init__.py'),contents)
 
    # Generate ZSI API (*services.py and *_services_types.py)

src/r/i/riak_pb-2.0.0.14/msgcodegen.py   riak_pb(Download)
from distutils import log
from distutils.core import Command
from distutils.file_util import write_file
from datetime import date
 
        self._generate_codes()
        self._generate_classes()
        write_file(self.destination, self._contents)
 
    def _generate_doc(self):

src/p/y/python-djvulibre-0.3.9/setup.py   python-djvulibre(Download)
        if '\n'.join(new_config).strip() != old_config.strip():
            distutils.log.info('creating %r' % self.config_filename)
            distutils.file_util.write_file(self.config_filename, new_config)
        distutils.command.build_ext.build_ext.run(self)
 

src/4/s/4Suite-XML-1.0.2/Ft/Lib/DistExt/BDistRpm.py   4Suite-XML(Download)
import os, glob
from types import ListType
from distutils.command import bdist_rpm
from distutils.core import DEBUG
from distutils.file_util import write_file

src/p/y/pypi2rpm-0.6.3/pypi2rpm/command/bdist_rpm2.py   pypi2rpm(Download)
                              DistutilsFileError, DistutilsExecError)
 
from distutils.file_util import write_file
 
 

src/p/a/packaging-8.7/packaging/dh_make.py   packaging(Download)
    def write_debian_file(self, filename, lines):
        from distutils.file_util import write_file
        dst = os.path.join('debian', filename)
        self.execute(write_file, (dst, lines), "writing %s" % dst)
 

src/l/i/LinkChecker-9.2/setup.py   LinkChecker(Download)
from distutils.command.install_data import install_data
from distutils.dir_util import remove_tree
from distutils.file_util import write_file
from distutils.spawn import find_executable
from distutils import util, log

src/l/i/linkchecker-HEAD/setup.py   linkchecker(Download)
from distutils.command.install_data import install_data
from distutils.dir_util import remove_tree
from distutils.file_util import write_file
from distutils.spawn import find_executable
from distutils import util, log

src/d/o/dosage-HEAD/setup.py   dosage(Download)
from distutils.command.register import register
from distutils import util
from distutils.file_util import write_file
 
AppVersion = '2.13'

src/p/a/patool-HEAD/setup.py   patool(Download)
from distutils.command.install_lib import install_lib
from distutils import util
from distutils.file_util import write_file
 
AppName = "Patool"