Does Godot use Python? No: GDScript looks like Python, and here is where it is not
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.
AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.
Intel or AMD Chromebook, with Linux turned on.
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.5Run this fix with your agent
Flockbay is the Godot editor with an AI agent built in. Paste this into Flockbay's chat, or into Claude Code or Codex connected to Flockbay over MCP: the agent finds the cause in your project, applies the fix, runs the game headless and reads Godot's output to check it.
More on this: Used tab character for indentation instead of space as used before in the file in Godot 4
Does Godot use Python? No: GDScript looks like Python, and here is where it is not 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. Where this calls for a change in my Godot 4 project, make it, then run the game headless and check Godot's output for errors.Verified 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, gdscript_parser.cpp, Godot's GDScript parser at 4.7.2.
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.
Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.
Download Flockbay free