What Python is and how it works
Python is an interpreted general-purpose programming language: programs need no separate build step, as the interpreter runs source code directly. The reference implementation, CPython, is distributed by python.org; “Python” usually means CPython.
Python is used to automate routine work (replacing text in a hundred files, sorting photos into folders), to write tests, utilities and applications, and as an extension language inside other programs. High-level types — lists, dictionaries, sets — and a large standard library make Python programs shorter than equivalent C or Java code. Speed-critical parts go into C modules that plug into the interpreter. For web development, see the Django and FastAPI references; for data analysis, the pandas reference.
A program runs in two steps within one process. The compiler translates source code into bytecode, CPython’s internal representation of the program, and the virtual machine executes it instruction by instruction. Bytecode of imported modules is cached in .pyc files, so loading a module again skips compilation. Bytecode is an implementation detail: it differs between Python versions and between interpreters.
python3 process; there is no separate build step.The dis module shows the bytecode of any function:
import dis def area(width, height): return width * height dis.dis(area) 3 RESUME 0 4 LOAD_FAST_BORROW_LOAD_FAST_BORROW 1 (width, height) BINARY_OP 5 (*) RETURN_VALUEVariables and arguments have no declared types: a name can refer to an object of any type. The interpreter does not check type hints (def area(width: float) -> float); external type checkers and code editors read them. In the standard CPython build, only one thread executes bytecode at a time — this is the global interpreter lock (GIL). A free-threaded build without the GIL also exists; see “asyncio, threads and processes”.
How Python differs from Go and Node.js
| Aspect | Python | Go | Node.js |
|---|---|---|---|
| How it runs | the interpreter executes source code; types are not checked in advance | the compiler checks types and builds an executable | the runtime executes JavaScript on the V8 engine |
| What you deploy | source code and an interpreter of the right version | one statically linked binary with the Go runtime inside | source code and Node.js |
| Concurrency | threads (with the GIL), processes, asyncio | goroutines on top of OS threads | one process with non-blocking I/O |
| Strengths | automation, tests, gluing existing libraries together | network services, loads that use every core | servers in the same language as the frontend |
Choose Python when development speed and ready-made libraries matter most; Go when you need one file to deploy and work on all cores; Node.js when the team already writes its frontend in JavaScript.
What to know first
- The command line: running programs, the current directory, the
PATHvariable — see the Linux reference - Git basics: a project lives in a repository, and the virtual environment directory stays out of it — see the Git reference
- A code editor with Python highlighting and indentation checks
Section sources
the section is written from these pages- 1. Whetting Your Appetitedocs.python.org/3.15/tutorial/appetite.html(opens in a new tab)
- Glossary: bytecodedocs.python.org/3.15/glossary.html(opens in a new tab)
- dis — Disassembler for Python bytecodedocs.python.org/3.15/library/dis.html(opens in a new tab)
- Frequently Asked Questions (FAQ)go.dev/doc/faq(opens in a new tab)
- Introduction to Node.jsnodejs.org/learn/getting-started/introduction-to-nodejs(opens in a new tab)