This tool lets you run Python code in your browser using Pyodide, with extra handling for Python's print
, input()
and time.sleep()
using JavaScript equivalents.
In error messages you may see one line numbering excceds by one because behind the scene it adds one line import js, asyncio
You can see the parsed code in console if you want!
print
→ js.print
input
→ await js.input
time.sleep
→ await asyncio.sleep
async
to def
if the function calls an awaitable input()
or time.sleep()
await
.await
may not be detected properly."\'"
and "'"
because both are stored as "'"
upper()
on input()
which is a PyodideFuture object so it might show errors like AttributeError: 'PyodideFuture' object has no attribute 'upper'
def
i.e., don't do this: def f(a,b):return a+b
`"back"'ticks'`
or use "different 'quotes'"
for 'string and "inside quotes"'
input
like normal — async is added automatically.time.sleep()
instead of sleep()
to ensure correct replacement.input()
to do something like input().upper()
do this instead (input()).upper()
this will let input()
resolve 1st then will apply your functions to the value _
at the end for example:transmitError_