Created
August 8, 2014 13:07
-
-
Save Demontager/5426741ce6cb60b1d14f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bottle import route, run, template, post, request | |
@route('/') | |
def index(): | |
return template(''' | |
<form name="form1" method="post" action="/write"> | |
Enter password: <input type="text" name="pass"><br> | |
<input type="submit" name="Submit" value="Sign Up"> </form> | |
''') | |
@post('/write') | |
def write(): | |
file_pass = open('password.txt', 'a') | |
file_pass.write(request.forms.get('pass') + '\n') | |
file_pass.close() | |
return 'ok' | |
run(host='localhost', port=8080) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment