如何在html标记中调用python函数
我已经创建了一个函数来提取pdf文本,但我无法在html页面上显示输出。 在html文件中- 文件名=userInput.html如何在html标记中调用python函数,html,python-3.x,django-templates,Html,Python 3.x,Django Templates,我已经创建了一个函数来提取pdf文本,但我无法在html页面上显示输出。 在html文件中- 文件名=userInput.html <form action=""> <label for="usr">Select PDF File:</label> <input type="file" id="PDFupload"> <input type="
<form action="">
<label for="usr">Select PDF File:</label>
<input type="file" id="PDFupload">
<input type="submit" id='file_submit'>
</form>
<label>Extracted Data From Selected PDF File</label>
<input type="text" placeholder="Text Data of PDF">
现在我想在html页面上显示输出文本,其中placeholder=“PDF的文本数据”
我试着用
#!c:\Program Files\Python39\python.exe
def pdf_on_html():
import PyPDF2
a = PyPDF2.PdfFileReader('select file from html page where id="PDFupload"')
print(a.getPage(0).extractText())
pdf_on_html()