The python programming language can be used together with html

1

Can the python programming language be used together with html ?

If so, how do I make this junction between the two languages?   To my knowledge, to call a file js in hmtl we can do it in 2 ways, writing script inside html or calling an external file.   But I know that js is a web language, so we have a lot of support ... Since python does not, how can we do this join?

    
asked by anonymous 06.10.2018 / 13:34

1 answer

1

The answer is yes, but with caveats.

Python is a programming language like JavaScript. The difference is that browsers have JavaScript engines , as well as being able to interpret at least HTML and CSS.

Therefore, in the browsers we use today, there is no Python code interpreter or compiler.

The only way to write Python code to be run in the browser would be to have Python on the server side, doing server side rendering , generating HTML and CSS code.

Another way would be to write Python code to be transpiled (compiled + translated) to JavaScript. It's similar to what TypeScript does, but a bit more abusive. One project that does this today is the Skuplt . See example . It is a project that has received a lot of traction and has a lot of potential. It is very useful for generating graphics and the like.

    
06.10.2018 / 15:19