Skip to content

Instantly share code, notes, and snippets.

View xiaonanln's full-sized avatar

Nan Lin xiaonanln

View GitHub Profile
@adamnew123456
adamnew123456 / pyc.py
Last active June 10, 2024 07:12
Using Inline C Code In Python Programs
"""
Inserts C code directly into Python files, which can then be dynamically linked
in and called via ctypes.
"""
import atexit
import ctypes
import os
import shlex
import sys
import tempfile