How to call py function in html | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to call py function in html

I want to call a python function OR py script in html to use it.

24th Apr 2021, 2:11 AM
Harshit Prajapat
Harshit Prajapat - avatar
5 Answers
+ 1
If you program your python script to work as a cgi, you might get it to work if your website host allows cgi.
24th Apr 2021, 2:19 AM
Jerry Hobby
Jerry Hobby - avatar
+ 1
On a webserver, you can our executables in the cgi-bin folder. Some hosts don’t allow that. A cgi script needs to output value html to display correctly. If your python script is setup correctly, you can make this work. There’s just a few steps involved.
24th Apr 2021, 2:30 AM
Jerry Hobby
Jerry Hobby - avatar
0
I am new in this and learning. I am using xamp server, vscode, and python. I have created one function to extract pdf text by using PyPDF2 in python but i am getting output in terminal only. I want to display this text on html page. Thanks
24th Apr 2021, 2:23 AM
Harshit Prajapat
Harshit Prajapat - avatar
0
Ok i will check and get back to you with new updates. Thanks a lot for this guidance.я
24th Apr 2021, 2:39 AM
Harshit Prajapat
Harshit Prajapat - avatar
0
I am able to print hello world in H1 tag which i have written in .py file and opening in chrome but still my function is not calling. What should I do.
24th Apr 2021, 3:55 AM
Harshit Prajapat
Harshit Prajapat - avatar