Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80973

Re: import graphics library; causes error

Path csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'subject:error': 0.03; '"this': 0.03; '16,': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'languages,': 0.04; 'subsequent': 0.05; 'everyone!': 0.07; 'importerror:': 0.07; 'plenty': 0.07; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'typed': 0.09; 'python': 0.11; 'def': 0.12; 'language.': 0.14; 'question.': 0.14; "'setuptools'": 0.16; '0),': 0.16; '640,': 0.16; 'backwards': 0.16; 'cmd': 0.16; 'identifiers': 0.16; 'main():': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:graphics': 0.16; 'subject:import': 0.16; 'subject:library': 0.16; 'appropriate': 0.16; 'language': 0.16; 'wrote:': 0.18; 'library': 0.18; 'module': 0.19; "skip:' 30": 0.19; 'starts': 0.20; 'foundation': 0.20; 'seems': 0.21; 'import': 0.22; '(in': 0.22; 'print': 0.22; 'install': 0.23; 'header:User- Agent:1': 0.23; 'of.': 0.24; 'script.': 0.24; 'sorry,': 0.24; 'initial': 0.24; 'versions': 0.24; 'skip:" 40': 0.26; 'this:': 0.26; 'web.': 0.26; 'downloaded': 0.26; 'header:X-Complaints- To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'code': 0.31; "skip:' 10": 0.31; 'too.': 0.31; 'libraries': 0.31; 'file': 0.32; 'there.': 0.32; 'critical': 0.32; 'run': 0.32; 'open': 0.33; '(most': 0.33; 'totally': 0.33; 'there,': 0.34; "can't": 0.35; 'there': 0.35; 'books,': 0.36; 'edge': 0.36; 'done': 0.36; 'thanks': 0.36; "i'll": 0.36; 'so,': 0.37; 'being': 0.38; 'window': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'recent': 0.39; 'bad': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'most': 0.60; 'strictly': 0.61; 'our': 0.64; 'interest': 0.64; 'different': 0.65; 'taking': 0.65; 'charset:windows-1252': 0.65; 'life': 0.66; 'introduction': 0.68; 'business': 0.70; '(always': 0.84; 'serious.': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: import graphics library; causes error
Date Mon, 17 Nov 2014 12:14:51 +0000
References <acf29cb8-d11b-4134-8d03-7be5a078eae6@googlegroups.com> <0925b45d-aa27-472c-af81-f1594ee17ead@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-78-147-20-109.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
In-Reply-To <0925b45d-aa27-472c-af81-f1594ee17ead@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15957.1416226510.18130.python-list@python.org> (permalink)
Lines 70
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1416226510 news.xs4all.nl 2941 [2001:888:2000:d::a6]:47477
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:80973

Show key headers only | View raw


On 17/11/2014 03:03, ryguy7272 wrote:
> On Sunday, November 16, 2014 3:39:45 PM UTC-5, ryguy7272 wrote:
>> These libraries drive me totally nuts.  Sorry, just had to get it out there.
>> Anyway, I open the cmd window, and typed this: 'easy_install python graphics'.  So, it starts up and runs/downloads the appropriate library from the web.  I get confirmation (in the cmd window) that it finishes, then I try to run this script.
>>
>>
>> # futval_graph2.py
>> from graphics import *
>> def main():
>>    # Introduction
>>    print "This program plots the growth of a 10-year investment."
>>    # Get principal and interest rate
>>    principal = input("Enter the initial principal: ")
>>    apr = input("Enter the annualized interest rate: ")
>>    # Create a graphics window with labels on left edge
>>    win = GraphWin("Investment Growth Chart", 640, 480)
>>    win.setBackground("white")
>>    win.setCoords(-1.75,-200, 11.5, 10400)
>>    Text(Point(-1, 0), '0.0K').draw(win)
>>    Text(Point(-1, 2500), '2.5K').draw(win)
>>    Text(Point(-1, 5000), '5.0K').draw(win)
>>    Text(Point(-1, 7500), '7.5k').draw(win)
>>    Text(Point(-1, 10000), '10.0K').draw(win)
>>    # Draw bar for initial principal
>>    bar = Rectangle(Point(0, 0), Point(1, principal))
>>    bar.setFill("green")
>>    bar.setWidth(2)
>>    bar.draw(win)
>>    # Draw a bar for each subsequent year
>>    for year in range(1, 11):
>>      principal = principal * (1 + apr)
>>      bar = Rectangle(Point(year, 0), Point(year+1, principal))
>>      bar.setFill("green")
>>      bar.setWidth(2)
>>      bar.draw(win)
>>    raw_input("Press <Enter> to quit.")
>>
>>
>> After I hit F5, I get this:
>> Traceback (most recent call last):
>>    File "C:\Users\Ryan\Desktop\Graphics_Test.py", line 2, in <module>
>>      from graphics import *
>> ImportError: No module named graphics
>
>
>
> In what directory?
> Well, that's a damn good question.  I thought, by defailt, everything was downloaded to this folder:
> 'C:\Python27\Lib\site-packages'
>
> In there, I have all kinds of things like:
> 'setuptools-6.1.dist-info', 'pip-1.5.6.dist-info', etc.
> All kinds of other things too.
>
> It seems there is always a copy, so I cut/paste the folders named 'setuptools' & 'pip' (always taking off the versions and identifiers and the like...).  Then I cut/paste everything into this folder:
> 'C:\Python27\Lib'
>
> Is that how it's done or not?  Honestly, for the life of me, I don't know why a human being would have do do any of this, including using the cmd window, to install anything in 2014.  I can code in 10 different languages, not including Python.  Python is by far the most backwards type of technology that I can think of.  Using it is completely counter-productive.  I can't take it serious.  I have plenty of tools in my toolbox.  I'll keep learning Python, and keep reading books, and keep using it...but strictly for fun.  I would never use this as a foundation for a mission critical business application.
>
> Thanks everyone!
>

A bad workman always blames his tools.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

import graphics library; causes error ryguy7272 <ryanshuell@gmail.com> - 2014-11-16 12:39 -0800
  Re: import graphics library; causes error Terry Reedy <tjreedy@udel.edu> - 2014-11-16 18:09 -0500
  Re: import graphics library; causes error ryguy7272 <ryanshuell@gmail.com> - 2014-11-16 19:03 -0800
    Re: import graphics library; causes error Chris Angelico <rosuav@gmail.com> - 2014-11-17 14:11 +1100
    Re: import graphics library; causes error Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-17 21:24 +1100
    Re: import graphics library; causes error Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-17 12:14 +0000
    Re: import graphics library; causes error YBM <ybmess@nooos.fr.invalid> - 2014-11-17 13:21 +0100
  Re: import graphics library; causes error Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-17 00:35 -0700

csiph-web