Attribute error in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Attribute error in python

AttributeError: 'NoneType' object has no attribute 'fileno' this happens when i run a snakes game source code...i am using windows 8

24th Jul 2017, 3:48 AM
CadCube 360
CadCube 360 - avatar
2 Answers
+ 1
no code. let me guess. The object on which you are looking up the attribute turns out to be a None and you have no clue why. Perhaps your code is too long to read here. Start with print calls. Print anything you suspect is making your object a None. Also, learn to use PDB. Logging is a good idea too. In fact you can use logging instead if print calls.
24th Jul 2017, 4:20 AM
Venkatesh Pitta
Venkatesh Pitta - avatar
0
the print call shows the error at the first line of the program after import random and curses. i think the curses that i have installed is not compatible with Windows 8
24th Jul 2017, 8:09 AM
CadCube 360
CadCube 360 - avatar