Problem with importing in Python

2013-01-11 Thread su29090
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):

Re: Problem with importing in Python

2013-01-11 Thread Adnan Sadzak
Python is case sensitive. Circle and circle is not same. /* sent from android */ On Jan 11, 2013 11:22 PM, su29090 129k...@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

Re: Problem with importing in Python

2013-01-11 Thread Chris Angelico
On Sat, Jan 12, 2013 at 9:17 AM, su29090 129k...@gmail.com wrote: Circle.py class circle: from Circle import Circle Inside the Circle module is a class named circle. You can't import Circle from that. But Python isn't Java. You don't have to put each class into its own file. Just put class

Re: Problem with importing in Python

2013-01-11 Thread su29090
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:

Re: Problem with importing in Python

2013-01-11 Thread su29090
On Friday, January 11, 2013 5:27:21 PM UTC-5, Chris Angelico wrote: On Sat, Jan 12, 2013 at 9:17 AM, su29090 wrote: Circle.py class circle: from Circle import Circle Inside the Circle module is a class named circle. You can't import Circle from that. But

Re: Problem with importing in Python

2013-01-11 Thread Dave Angel
On 01/11/2013 05:17 PM, su29090 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):

Re: Problem with importing in Python

2013-01-11 Thread su29090
On Friday, January 11, 2013 5:43:10 PM UTC-5, Dave Angel wrote: On 01/11/2013 05:17 PM, su29090 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

Re: Problem with importing in Python

2013-01-11 Thread Terry Reedy
On 1/11/2013 5:17 PM, su29090 wrote: Circle.py import math class circle: By current convention, you should call the file 'circle.py' and the class 'Circle'. Using all lower case for module filenames is the sanest thing to do in a world where different filesystems do different things with

Re: Problem with importing in Python

2013-01-11 Thread Tim Roberts
Dave Angel d...@davea.name wrote: As Adnan has pointed out, Python is case insensitive. That's not really what you meant to say... -- Tim Roberts, t...@probo.com Providenza Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with importing in Python

2013-01-11 Thread Chris Angelico
On Sat, Jan 12, 2013 at 3:37 PM, Tim Roberts t...@probo.com wrote: Dave Angel d...@davea.name wrote: As Adnan has pointed out, Python is case insensitive. That's not really what you meant to say... UNinsensitive, your Majesty means, of course. UNinsensitive, of course, I meant. *watches the

Re: Problem with importing in Python

2013-01-11 Thread Dave Angel
On 01/11/2013 11:37 PM, Tim Roberts wrote: Dave Angel d...@davea.name wrote: As Adnan has pointed out, Python is case insensitive. That's not really what you meant to say... Nope. I meant Python is case sensitive. Thanks for the catch. I think the rest of my discourse made it clear that