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


Groups > comp.lang.python > #36648

Re: Problem with importing in Python

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <sadzak@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'importerror:': 0.05; 'main()': 0.07; 'problem?': 0.07; 'python': 0.09; 'def': 0.10; 'advance.': 0.15; 'to:name:python-list': 0.15; '"is"': 0.16; '#create': 0.16; '1):': 0.16; 'main():': 0.16; 'subject:Problem': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'math': 0.20; 'email addr:gmail.com&gt;': 0.20; 'trying': 0.21; 'import': 0.21; 'to:2**1': 0.23; 'header:In-Reply-To:1': 0.25; 'message- id:@mail.gmail.com': 0.27; 'url:mailman': 0.29; 'skip:_ 10': 0.29; 'skip:& 10': 0.29; 'class': 0.29; "i'm": 0.29; 'function': 0.30; 'url:python': 0.32; 'file': 0.32; 'url:listinfo': 0.32; '11,': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'same.': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'url:org': 0.36; 'subject:with': 0.36; 'keeps': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'solve': 0.62; 'here': 0.65; 'circle': 0.65; '100': 0.78; '2013': 0.84; 'saying:': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=PfM0uGB4aXztnUwRzbYX47INBchMpbSrWnfo/GNtIks=; b=bA7wAWRHkPY/MV3GZG0lRwoZYgUBKQjbMG8SqPK8UC6zXUVwPexhunOSdvr9kJ/s3H dtmLTUsU51EWGRGPX7TlhZD9bZ1fKfKnCx5OjmcqKPeK8W5PhvH9jgYZsTc1kYtGVqHX IFt+vYBZMCWGuvVgos4QyE5jQAhLy/zIpEno9WyUD78SH3OfjJvX0n7zdWj5GPMcIp3U 3wHhixeevb4ReCUtsv5km6YftubmXUgw03Kt4Zlc6UtMjGKOlINv0Y1lcaqM0r1wInej fDj3GUskpGp9sZotNcfZmliZSy5opRopNSwEdn4JB8Knc4i8ILDlaKzbRlJoZR5H9Nkd AcdQ==
MIME-Version 1.0
In-Reply-To <1eb7cd76-ade3-4c34-8816-6eaa7201262e@googlegroups.com>
References <1eb7cd76-ade3-4c34-8816-6eaa7201262e@googlegroups.com>
Date Fri, 11 Jan 2013 23:25:24 +0100
Subject Re: Problem with importing in Python
From Adnan Sadzak <sadzak@gmail.com>
To su29090 <129km09@gmail.com>, python-list <python-list@python.org>
Content-Type multipart/alternative; boundary=047d7b66f5158e956704d30ac514
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.415.1357943131.2939.python-list@python.org> (permalink)
Lines 143
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357943131 news.xs4all.nl 6990 [2001:888:2000:d::a6]:46828
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36648

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Python is case sensitive.
Circle and circle is not same.




/* sent from android */
On Jan 11, 2013 11:22 PM, "su29090" <129km09@gmail.com> wrote:

> I'm trying to import a python file it keeps saying:
>
> ImportError: cannot import name Circle
>
> Here is the file I'm trying to import:
>
> Circle.py
>
> import math
>
> class circle:
>     #Construct a circle object
>     def __init__(self, radius = 1):
>         self.radius = radius
>
>     def getPerimeter(self):
>         return 2 * self.radius * math.pi
>
>     def getArea(self):
>         return self.radius * self.radius * math.pi
>
>     def setRadius(self, radius):
>         self.radius = radius
>
> from Circle import Circle
>
> def main():
>     #Create a circle with a radius 1
>     circle1 = Circle()
>     print("The area of the circle of radius",
>           circle1.radius, "is" , circle1.getArea())
>
>     #Create a circle with a radius 25
>     circle2 = Circle(25)
>     print("The area of the circle of radius",
>           circle2.radius, "is" , circle2.getArea())
>
>     #Create a circle with a radius 125
>     circle3 = Circle(125)
>     print("The area of the circle of radius",
>           circle3.radius, "is" , circle3.getArea())
>
>     #Modify circle radius
>     circle2.radius = 100 # or Circle2.setRadius(100)
>     print("The area of the circle of radius",
>           circle2.radius, "is" , circle2.getArea())
>
>     main() # Call the main function
>
> How can I solve this problem?
>
> Thanks in advance.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

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


Thread

Problem with importing in Python su29090 <129km09@gmail.com> - 2013-01-11 14:17 -0800
  Re: Problem with importing in Python Adnan Sadzak <sadzak@gmail.com> - 2013-01-11 23:25 +0100
    Re: Problem with importing in Python su29090 <129km09@gmail.com> - 2013-01-11 14:29 -0800
    Re: Problem with importing in Python su29090 <129km09@gmail.com> - 2013-01-11 14:29 -0800
  Re: Problem with importing in Python Chris Angelico <rosuav@gmail.com> - 2013-01-12 09:27 +1100
    Re: Problem with importing in Python su29090 <129km09@gmail.com> - 2013-01-11 14:38 -0800
    Re: Problem with importing in Python su29090 <129km09@gmail.com> - 2013-01-11 14:38 -0800
  Re: Problem with importing in Python Dave Angel <d@davea.name> - 2013-01-11 17:43 -0500
    Re: Problem with importing in Python su29090 <129km09@gmail.com> - 2013-01-11 15:23 -0800
    Re: Problem with importing in Python su29090 <129km09@gmail.com> - 2013-01-11 15:23 -0800
    Re: Problem with importing in Python Tim Roberts <timr@probo.com> - 2013-01-11 20:37 -0800
      Re: Problem with importing in Python Chris Angelico <rosuav@gmail.com> - 2013-01-12 15:54 +1100
      Re: Problem with importing in Python Dave Angel <d@davea.name> - 2013-01-12 00:14 -0500
  Re: Problem with importing in Python Terry Reedy <tjreedy@udel.edu> - 2013-01-11 22:53 -0500

csiph-web