1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Rep Power

    New to Python - "picture is not defined" error

    I just started learning Python a few weeks ago so I'm guessing there's something very simple here that I'm missing. I'm trying to draw a ring (circle with white circle over it). I'm using an external python file called stddraw to make the shapes and what not.

    from stddraw import *
    def ring(picture, x, y, radius, width, color):
            picture.filledCircle(x, y, radius, color)
            picture.filledCircle(x, y, radius - width, 'white')
    def testRing():
        picture = Picture()
        color = picture.randomColor()
        ring(picture, .5, .5, .3, .2, color)
    My professor is using the testRing function to see if it works, which it does. However, when I try to run the function using my own parameters, it returns this error "picture is not defined". It's been driving me crazy; thanks in advance. Apologies if this doesn't belong here-new to the site.
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Rep Power
    Your question is reasonable, this forum is good.

    Since I know nothing at all about stddraw I cannot answer your question.

    Nor did you post the error message verbatim. You're new to python and might be insensitive to python case sensitivity. When you write "picture is not defined" I suspect you actually mean "Picture is not defined."

    We need to know how to find stddraw.
    We need to see the whole error message.

    Or I may have overlooked something.
    Most likely you don't have stddraw installed on your computer.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2007
    Joensuu, Finland
    Rep Power
    Originally Posted by b49P23TIvg
    We need to know how to find stddraw.
    A brief googling seems to indicate stddraw is a private teaching (?) project of someone whos quite possibly basoon27s professor. A (TeX-made) document can be publicly found but not the module itself.

    Comments on this post

    • Dietrich agrees : could be Tkinter based
    My armada: Debian GNU/Linux 8 (desktop, home laptop, work laptop), Raspbian GNU/Linux 8 (nameserver), Ubuntu 14.04.3 LTS (HTPC), PC-BSD 10.2 (testbed), Android 4.2.1 (tablet)

IMN logo majestic logo threadwatch logo seochat tools logo