futurecoder icon indicating copy to clipboard operation
futurecoder copied to clipboard

Python Tutor button causes an error message.

Open asweigart opened this issue 3 years ago • 4 comments

When I click on the Just Code button from the home page and get sent to the in-browser editor, I then click on the green Python Tutor button and I am sent to https://pythontutor.com/iframe-embed.html#code=&codeDivHeight=600&codeDivWidth=600&cumulative=false&curInstr=0&heapPrimitives=false&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false and get the alert "ERROR! no code or langauge specified in iframe embed URL string"

(I'm using English on the futurecoder.io site.)

asweigart avatar Feb 05 '23 17:02 asweigart

Thanks for the report! I didn't know about this.

Fortunately, the Python Tutor button is still working, it's just that your editor was empty. It works when there's some code.

But this is still a bug worth fixing, because every other method of running correctly does nothing when given empty code.

alexmojaki avatar Feb 05 '23 17:02 alexmojaki

Which of these are the current source of pythontutor.com? Looks like PRs but no Issues these days

  • https://github.com/cmattey/OnlinePythonTutor/tree/master/v5-unity
  • https://github.com/pathrise-eng/pathrise-python-tutor

.

  • [ ] futurecoder: raise an error ui element when code==""
  • [ ] onlinepythontutor: present an error when code=""
    • @cmattey

westurner avatar Apr 02 '23 00:04 westurner

I've tried finding the source before as well. I think it's private now.

This isn't a bug that needs fixing in pythontutor, they give a clear error message about missing code. futurecoder just needs to check if the code is empty before opening pythontutor.

alexmojaki avatar Apr 02 '23 10:04 alexmojaki

I think it's both: onlinepythontutor should handle code="" with a precondition check, and futurecoder should not send GET requests where ?code=""

westurner avatar Apr 02 '23 14:04 westurner