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


Groups > comp.lang.python > #36656

Re: Problem with importing in Python

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <129km09@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'importerror:': 0.05; 'main()': 0.07; 'problem?': 0.07; 'python': 0.09; 'friday,': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr :python-list': 0.10; 'def': 0.10; 'advance.': 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; 'trying': 0.21; 'import': 0.21; 'cc:2**1': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'cc:addr:gmail.com': 0.27; 'url:mailman': 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; 'message.': 0.33; '11,': 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; 'url:mail': 0.40; 'solve': 0.62; 'here': 0.65; 'circle': 0.65; '100': 0.78; '2013': 0.84; 'saying:': 0.84
Newsgroups comp.lang.python
Date Fri, 11 Jan 2013 14:29:35 -0800 (PST)
In-Reply-To <mailman.415.1357943131.2939.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=98.217.186.206; posting-account=w-5w_goAAADUIOLQGYHG22ns_QlDow8P
References <1eb7cd76-ade3-4c34-8816-6eaa7201262e@googlegroups.com> <mailman.415.1357943131.2939.python-list@python.org>
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-IP 98.217.186.206
MIME-Version 1.0
Subject Re: Problem with importing in Python
From su29090 <129km09@gmail.com>
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Cc python-list <python-list@python.org>, su29090 <129km09@gmail.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 <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>
Message-ID <mailman.421.1357946170.2939.python-list@python.org> (permalink)
Lines 125
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357946170 news.xs4all.nl 6855 [2001:888:2000:d::a6]:59776
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36656

Show key headers only | View raw


On Friday, January 11, 2013 5:25:24 PM UTC-5, Adnan Sadzak wrote:
> Python is case sensitive.
> 
> Circle and circle is not same.
> 
> 
> 
> 
> 
> 
> /* sent from android */
> 
> On Jan 11, 2013 11:22 PM, "su29090" <129...@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

It still keeps showing the same message.

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