Jump to content

Recommended Posts

Posted

OK everyone, Just need a hand here.

 

I want to allow our students to use Python3 through a web interface for a couple of weeks until I can get a full VDI solution in for a virtual ICT lab. I have simple ESXi host which I can deliver it all through, but I do not know how to get it working.

 

I would like to deliver something like this, Execute Python3 Script Online but no need to download files.

 

I am really bad with LAMP servers and kind of require a step by step guide on how to make it work.

 

Thank you all in advance

Posted

I imagine you will need to combine several technologies to achieve this.

 

Take a look at jQuery, a javascript library which simplifies interactive website development. More specifically look at the AJAX function - This allows you to send data to and from the server without reloading the page.

jQuery

jQuery.ajax() | jQuery API Documentation

 

You will need to use HTML and CSS to provide syntax highlighting for the online code editor. I believe there will be some existing CSS to format/highlight Python code

 

If you already have a LAMP server in place then this simplifies things, I initially found it quite hard getting my web server to run Python code as CGI so using PHP to run the Python script should make things easier.

 

Using jQuery/AJAX as mentioned above you will pass the contents of the "code editor (text area)" to a PHP script which will execute the Python code and return the output back to the website using jQuery. The PHP command I believe is popen - PHP: popen - Manual

 

 

I have been looking at creating something similar so if I get a proof of concept working I will post it here.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...