0

Can we code python or import a .py to a HTML or JavaScript

27th Jul 2020, 9:08 PM
Alan Progg
Alan Progg - avatar
5 Answers
+ 2
I'm not sure what exactly you want to do. You can use Python instead of Javascript, together with HTML and CSS. Check out Brython for that.
27th Jul 2020, 10:11 PM
HonFu
HonFu - avatar
+ 2
Then you can check it out. Brython gets translated to Javascript, and while it's probably still better to write in Javascript in the first place then, it can still be a good opportunity to put your knowledge to use right now, combining the three languages you know. I have written this chess board in Brython: https://code.sololearn.com/W5v76nCjupV7/?ref=app My Javascript is worse than my Python, and so I felt, the task could be too hard if I do it in JS. The price is it is rather slow... but better slow than non-existent. ;-) If you look at the Javascript tab, you'll see that it's basically all Python, with a few Brython specifics needed to communicate with the HTML and CSS parts.
27th Jul 2020, 10:52 PM
HonFu
HonFu - avatar
+ 1
You can use a Flask framework
27th Jul 2020, 9:11 PM
Kvasniak Kateryna
Kvasniak Kateryna - avatar
+ 1
HonFu thank you i don't know JavaScript but i know python, html, css
27th Jul 2020, 10:25 PM
Alan Progg
Alan Progg - avatar
0
Catherine thank you😊
27th Jul 2020, 9:12 PM
Alan Progg
Alan Progg - avatar