Files
godot-website/article/beta-release-python-support/index.html
2023-11-30 11:25:55 +00:00

442 lines
15 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Godot Engine">
<meta name="description" content="Emmanuel Leblond (touilleMan) just released the first beta of his Python for Godot interface, which will allow developers to use Python 3 and its complete ecosystem as a scripting language in Godot 3.0.">
<meta name="theme-color" content="#3d8fcc">
<meta property="og:site_name" content="Godot Engine">
<meta property="og:url" content="https://godotengine.org/article/beta-release-python-support/">
<meta name="twitter:site" content="@godotengine">
<meta property="og:title" content="Beta release for Python support">
<meta property="og:description" content="Emmanuel Leblond (touilleMan) just released the first beta of his Python for Godot interface, which will allow developers to use Python 3 and its complete ecosystem as a scripting language in Godot 3.0.">
<meta property="og:image" content="https://godotengine.org/storage/app/uploads/public/596/62b/1c4/59662b1c4ffa8859295653.png">
<meta property="og:type" content="article">
<meta name="twitter:card" content="summary_large_image">
<title>Beta release for Python support</title>
<link rel="alternate" type="application/rss+xml" title="Godot News" href="/rss.xml">
<link rel="icon" href="/assets/favicon.png" sizes="any">
<link rel="icon" href="/assets/favicon.svg" type="image/svg+xml">
<link rel="stylesheet" href="/assets/css/main.css?110">
<link rel="stylesheet" href="/assets/css/tobii.min.css">
<link rel="preload" as="font" href="/assets/fonts/Montserrat-Bold.woff2" crossorigin>
<link rel="preload" as="font" href="/assets/fonts/Montserrat-ExtraBold.woff2" crossorigin>
<link rel="me" href="https://mastodon.gamedev.place/@godotengine">
</head>
<body>
<input type="checkbox" id="nav_toggle_cb">
<header>
<div class="container flex align-center">
<div id="nav_head">
<a href="/" id="logo-link">
<img class="nav-logo" src="/assets/logo.svg" width="136" height="48" alt="Godot Engine">
<img class="nav-logo dark-logo" src="/assets/logo_dark.svg" width="136" height="48" alt="Godot Engine">
</a>
<label for="nav_toggle_cb" id="nav_toggle_btn">
<img src="/assets/icons/hamburger.svg" width="24" height="24" alt="Main menu">
</label>
</div>
<nav id="nav">
<ul class="left">
<li><a href="/features">Features</a></li>
<div class="only-on-mobile" style="width: 100%">
<li><a href="/showcase">Showcase</a></li>
</div>
<li><a href="/blog">Blog</a></li>
<li><a href="/community">Community</a></li>
<li><a href="/contact">About</a></li>
<li><a href="https://godotengine.org/asset-library/asset">Assets</a></li>
</ul>
<ul class="right">
<li><a href="/download/windows" class="set-os-download-url">Download</a></li>
<li><a href="https://docs.godotengine.org">Learn</a></li>
<li><a href="https://docs.godotengine.org/en/stable/community/contributing/index.html">Contribute</a></li>
<li class="fund"><a href="https://fund.godotengine.org">&#xFE0E; Donate</a></li>
</ul>
</nav>
</div>
</header>
<main>
<style>
body {
background-color: var(--background-color);
}
h1 {
margin-bottom: 8px;
margin-top: 32px;
}
:not(pre)>code {
background: var(--code-background-color);
padding: 1px 4px;
font-size: 0.95em;
border-radius: 3px;
}
pre {
background: var(--codeblock-background-color);
color: var(--codeblock-color);
}
pre code {
display: block;
overflow-x: auto;
padding: .5em;
}
.date-big {
line-height: 2;
margin-left: 32px;
}
article {
background-color: var(--base-color);
box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, 0.15);
}
figure {
margin: 0;
}
figure img {
margin: 0;
}
article img,
article video {
max-width: 100%;
height: auto;
display: block;
margin: auto;
margin-top: 16px;
margin-bottom: 16px;
}
article h1 {
margin-top: 64px;
}
article h2,
article h3,
article h4 {
margin-top: 42px;
}
.article-info {
display: flex;
flex-direction: column;
gap: 8px;
}
.article-metadata {
display: flex;
gap: 24px;
align-items: center;
font-family: var(--header-font-family);
margin-bottom: 12px;
}
@media (max-width: 900px) {
.article-metadata {
flex-direction: column;
align-items: flex-start;
gap: 16px;
}
}
.article-author {
color: var(--base-color-text-subtitle-date);
font-weight: 700;
font-size: 18px;
flex-grow: 1;
display: flex;
gap: 12px;
align-items: center;
}
.article-author .avatar {
border-radius: 100%;
margin: 0;
}
.article-author .by {
color: var(--base-color-text-subtitle);
}
.article-metadata .date {
color: var(--base-color-text-subtitle-date);
}
.tag.active {
filter: saturate(0.75);
}
@media screen and (min-width: 900px) {
article .content {
width: 70%;
margin: auto;
}
}
@media (max-width: 900px) {
body {
background-color: var(--base-color);
}
article {
background-color: transparent;
box-shadow: none;
}
article img:first-child,
article video:first-child {
max-width: 100%;
}
}
</style>
<link rel="stylesheet" href="/assets/css/highlight.obsidian.min.css">
<div class="container">
<article class="padded">
<div class="content article-container">
<figure class="article-cover">
<img src="/storage/app/uploads/public/596/62b/1c4/59662b1c4ffa8859295653.png" title=""
alt=" " class="rounded-lg"
style="width: 100%; height: auto" />
</figure>
<div class="article-info">
<h1>
Beta release for Python support
</h1>
<div class="article-metadata">
<div class="article-author">
<span>By: </span>
<img class="avatar" width="25" height="25" src="/assets/images/authors/akien.jpg" alt="Rémi Verschelde" loading="lazy">
<span class="by">Rémi Verschelde</span>
</div>
<span class="date"> 12 July 2017</span>
</div>
<div class="tags">
<a href="/blog/news">
<div class="tag active">News</div>
</a>
</div>
</div>
<div class="card card-warning">
<p>
This article is from <strong>July 2017</strong>, some of its contents might be outdated and no longer accurate.<br>
You can find up-to-date information about the engine in the <a href="https://docs.godotengine.org/en/stable/">official documentation</a>.
</p>
</div>
<div class="article-body">
<p><em>This is a guest post by Emmanuel Leblond (touilleMan), a Godot contributor and Python lover who develops a GDNative interface to use Python 3 as alternative scripting language in Godot. To answer the obligatory question: yes, the plan is still to ship Godot 3.0 with GDScript, VisualScript and C# support. Python support should also be ready by then and usable plug n play thanks to GDNative; its main advantage compared to the Python-like GDScript will be the access to the whole Python ecosystem.</em></p>
<hr />
<p>Who said Godots only about waiting? Today we are releasing the <a href="https://github.com/touilleMan/godot-python">first beta version of Python for Godot</a>, the GDNative interface that enables you to use the full-blown Python 3 as a scripting language for Godot games. Now we need you to try it and give your feedback, so that it can be made as good as possible for the upcoming 3.0 release!</p>
<ul>
<li><a href="https://github.com/touilleMan/godot-python/releases/tag/v0.9.0">Release 0.9.0 page</a></li>
<li><a href="https://github.com/touilleMan/godot-python/releases/download/v0.9.0/godot-python-0.9.0.tar.bz2">Direct link to 0.9.0 linux binary release</a></li>
<li><a href="https://github.com/touilleMan/godot-python">Repository for Godot Python</a></li>
</ul>
<p>All core features of Godot are expected to work fine:</p>
<ul>
<li>Builtins (e.g. <code class="language-plaintext highlighter-rouge">Vector2</code>)</li>
<li>Object classes (e.g. <code class="language-plaintext highlighter-rouge">Node</code>)</li>
<li>Signals</li>
<li>Variable export</li>
<li>RPC synchronization</li>
</ul>
<p>On top of that, mixing GDScript and Python code inside a project should work fine, have a look at the <a href="https://github.com/touilleMan/godot-python/tree/master/examples/pong">Pong example</a> to see how you can convert one by one your existing GDScript code to Python fairly easily.</p>
<p>This release ships a recent build of Godot 3.0-alpha (yes, its a beta based on an alpha…) and CPython 3.6.1 with the standard library and pip, ready to work with the Python ecosystem in its full glory (cant wait to see people experimenting game AI with <a href="http://pytorch.org/">Pytorch</a>!).</p>
<p>The project is Linux-only so far, however you should be able to compile it from the sources if you are on macOS (let us know if you do so).
Binaries for all platforms will eventually be provided when Godot 3.0 gets stable.</p>
<p>As always, keep in mind this is a beta and you are expected to encounter issues and maybe crashes. If so, make sure to report them on the <a href="https://github.com/touilleMan/godot-python/issues">projects bug tracker</a> ;-)</p>
<p><strong>PS:</strong> A talk about Godot &amp; Python was given last Monday at <a href="https://ep2017.europython.eu/conference/talks/bringing-python-to-godot-game-engine">EuroPython 2017</a>. You can watch the (for now unedited) recording <a href="https://www.youtube.com/watch?v=h6MsqsJqnao&amp;feature=youtu.be&amp;t=2h35m09s">on YouTube</a>; the edited version should be available later on <a href="https://www.youtube.com/c/EuroPythonConference">EuroPythons YouTube channel</a>.</p>
</div>
</div>
</article>
</div>
<link rel="stylesheet" href="/assets/css/anchor-link.css?1">
<link rel="stylesheet" href="/assets/css/article-cards.css?2">
<script src="/assets/js/anchor-link.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
// Add icons to easily copy section links.
window.applyAnchorLinks('.article-body');
// Add lightbox elements in blog articles for Tobii.
document.querySelectorAll('.article-cover img, .article-body img').forEach((articleImg) => {
if (articleImg.classList.contains('lightbox-ignore')) {
return;
}
const lightbox = document.createElement('a');
lightbox.href = articleImg.src;
lightbox.classList.add('lightbox');
lightbox.dataset.group = 'article';
articleImg.parentNode.appendChild(lightbox);
lightbox.appendChild(articleImg);
});
});
</script>
</main>
<footer>
<div class="container flex footer-container">
<div id="copyright">
<p>
© 2007-2023 Juan Linietsky, Ariel Manzur and <a
href="https://github.com/godotengine/godot/blob/master/AUTHORS.md" target="_blank"
rel="noopener">contributors</a>.<br>
Hosted by the <a href="https://godot.foundation/" target="_blank" rel="noopener">Godot Foundation</a>.<br>
Website <a href="https://github.com/godotengine/godot-website" target="_blank" rel="noopener">source code on GitHub</a>.
</p>
</div>
<div id="sitemap">
<ul class="sitemap-group">
<li><strong>Get Godot</strong></li>
<li><a href="/download/windows" class="set-os-download-url">Download</a></li>
<li><a href="https://editor.godotengine.org/releases/latest/">Web Editor</a></li>
<li>&nbsp;</li>
<li><strong>Public Relations</strong></li>
<li><a href="/blog">Blog</a></li>
<li><a href="/community">Communities and Events</a></li>
<li><a href="/press">Press Kit</a></li>
</ul>
<ul class="sitemap-group">
<li><strong>About Godot</strong></li>
<li><a href="/features">Features</a></li>
<li><a href="/showcase">Showcase</a></li>
<li><a href="/education">Education</a></li>
<li><a href="/license">License</a></li>
<li><a href="/code-of-conduct">Code of Conduct</a></li>
<li><a href="/privacy-policy">Privacy Policy</a></li>
<li><a href="https://fund.godotengine.org">Donate</a></li>
</ul>
<ul class="sitemap-group">
<li><strong>Project Team</strong></li>
<li><a href="/governance">Governance</a></li>
<li><a href="/teams">Teams</a></li>
<li>&nbsp;</li>
<li><strong>Extra Resources</strong></li>
<li><a href="/asset-library/asset">Asset Library</a></li>
<li><a href="https://docs.godotengine.org">Documentation</a></li>
<li><a href="https://github.com/godotengine">Code Repository</a></li>
</ul>
</div>
<div id="social" class="dark-desaturate">
<h4 class="text-right"><a href="/contact">Contact us</a></h4>
<div class="flex justify-space-between" style="gap: 3px;">
<a href="https://github.com/godotengine" target="_blank" rel="noopener">
<img src="/assets/footer/github_logo.svg" width="32" height="32" alt="GitHub">
</a>
<a href="https://mastodon.gamedev.place/@godotengine" target="_blank" rel="noopener">
<img src="/assets/footer/mastodon_logo.svg" width="32" height="32" alt="Mastodon">
</a>
<a href="https://twitter.com/godotengine" target="_blank" rel="noopener">
<img src="/assets/footer/twitter_logo.svg" width="32" height="32" alt="Twitter">
</a>
<a href="https://www.facebook.com/groups/godotengine/" target="_blank" rel="noopener">
<img src="/assets/footer/facebook_logo.svg" width="32" height="32" alt="Facebook">
</a>
<a href="https://www.reddit.com/r/godot" target="_blank" rel="noopener">
<!-- Zero-width space in the `alt` text to prevent content blockers from blocking the icon -->
<img src="/assets/footer/reddit_logo.svg" width="32" height="32" alt="Reddit">
</a>
<a href="/rss.xml" target="_blank" rel="noopener">
<!-- Icon is called `feed` instead of `rss` to prevent content blockers from blocking the icon -->
<img src="/assets/footer/feed_logo.svg" width="32" height="32" alt="RSS feed">
</a>
</div>
</div>
</div>
</footer>
<script defer src="/assets/js/tobii.min.js"></script>
<script defer src="/assets/js/highlight.min.js?1"></script>
<script defer src="/assets/js/highlight.gdscript.min.js?1"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
// This needs to be done on page load but also after page changes,
// in case a code block appears in an article.
document.querySelectorAll('pre code').forEach((block) => {
hljs.highlightBlock(block);
});
// Initialize lightbox.
new Tobii({
zoom: false,
});
// Update any download link to point to identified user's OS.
const links = document.querySelectorAll('.set-os-download-url');
for (let i = 0; i < links.length; i++) {
const link = links[i];
let link_slug = 'download';
if ('version' in link.dataset && link.dataset['version'] === '3') {
link_slug = 'download/3.x';
}
let link_platform = 'windows';
if (navigator.platform.indexOf('Mac') !== -1) {
link_platform = 'macos';
} else if (navigator.platform.indexOf('Linux') !== -1) {
link_platform = 'linux';
}
link.href = `/${link_slug}/${link_platform}`;
}
});
</script>
</body>
</html>