Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 31st, 2013, 01:44 AM
basoon27 basoon27 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 1 basoon27 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 38 sec
Reputation Power: 0
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.

Code:
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)
    picture.start()

testRing()

 


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.

Reply With Quote
  #2  
Old January 31st, 2013, 10:36 AM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,354 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 8 h 21 m 53 sec
Reputation Power: 383
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!

Reply With Quote
  #3  
Old January 31st, 2013, 11:40 AM
SuperOscar SuperOscar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Location: Joensuu, Finland
Posts: 403 SuperOscar User rank is Second Lieutenant (5000 - 10000 Reputation Level)SuperOscar User rank is Second Lieutenant (5000 - 10000 Reputation Level)SuperOscar User rank is Second Lieutenant (5000 - 10000 Reputation Level)SuperOscar User rank is Second Lieutenant (5000 - 10000 Reputation Level)SuperOscar User rank is Second Lieutenant (5000 - 10000 Reputation Level)SuperOscar User rank is Second Lieutenant (5000 - 10000 Reputation Level)SuperOscar User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 4 h 56 m 16 sec
Reputation Power: 65
Quote:
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 who’s quite possibly basoon27’s 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: openSUSE 12.3 (home desktop, laptop, work desktop), Ubuntu 12.04 LTS (mini laptop), Debian GNU/Linux 7.0 (server), Mythbuntu 12.04 LTS (HTPC), Bodhi Linux 2.0 & Windows 7 Ultimate (test desktop), FreeBSD 9.1 (test server)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > New to Python - "picture is not defined" error

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap