Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Python objects

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

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()

Name: Anonymous 2010-10-30 19:29

It might be obvious to you that I can't call a method and assign to the object I'm calling the method on but I don't code much so this is the sort of thing I'm trying to figure out, why else would I make a program like this?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List