ethanchewy / PythonBuddy

1st Online Python Editor With Live Syntax Checking and Execution
https://pythonbuddy.com
BSD 3-Clause "New" or "Revised" License
277 stars 84 forks source link

(hotfix/#34): Clear the output when the error is corrected. #35

Closed feat7 closed 5 years ago

feat7 commented 5 years ago

Fixes #34 Also shows 'Write code to see something!' message when the code is not written.

ethanchewy commented 5 years ago

Thanks for the pull request - I appreciate it.

Left a comment. Please let me know if you have any questions!

The main issue is that this check should be put during the AJAX check_code call not during the run_code and should check if the Editor is empty or if the error list is empty

feat7 commented 5 years ago

The real problem is not anywhere in the java script code. It is in the python code to run the code. When the input is empty, the stdin or stdout gives the previous input that is available there. ie. It doesn't flush previous stdin/stdout.

ethanchewy commented 5 years ago

Error fixed: https://github.com/ethanchewy/PythonBuddy/commit/43bd71a2db78757385f072e34b0660ddba0e71f3