Dorian Dore
Dorian Dore

Reputation: 962

Can C run compiled Python code (.pyc files)?

Considering that the main Python implementation CPython written in C, and libraries exist that can convert Python code to C, would it be possible to run compiled Python bytecode in C or C++?

Upvotes: 0

Views: 1485

Answers (1)

Daniel
Daniel

Reputation: 42758

First, you cannot run anything in C, C is a programming language. You can embed python in your C program (see Documentation), because python can be compiled as library. But Python is not only the pyc-File, but consists of many modules, that make python as powerful as it is.

Upvotes: 2

Related Questions