Skip to content

Instantly share code, notes, and snippets.

@0xFF1E071F
0xFF1E071F / compile.py
Created October 26, 2020 09:20 — forked from itdaniher/compile.py
compile python script to ELF on Linux via cython and gcc
import subprocess
import sys
import tempfile
from Cython.Compiler import Main, CmdLine, Options
in_file_name = sys.argv[1]
source = open(in_file_name).read()
out_file_name = in_file_name.replace('.py', '.out')
temp_py_file = tempfile.NamedTemporaryFile(suffix='.py', delete=False)