0

I am using ACE to allow people to code freely on my website. How would I run this code. I would like a run button in the bottom left corner (I can do that in css), but how would I run it, as it is python. I have added extra tags, as you can write these languages in the ace editor. When I mean, a run button, I mean like on codecademy, where you write some code, then it is submitted.

1
  • @GhostAnswer I have googled Dec 7, 2013 at 11:34

1 Answer 1

0

You could possibly make a temporary file in your system, and in an iframe, open the file.


Important Note This could be insecure as they could get the URL and execute code to delete ../../../ or something, which could harm your files.

4
  • thanks. Is there are more secure way? I know that codecxademy and programmr have something like this Dec 7, 2013 at 15:22
  • You could always filter out the functions that could possibly lead to attacks. CodeCademy usually just check if it has the correct output by analyzing the code, they don't execute it for real as far as I know. :) Dec 7, 2013 at 15:24
  • So they would literally just have an if loop to check the contents of the editor? Dec 8, 2013 at 11:42
  • Most likely. Don't quote me on it though. Dec 8, 2013 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.