main loop ‘builtin_function_or_method’ object is not iterable

Direct Answer In the code here: change sourceCode.split to sourceCode.split(). If you want to know more about this error, read below: When debugging, you’d better remove the try…except block, especially an “expect Exception” block, which is so generic that you will get lost about what is going wrong. When removed the try…except block and run these code again, … Read more

ImportError: Cannot import name X

I have four different files named: main.py, vector.py, entity.py and physics.py. I will not post all the code, just the imports, because I think that’s where the error is (If you want, I can post more). main.py: entity.py: vector.py: physics.py: I then run from main.py and I get the following error: I’m guessing that the error is due to importing entity twice, … Read more

OSError: [Errno 8] Exec format error

I am having hard time parsing the arguments to subprocess.Popen. I am trying to execute a script on my Unix server. The script syntax when running on shell prompt is as follows: /usr/local/bin/script hostname = <hostname> -p LONGLIST. No matter how I try, the script is not running inside subprocess.Popen The space before and after “=” … Read more

pygame.error: video system not initialized

You haven’t called pygame.init() anywhere. See the basic Intro tutorial, or the specific Import and Initialize tutorial, which explains: Before you can do much with pygame, you will need to initialize it. The most common way to do this is just make one call. This will attempt to initialize all the pygame modules for you. Not all pygame modules need … Read more

What do the symbol “=” and “==” mean in python?

When should i use the symbol ‘==’ and when only the symbol ‘=’ is enough? What does the symbol ‘==’ mean in python? I started python coding 2 weeks ago and these two symbols confused me sometimes. Several times when i used ‘=’, i would get an error message. After i changed it to ‘==’, … Read more

Running Python from Atom

The script package does exactly what you’re looking for: https://atom.io/packages/script The package’s documentation also contains the key mappings, which you can easily customize.