The python programming language can be used together with html

Asked

Viewed 5,594 times

1

The programming language python can be used together with html?

If so, how do I merge the two languages? In my knowledge, to call a file js in hmtl we can do it in 2 ways, by writing the script within the html or calling an external file. But I know that js is a web language, so we have a whole support... Ja python no, how can we make this junction?

  • Only if you use Python on back-end. But if you want to use on front-end, it is not possible not to.

1 answer

1


The answer is yes, but with reservations.

Python is a programming language like Javascript. The difference is that browsers have javascript engines, and can 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 run in the browser would be to have Python on the server side, doing server side Rendering, i.e., generating HTML and CSS code.

Another way would be to write Python code to be transposed (compiled + translated) into Javascript. It’s similar to what Typescript does, but a bit more abusive. A project that does this today is the Skuplt. See a example. It is a project that has been receiving a lot of traction and has a lot of potential. It is very useful for generating graphics and things like.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.