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

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Convert code object to a .pyc pseudo-file 

        def _code_to_file(co):
    """ Convert code object to a .pyc pseudo-file """
    return BytesIO(
            imp.get_magic() + b'\0\0\0\0' + marshal.dumps(co))
        


src/m/o/modulegraph-0.11.1/modulegraph_tests/test_modulegraph.py   modulegraph(Download)
            code = modulegraph._code_to_file.func_code
 
        data = modulegraph._code_to_file(code)
        self.assertTrue(hasattr(data, 'read'))