Does Godot use Python? No: GDScript looks like Python, and here is where it is not
By Eduardo Orellana · Updated
No. Godot's built-in language is GDScript, which borrows Python's indentation and much of its feel but is its own language: def is func, there are no f-strings or list comprehensions, and 7 / 2 is 3, not 3.5. Godot also runs C# in its .NET build and C++ through GDExtension; Python is not built in.
What Godot is checking
GDScript is parsed by Godot's own parser, written for the engine: a script is a class, its functions are declared with func, and it has engine types such as Vector2 and Node built in. The parser stops at the first thing that is not GDScript, so Python code fails at its first def.
Other Python habits fail the same way. A list comprehension stops at the for with Expected closing "]" after array elements. An f-string such as f"Hello {name}" stops with Expected closing ")" after call arguments. GDScript formats with % or str(), and maps a list with a lambda.
Arithmetic follows the types: dividing two integers gives an integer, so 7 / 2 is 3, while 7 / 2.0 is 3.5. The fixed run prints both.
The engine this page ran on is Godot's .NET build, which runs C# as well as GDScript. C++ reaches the engine through GDExtension. Python is not part of Godot; it is available only through third-party GDExtension bindings that the Godot project does not maintain.
Reproduce it
A function written the Python way, in a Godot 4 script. The scene is one Node with this script.
extends Node
def greet(name):
return "Hello " + name
func _ready():
print(greet("Ada"))
What Godot 4.7.2 prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
SCRIPT ERROR: Parse Error: Unexpected identifier "def" in class body.
at: GDScript::reload (res://answers/does-godot-use-python/repro.gd:3)
ERROR: Failed to load script "res://answers/does-godot-use-python/repro.gd" with error "Parse error".
at: load (modules/gdscript/gdscript_resource_format.cpp:46)Fix it
The same function in GDScript, with a list mapped by a lambda in place of a comprehension, % in place of an f-string, and the two divisions.
extends Node
func greet(who: String) -> String:
return "Hello %s" % who
func _ready() -> void:
var doubled := range(3).map(func(x): return x * 2)
print(greet("Ada"), " ", doubled)
print("len is ", len([1, 2, 3]), ", 7 / 2 is ", 7 / 2, ", 7 / 2.0 is ", 7 / 2.0)
What the fixed script prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
Hello Ada [0, 2, 4]
len is 3, 7 / 2 is 3, 7 / 2.0 is 3.5Verified on Godot 4.7.2
Both scripts on this page were run headless on Godot 4.7.2 (4.7.2.stable.mono.official.ed1daf0bf) on 6 October 2026, and the output above is what Godot printed, unedited.
Where the check lives in Godot's source: [GDScript reference in Godot's documentation](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html), [gdscript_parser.cpp, Godot's GDScript parser at 4.7.2](https://github.com/godotengine/godot/blob/4.7.2-stable/modules/gdscript/gdscript_parser.cpp).
Questions
- Is GDScript hard to learn if I know Python?
- The syntax will feel familiar: indentation, for and while, if and elif, len and range. What is new is the engine around it: scripts extend nodes, functions such as _ready and _process are called by the engine, and signals connect nodes.
- Can I use Python libraries in Godot?
- Not from GDScript. A Python library would need a third-party Python binding through GDExtension, which Godot does not ship.
Related
- What is GDScript?
- setget in Godot 4: properties with set and get
- How to wait in Godot 4: await instead of yield
- Every verified Godot 4 answer
- The "tool" keyword was removed in Godot 4: use @tool
- Invalid type in static function '…' in type '…'. Cannot convert argument in Godot 4
- Invalid call to function '…' in base '…'. Expected N argument(s) in Godot 4
- The "onready" keyword was removed in Godot 4: use @onready
- The "export" keyword was removed in Godot 4: every export(...) and its @export annotation
Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.
Download Flockbay free