+ 3

Can I apply python in HTML and How?

Can Python help html

7th Oct 2019, 11:02 PM
Anthony Kwesi Saah
Anthony Kwesi Saah - avatar
10 Answers
+ 10
AJ/AY apart from back end development, python can be used in the web code though you'll have to separate the codes using special tags(<% %>) Let's say you want to print the current date, you'll have to mix the two codes; <% import datetime print datetime.date.today().strftime("%d:%m:%y") %> When you run this code in the browser, You'll notice that the code inside the <% and %> tags is ordinary Python code, in which you can import modules, create and instanciate classes, use variables, read or write to the file system, etc.
7th Oct 2019, 11:44 PM
Jella
Jella - avatar
+ 2
No you can't apply python in HTML because python is programming language which is used in back-end and HTML is a markup language which is used as frontend which displays data on browser.
7th Oct 2019, 11:14 PM
A͢J
A͢J - avatar
+ 2
You can make some small codes like addition of 3 number, find the odd and even numbers between 1 and 10 or between 20 and 30 etc.
7th Oct 2019, 11:22 PM
A͢J
A͢J - avatar
+ 1
Thanks
7th Oct 2019, 11:15 PM
Anthony Kwesi Saah
Anthony Kwesi Saah - avatar
+ 1
Welcome
7th Oct 2019, 11:24 PM
A͢J
A͢J - avatar
+ 1
Yes, you can
9th Oct 2019, 12:55 AM
ALVIN INDRAWAN
ALVIN INDRAWAN - avatar
+ 1
There is Jinja2 and django template that can be used for the template engine, it is a modeling language that interacts between the html template and the Python code
13th Oct 2019, 7:48 PM
Harimamy Ravalohery
Harimamy Ravalohery - avatar
+ 1
It is possible to use python instead of javascript in HTML. This is possible using Brython. I've actually not tried it and a friend recommended it. Kindly look it up
18th Oct 2020, 12:13 PM
Anthony Kwesi Saah
Anthony Kwesi Saah - avatar
0
Yes, because python is also use in web development some time but it is not safe
8th Oct 2019, 10:39 AM
Pushpendra Singh
Pushpendra Singh - avatar