I have some Python code that I would like to integrate into a webpage. I have absolutely no idea how to do this. It can't be done by pasting into HTML like PHP. What is the easiest way it could be done? I have heard of things like Django but my efforts in getting that to work have been futile.
Here are some of the things I need to be able to do:
- Read the input from an HTML input box
- Process the input
- Search a text file
Here is an example of the Python code I'm running on my computer that I want to transfer to the web:
This is the code that will perform a binary search on a text file
with io.open('final.txt', encoding='latin-1') as myfile:
data = myfile.readlines()
low = 0
high = (len(data)-1)
while (low <= high) and not Found:
mid = int((low+high)/2)
if data[mid].rstrip() == Password:
Found = True
break
elif Password < str(data[mid]):
high = mid - 1
elif Password > str(data[mid]):
low = mid + 1
Basically, the idea is this: I have been developing an app that will assess a password's strength. I have written the app in Python. What I want to do now is integrate it into a MyBB registration page so that it can do this assessment on someone's inputted password during the registration process.
Can someone please point in the right direction with concise, clean instructions to do this?
Aucun commentaire:
Enregistrer un commentaire