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: 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> 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 , 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: 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 On Friday, January 11, 2013 5:25:24 PM UTC-5, Adnan Sadzak wrote: > Python is case sensitive. >=20 > Circle and circle is not same. >=20 >=20 >=20 >=20 >=20 >=20 > /* sent from android */ >=20 > On Jan 11, 2013 11:22 PM, "su29090" <129...@gmail.com> wrote: >=20 > I'm trying to import a python file it keeps saying: >=20 >=20 >=20 > ImportError: cannot import name Circle >=20 >=20 >=20 > Here is the file I'm trying to import: >=20 >=20 >=20 > Circle.py >=20 >=20 >=20 > import math >=20 >=20 >=20 > class circle: >=20 > =A0 =A0 #Construct a circle object >=20 > =A0 =A0 def __init__(self, radius =3D 1): >=20 > =A0 =A0 =A0 =A0 self.radius =3D radius >=20 >=20 >=20 > =A0 =A0 def getPerimeter(self): >=20 > =A0 =A0 =A0 =A0 return 2 * self.radius * math.pi >=20 >=20 >=20 > =A0 =A0 def getArea(self): >=20 > =A0 =A0 =A0 =A0 return self.radius * self.radius * math.pi >=20 >=20 >=20 > =A0 =A0 def setRadius(self, radius): >=20 > =A0 =A0 =A0 =A0 self.radius =3D radius >=20 >=20 >=20 > from Circle import Circle >=20 >=20 >=20 > def main(): >=20 > =A0 =A0 #Create a circle with a radius 1 >=20 > =A0 =A0 circle1 =3D Circle() >=20 > =A0 =A0 print("The area of the circle of radius", >=20 > =A0 =A0 =A0 =A0 =A0 circle1.radius, "is" , circle1.getArea()) >=20 >=20 >=20 > =A0 =A0 #Create a circle with a radius 25 >=20 > =A0 =A0 circle2 =3D Circle(25) >=20 > =A0 =A0 print("The area of the circle of radius", >=20 > =A0 =A0 =A0 =A0 =A0 circle2.radius, "is" , circle2.getArea()) >=20 >=20 >=20 > =A0 =A0 #Create a circle with a radius 125 >=20 > =A0 =A0 circle3 =3D Circle(125) >=20 > =A0 =A0 print("The area of the circle of radius", >=20 > =A0 =A0 =A0 =A0 =A0 circle3.radius, "is" , circle3.getArea()) >=20 >=20 >=20 > =A0 =A0 #Modify circle radius >=20 > =A0 =A0 circle2.radius =3D 100 # or Circle2.setRadius(100) >=20 > =A0 =A0 print("The area of the circle of radius", >=20 > =A0 =A0 =A0 =A0 =A0 circle2.radius, "is" , circle2.getArea()) >=20 >=20 >=20 > =A0 =A0 main() # Call the main function >=20 >=20 >=20 > How can I solve this problem? >=20 >=20 >=20 > Thanks in advance. >=20 >=20 >=20 > -- >=20 > http://mail.python.org/mailman/listinfo/python-list It still keeps showing the same message.