On 2005-10-21, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > >> Is there a way to compile a C program into a .pyc file that >> has the same behavior as the compiled C program? > > unless you find a C->Python compiler, no.
Or a C->Python-byte-code compiler. > PYC files contain Python bytecode, C compilers usually > generate native code for a given machine platform. Generating byte-code for a stack-based virtual machine used to be fairly popular for Pascal. [I once typed in from a book a Pascal compiler in 8080 assembly language that generate P-code.] Generating Python byte code from Pascal wouldn't be terribly difficult, but doing so for C would be pretty tough because you'd have to figure out how to fake all the low-level pointer shenanigans which C allows (or some would say depends upon). -- Grant Edwards grante Yow! Are we live or at on tape? visi.com -- http://mail.python.org/mailman/listinfo/python-list