0

Can we use python inside html for web development.?

Just like we can use script tag for javascript or php tags.

9th Jan 2023, 9:00 AM
Mahesh Salve
Mahesh Salve - avatar
3 Answers
+ 2
Yes, it is possible to use Python in web development, although it is not as common as using languages such as JavaScript or PHP. One way to use Python in web development is by using a Python web framework such as Django or Flask. These frameworks provide libraries and tools that make it easier to build web applications using Python. They allow you to define the layout and functionality of your web application using Python code, and can generate HTML, CSS, and JavaScript on the fly to render the web page in a web browser. You can also use a server-side language such as Python to generate HTML, CSS, and JavaScript code that is then sent to the client's web browser. This can be done using a templating language, such as Jinja, which allows you to embed Python code in HTML files. It is not possible to include Python code directly in an HTML file in the same way that you can include JavaScript or PHP code. However, you can use the script element to include the output of a Python script in an HTML file.
9th Jan 2023, 9:16 AM
Jash Gro
Jash Gro - avatar
0
It's possible to run some Python codes directly from frontend web with a JavaScript library called Pyscript. https://code.sololearn.com/W975c25QxC8n/?ref=app https://code.sololearn.com/Wq4uq3d5Jv9U/?ref=app Read more https://pyscript.net/examples/
9th Jan 2023, 10:53 AM
CalviŐ˛
CalviŐ˛ - avatar