Skip to content

Instantly share code, notes, and snippets.

@Demontager
Created August 8, 2014 13:07
Show Gist options
  • Save Demontager/5426741ce6cb60b1d14f to your computer and use it in GitHub Desktop.
Save Demontager/5426741ce6cb60b1d14f to your computer and use it in GitHub Desktop.
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