Can i code browser games in python in my website

Question:

I am not much into gaming but i am learning and doing some practicles in Artifical Intelligence algorithms. Now as i can develop full fledge application so it means even if learn various techniques , i won’t be having anything to show in interview.

I have seen that all AI techniques / algorithms are usually tested as simulation.
i saw one video from google where they showed their AI techniques in small games wherevery small characters were showing /doing things based on their learning. So i think by implementing them in small games , i can demonstrate what i have learned so that i can have small preactical applicatin.

But i want that on a website , so i want to know whats the best way to have simulations /games inside browser

Asked By: Mirage

||

Answers:

Games running in the browser are usually developed in either Javascript or Flash. If you’re specifically interested in Python for this task, take a look at Pyjamas:

Pyjamas is a Rich Internet Application (RIA) Development Platform for
both Web and Desktop.

It contains a Python-to-Javascript compiler, an AJAX framework and a
Widget Set API. Pyjamas started life as a Python port of Google Web
Toolkit, the Java-to-Javascript compiler. Read the FAQ and the list of
features.

Answered By: Eli Bendersky

As far as I know it is not possible to execute python scripts in the browser. What you can do is generate the set of actions to be taken on the server side using python and then send these commands to the browser and interpret them in javascript. Or if you don’t want a server side, you can just write the game in actionscript, silverlight or javascript/html5.

Answered By: Anand Nalya

Today, i’d recommand using pygbag https://pypi.org/project/pygbag/ from https://pygame-web.github.io. It uses the same principles applied to pygame from Panda3D webgl port ( not the old plugin) using Web Assembly for modern browsers.

Answered By: Pmp P.