I know that Python
is platform independent, but I don't understand how that works for CPython
. If the interpreter and some of the modules are written in C
, aren't those going to be platform dependent?
Asked
Active
Viewed 8,332 times
1

Guy Avraham
- 3,482
- 3
- 38
- 50

Bee
- 195
- 1
- 3
- 12
-
2Python programs are platform independent because they can be run on different platforms using an interpreter built specifically for that platform. Just as Java programs can be run on different platforms using a JVM built for that platform. – khelwood Jun 18 '20 at 21:01
1 Answers
4
C is platform independent in the sense that it can be compiled for any machine for which a compiler is made to target that machine. That's why the Python source code is platform independent, even if a Python binary can only work on one platform.

luther
- 5,195
- 1
- 14
- 24