Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

ivanbark
ivanbark
3,896 Points

Checking the output of a Python script on a PHP website.

Hello,

I'm making a website in PHP for a schoolproject of mine. In this project I want to make a sort of Quiz about pieces of Python code, like the test you get when taking a course here on TeamTreehouse. I need my PHP website to do three things:

  1. The user needs to be able to type Python code in a on-page editor/IDE.
  2. The output from that Python script needs to be checked and I want to be able to use an If-function in PHP to tell the user if the output is correct.
  3. If something was wrong I need to be able to echo the output from the Python console with PHP onto the website. I know the basics of both these languages but this is something I can't figure out. Can someone help me?

Thanks in advance!

Ivan