DEV Community

vicrost
vicrost

Posted on

2

Can I run a python program on my website?

I just joined the dev.to community a couple of days ago and was wondering what I should write about as my first post. This question has been bugging me for a while now so I thought this might be a good way to get answers.

So say I created a game using python and I want users on my website to play my game online. Is there a way to implement this or will I have to recreate the game using a web programming language like JavaScript.

Thank You In Advance

Top comments (3)

Collapse
 
lschultebraucks profile image
Lasse Schultebraucks

The are different approaches to this challenge.

I would suggest you to check out following post

They describe opportunities to transpile your python code to javascript or they give your an opportunity for a python runtime on the browser. You have to decide which way works best for you.

Collapse
 
vicrost profile image
vicrost

Thank you. From what I read , I personally think I should just continue learning JavaScript. Its definitely worth learning and so far, not too difficult.

Collapse
 
lschultebraucks profile image
Lasse Schultebraucks

Re-Implementing your program would be definitely a good exercise.
Maybe you can create the backend with django or another python backend framework if you like. Or you just build the whole application in JS with a backend framework like Express or Next.JS

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay