Guidance for creating polyglot files that are valid in both Python and C. This skill applies when tasked with writing code that must be parseable and executable by both the Python interpreter and C compiler. Covers polyglot syntax techniques, testing strategies, and critical cleanup requirements.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Guidance for creating polyglot files that are valid in both Python and C. This skill applies when tasked with writing code that must be parseable and executable by both the Python interpreter and C compiler. Covers polyglot syntax techniques, testing strategies, and critical cleanup requirements.
Polyglot C-Python File Creation
This skill provides guidance for creating single source files that function correctly as both Python and C programs.
When to Use
This skill applies when:
Creating a file that must be valid syntax for both Python and C
The file needs to execute correctly under both python filename and gcc filename && ./output
Building polyglot programs that produce equivalent output in both languages
Polyglot Structure Approach
Core Technique
Use preprocessor directives and string literals to hide language-specific code:
Hide C code from Python: Wrap C-specific code in triple-quoted strings that Python ignores
Hide Python code from C: Use #if 0...#endif preprocessor blocks that C ignores but Python sees as comments