Name: Anonymous 2010-10-30 18:53
Why is oStarSpeck[i] not a point object and instead is
<class 'NoneType'>
<class 'NoneType'>
<class 'NoneType'>
<class 'NoneType'>
info about graphics.py
http://mcsp.wartburg.edu/zelle/python/graphics/graphics/index.html
<class 'NoneType'>
<class 'NoneType'>
<class 'NoneType'>
<class 'NoneType'>
info about graphics.py
http://mcsp.wartburg.edu/zelle/python/graphics/graphics/index.html
from graphics import *
import random
WINDOW_SIZE = 300
NUMBER_OF_STARS = 100
oStarSpeck = [Point(0, 0) for _ in range(NUMBER_OF_STARS)]
def main():
formMain = GraphWin("stars", WINDOW_SIZE, WINDOW_SIZE)
for i in range(NUMBER_OF_STARS):
oStarSpeck[i] = Point(random.randint(1, WINDOW_SIZE), random.randint(1,WINDOW_SIZE)).draw(formMain)
print(type(oStarSpeck[i]))
iStarCount = NUMBER_OF_STARS
while (iStarCount > 5):
print(type(oStarSpeck[random.randint(0, NUMBER_OF_STARS)]))
formMain.getMouse()
main()