Re: [Tutor] Importing question

2007-07-14 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote > You can find out where any module is located using its __file__ > attribute. This works for modules written in C, too. But not on Windoze. If it's built-in there is no __file__ attribute. But the print trick tells you if it's builtin and if it's not __f

Re: [Tutor] Importing question

2007-07-13 Thread Kent Johnson
Dick Moores wrote: > At http://wiki.python.org/moin/SimplePrograms I found this code: > > > import itertools > > def iter_primes(): > # an iterator of all numbers between 2 and +infinity > numbers = itertools.count(2) > > # generate pri

Re: [Tutor] Importing question

2007-07-13 Thread Dick Moores
At 02:50 PM 7/13/2007, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote in > > > > import itertools > > > > def iter_primes(): > > # an iterator of all numbers between 2 and +infinity > > numbers = itertools.count(2) > > ... > > > It works for me in Win XP, Python 2.5. > > > > Ho

Re: [Tutor] Importing question

2007-07-13 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote in > import itertools > > def iter_primes(): > # an iterator of all numbers between 2 and +infinity > numbers = itertools.count(2) > ... > It works for me in Win XP, Python 2.5. > > However, in trying to dig into the code to understand it, > I

Re: [Tutor] Importing question

2007-07-13 Thread Dick Moores
At 07:55 AM 7/13/2007, Eric Brunson wrote: >Dick Moores wrote: >>At http://wiki.python.org/moin/SimplePrograms I found this code: >> >> >>import itertools >> >>def iter_primes(): >> # an iterator of all numbers between 2 and +infinity >> numbers

Re: [Tutor] Importing question

2007-07-13 Thread Eric Brunson
Dick Moores wrote: > At http://wiki.python.org/moin/SimplePrograms I found this code: > > > import itertools > > def iter_primes(): > # an iterator of all numbers between 2 and +infinity > numbers = itertools.count(2) > > # generate primes

[Tutor] Importing question

2007-07-13 Thread Dick Moores
At http://wiki.python.org/moin/SimplePrograms I found this code: import itertools def iter_primes(): # an iterator of all numbers between 2 and +infinity numbers = itertools.count(2) # generate primes forever while True: #