Did I find the right examples for you? yes no

All Samples(7)  |  Call(6)  |  Derive(0)  |  Import(1)
write conent to a file

        def writefile(filename , content):
    '''
    write conent to a file
    '''
    try:
        f = codecs.open(filename , 'w' , C('encoding'))
        f.write(content)
        f.close()
    except:
        log.error("write to %s failed" % filename)
        raise
        


src/g/a/gaeenv-0.1.2/gaeenv/sdk.py   gaeenv(Download)
 
from tempfile import gettempdir
from utils import logger, writefile
from zipfile import ZipFile
 
	temp_dir = gettempdir()
	temp_zip = os.path.join(temp_dir, 'google_appengine_%s.zip' % version)
	writefile(temp_zip, response.content, encode=None)
	return temp_zip
 

src/u/r/ursa2-0.0.12/ursa2/build.py   ursa2(Download)
                content = all_url(content,os.path.dirname(dst))
                content = replace(content,self._target)
                utils.writefile(dst,content)
            except Exception,e:
                if self._force:
        content = utils.readfile(dst)
        content = replace(content,self._target)
        utils.writefile(dst,content)
        if C('js_ascii_only'):
            subprocess.call( 'node ' + RPL_PATH +' '+dst+' '+dst,shell = True)
                content = replace(content,self._target)
                content = removeCssDepsDeclaration(content)
                utils.writefile(tpl,content)
            except Exception,e:
                if self._force:
                    content = utils.readfile(f)
                    content = replace(content,self._target)
                    utils.writefile(f,content)
                except Exception,e:
                    if self._force:
                    os.makedirs(target_dir)
                dst_file = re.sub(r'\.%s$'%C('template_ext'),'.html',os.path.join(self._build_html_dir,tpl))
                utils.writefile(dst_file,html)
            except Exception,e:
                if not C('html_force_output') and not self._force: