cherrypy text box form to variable

292 views
Skip to first unread message

Scott Samra

unread,
Jun 12, 2014, 10:49:10 AM6/12/14
to cherryp...@googlegroups.com
Hello,

I have a simple python script that takes raw user input and puts the responses into variables.  It then takes the variables and does a simple find/replace on a text file.  I would like to have this web based as opposed to running the python app from the desktop.  I am new to python and cherrypy, can someone please point me in the right direction or show me an example?

I would like a simple web form with text boxes and a submit button.  When the user types the info in and hits "submit" I would like the variables sent to the python script for processing.

Any assistance will be appreciated.

Thank you,

Scott

Stefan Krüger

unread,
Jun 16, 2014, 3:30:41 AM6/16/14
to cherryp...@googlegroups.com

Hi Scott,

for your forms look at:
http://www.w3schools.com/html/html_forms.asp
or for the newer HTML5 Elements:
http://www.w3schools.com/html/html5_form_input_types.asp
for this it is the easiest to just have a static website.

look at the tutorials at
http://cherrypy.readthedocs.org/en/latest/tutorials.html#tutorials

there is also an example (http://cherrypy.readthedocs.org/en/latest/tutorials.html#tutorial-4-submit-this-form) with an form submit...

if you have some special questions i will help if i can :-)

sunny greetings
stefan
Reply all
Reply to author
Forward
0 new messages