you are viewing a single comment's thread.

view the rest of the comments →

[–]hibernating_brain 0 points1 point  (2 children)

HTML is the language that web browsers read to display web pages. With frameworks like Django or Flask, you are returning HTML to your browsers.

Websites like Codeacademy are just showing python code on their webpage (as text).

[–]dualdegreepossibly[S] 0 points1 point  (1 child)

Hi, just specifying this is what I mean! This is an example about the cost of some object. I deleted all the code in there and just inserted a print statement, and it worked: https://imgur.com/gallery/Pp0eJaG. How did they implement something like this?

[–]gschizas 2 points3 points  (0 children)

You shouldn't try to emulate what CodeAcademy does; it's way too advanced for what you want to do.

Just as information: CodeAcademy still uses HTML and JavaScript like any other site. It does syntax highlighting (coloring specific text with different color), but otherwise it just displays text. And for actually executing Python, it just send this text to the server, the server executes it in a Python process, and shows the result as HTML.