Python Name Errors (Hydrogen)

#1

Hello.
I just downloaded Atom but have been using Python for a while now. I am pretty sure this code works (works on all other editors: pyzo, sublime, idle) but for some reason, I can’t seem to get Atom working. It keeps telling me that various names are not defined when they most certainly are. I am using Hydrogen and have attached an image of my Hydrogen Setting.
I have both python 2 and 3 on my laptop.

Error Message:

NameError Traceback (most recent call last)
in ()
----> 1 playTetris()

NameError: name ‘playTetris’ is not defined---------------------------------------------------------------------------
NameError Traceback (most recent call last)
in ()
----> 1 playTetris()

NameError: name ‘playTetris’ is not defined---------------------------------------------------------------------------
NameError Traceback (most recent call last)
in ()
----> 1 root.bind("", lambda event:
2 keyPressedWrapper(event, canvas, data))

NameError: name ‘root’ is not defined`

Thank you for your help! Really appreciate it!

#2

Hydrogen is a very different way to run code than typical file execution; were you using Hydrogen with these other editors?

#3

sorry, i should have said IDE instead of editor. (I’m a noob when it comes to actual computer science stuff)

#4

Either way, how were you running the program on the other IDE’s?

Was it by running the entire file at once, with something like a play button, or an interactive session like a Jupyter Notebook or the Python shell?

#5

I ran the entire file in the python shell.

#6

Hydrogen is very different to that; I suggest executing your scripts in a terminal, either external or one like termination, or setting up process-palette.

The script package will also run them, but does not work with the input function.