all Python 3platformfunction
platform.python_build()
interpreter
The interpreter's build number and build date as a tuple of strings, e.g. ('main', 'Oct 3 2026 01:04:31').
Syntax
buildno, builddate = platform.python_build()
The 'number' is a version-control tag or branch name rather than a number, and the date is a string in the C compiler's format with two spaces before a single-digit day, so parsing it with datetime.strptime and '%b %d %Y' fails unless you allow for that. It belongs in bug reports, not in program logic.
Examples
import platform
print(platform.python_build()) # → ? например ('main', 'Oct 3 2026 01:04:31')
print(len(platform.python_build())) # → 2
See also
Open in the full glossarydocs.python.orgReport an inaccuracy