Re: [Tutor] Random Number Question

2010-11-26 Thread Mac Ryan
On Fri, 26 Nov 2010 18:33:07 +0100 Piotr Kamiński wrote: > You can get the list of Python's standard modules by typing help() > and then you will see something similar to: Thanks a lot! This is what I was after! Mac. ___ Tutor maillist - Tutor@pytho

Re: [Tutor] Random Number Question

2010-11-26 Thread Piotr Kamiński
Dnia 25-11-2010 o 13:20:22 Mac Ryan napisał(a): On Thu, 25 Nov 2010 11:09:10 +0100 Timo wrote: > I was wondering... apart from checking each name individually, is > there any easy-peasy way to get a list of names used in the > standard library (I am thinking to something like "dir()"? Th

Re: [Tutor] Random Number Question

2010-11-25 Thread Peter Otten
Alan Gauld wrote: import random > > It tries to import itself, which then tries to import itself, > which then. infinite loop time... I think it's more like - look up module random in sys.modules - module random not found in sys.modules; locate the file random.py - file random.py found

Re: [Tutor] Random Number Question

2010-11-25 Thread Chris Fuller
Well, you can try "import x", but your problem wasn't that you used the same filename as some Python script on your path, the problem was you then tried to import that other script. So to avoid infinite recursion, all you have to do is avoid importing your own filename, which should be easy en

Re: [Tutor] Random Number Question

2010-11-25 Thread Mac Ryan
On Thu, 25 Nov 2010 11:09:10 +0100 Timo wrote: > > I was wondering... apart from checking each name individually, is > > there any easy-peasy way to get a list of names used in the > > standard library (I am thinking to something like "dir()"? > This is the webpage I always use for searchin

Re: [Tutor] Random Number Question

2010-11-25 Thread Timo
On 25-11-10 08:00, Mac Ryan wrote: On Thu, 25 Nov 2010 00:58:23 + Adam Bark wrote: Ah yes always avoid giving your modules names that appear in the standard library. It goes wrong, sometimes in unexpected ways. I was wondering... apart from checking each name individually, is there any ea

Re: [Tutor] Random Number Question

2010-11-24 Thread Mac Ryan
On Thu, 25 Nov 2010 00:58:23 + Adam Bark wrote: > Ah yes always avoid giving your modules names that appear in the > standard library. It goes wrong, sometimes in unexpected ways. I was wondering... apart from checking each name individually, is there any easy-peasy way to get a list of nam

Re: [Tutor] Random Number Question

2010-11-24 Thread Jeff Goodwin
Thanks Adam and Alan for responding, I'm very much a non-programmer, but my 14 year old son wants to learn, so I have to learn to teach him...slow process lol. Happy Thanksgiving! Jeff On Wed, Nov 24, 2010 at 8:27 PM, Alan Gauld wrote: > > "Jeff Goodwin" wrote > > Ok, I found the problem, I h

Re: [Tutor] Random Number Question

2010-11-24 Thread Alan Gauld
"Jeff Goodwin" wrote Ok, I found the problem, I had saved the file as random.py looks like that was a no-no. Its working now that I changed the name. Yes that's a bad idea. You probably figured out why, but just in case... import random It tries to import itself, which then tries to

Re: [Tutor] Random Number Question

2010-11-24 Thread Adam Bark
On 24/11/10 22:10, Jeff Goodwin wrote: Ok, I found the problem, I had saved the file as random.py looks like that was a no-no. Its working now that I changed the name. Thanks! Jeff Ah yes always avoid giving your modules names that appear in the standard library. It goes wrong, sometimes in un

Re: [Tutor] Random Number Question

2010-11-24 Thread Jeff Goodwin
Ok, I found the problem, I had saved the file as random.py looks like that was a no-no. Its working now that I changed the name. Thanks! Jeff On Wed, Nov 24, 2010 at 5:06 PM, Jeff Goodwin wrote: > Thanks Adam, that was a typo on my part, in the program the print is > actually indented. Any other

Re: [Tutor] Random Number Question

2010-11-24 Thread Jeff Goodwin
Thanks Adam, that was a typo on my part, in the program the print is actually indented. Any other suggestions? Thanks again! Jeff On Wed, Nov 24, 2010 at 5:00 PM, Adam Bark wrote: > On 24/11/10 21:51, Jeff Goodwin wrote: > > Hello, > > I'm trying to find a way to use the random.randint fu

Re: [Tutor] Random Number Question

2010-11-24 Thread Adam Bark
On 24/11/10 21:51, Jeff Goodwin wrote: Hello, I'm trying to find a way to use the random.randint function to generate a random number, but everytime I run the program it locks up IDLE. Here is what I have so far: import random def main(): x = input("Enter a number: ") y = input("Ente

[Tutor] Random Number Question

2010-11-24 Thread Jeff Goodwin
Hello, I'm trying to find a way to use the random.randint function to generate a random number, but everytime I run the program it locks up IDLE. Here is what I have so far: import random def main(): x = input("Enter a number: ") y = input("Enter a different number: ") z = random