Videos
I wanted to make a python code editor like this: https://www.programiz.com/python-programming/online-compiler/
So, I made a the text editor using https://codemirror.net/ and used piston for executing the code. but piston requires pre-defined input to run the code. so i wanted to mimick the terminal experience for running python code, taking input dynamically (which won't work with piston). here's what I've tried so far:
-
extracting lines with
input()and replicating the functionality in js. this works for simple cases, but it will break down for inputs within loops or conditionals. -
converting py code to js using https://pyodide.org/ but, it converts
input()statements into prompts, which isn't ideal.
I've searched around, but haven't found a good solution yet. I did find this article on building online compilers, but it seems more complex: https://www.programiz.com/blog/online-python-compiler-engineering/
Any ideas on how to do this in a simpler way? anything works like using flask or django
When you assign 7.0 to both integer variable and float variable they return true and execute first line of print statement but further any addition of decimal points executes else condition