Title: Need walkthrough to allow user to enter text, run python code, return result
Last modified: August 15, 2017

---

# Need walkthrough to allow user to enter text, run python code, return result

 *  [astroben](https://wordpress.org/support/users/astroben/)
 * (@astroben)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/need-walkthrough-to-allow-user-to-enter-text-run-python-code-return-result/)
 * I’m a python programmer but a neophyte to php and a wysiwyg user of wordpress.
   I have a problem I need help with. I have a python code called text.py which 
   does some stuff to a line of text. In reality it is some complicated natural-
   language processing. For now, let’s say it returns input text in all caps. I 
   would like to make a wordpress page that has an input box where the user can 
   enter text, click a button, and that text will be sent to the python code, the
   results of which will be shown back on that page underneath.
 * For kicks, here is a sample python code text.py:
 *  `import sys
    if __name__ == “__main__”: print ” “.join(sys.argv[1:]).upper()
 *  >>>python text.py “hello there world”
    HELLO THERE WORLD`
 * Looking around the web, I haven’t found any comprehensive “here is what you do”
   from start to finish. I think this could be REALLY useful for other people trying
   to do similar things.
 * I have python running on my web server, so that part is taken care of. I could
   use a step by step tutorial of how to:
 * 1. create the page with a box to enter text and a button to run the code.
    2.
   interface to send that text to the python code and run it 3. way to print the
   output on the wordpress page.

Viewing 1 replies (of 1 total)

 *  [chrispink](https://wordpress.org/support/users/chrispink/)
 * (@chrispink)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/need-walkthrough-to-allow-user-to-enter-text-run-python-code-return-result/#post-9412627)
 * This ?
 * [https://stackoverflow.com/questions/166944/calling-python-in-php](https://stackoverflow.com/questions/166944/calling-python-in-php)

Viewing 1 replies (of 1 total)

The topic ‘Need walkthrough to allow user to enter text, run python code, return
result’ is closed to new replies.

## Tags

 * [python](https://wordpress.org/support/topic-tag/python/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [chrispink](https://wordpress.org/support/users/chrispink/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/need-walkthrough-to-allow-user-to-enter-text-run-python-code-return-result/#post-9412627)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
