Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Dave Angel
On 09/16/2012 12:05 AM, Dave Angel wrote: > On 09/15/2012 11:48 PM, aklei...@sonic.net wrote: >>> On 09/15/2012 10:03 PM, Scurvy Scott wrote: > That list would fill all the PC's on the planet a few billions times. > The number of items in the list has 25 digits in it. print 32**16 > >>

Re: [Tutor] [Semi-OT] Yes or no on using a Graphical IDE?

2012-09-15 Thread Dave Angel
On 09/16/2012 12:48 AM, Wayne Werner wrote: > On Sat, 15 Sep 2012, leam hall wrote: > >> Hey all, not trying to contribute to the flames of one graphical IDE >> over >> another. I'm just trying to figure out if they are worth the learning >> curve? I >> have been doing most of my work in vi and the

Re: [Tutor] [Semi-OT] Yes or no on using a Graphical IDE?

2012-09-15 Thread Wayne Werner
On Sat, 15 Sep 2012, leam hall wrote: Hey all, not trying to contribute to the flames of one graphical IDE over another. I'm just trying to figure out if they are worth the learning curve? I have been doing most of my work in vi and the graphical IDE I'm supposed to use for a class keeps adding

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Steven D'Aprano
On 16/09/12 14:11, aklei...@sonic.net wrote: Akleider, you didn't include attribution for the person you are quoting, which is a bit rude and also means I can't be sure who it was. From context, I *think* it is the original poster Scott: I do sincerely apologize for anything that was rude. Ple

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread akleider
> Akleider, you didn't include attribution for the person you are quoting, > which is a bit rude and also means I can't be sure who it was. From > context, I *think* it is the original poster Scott: > > On 16/09/12 13:06, aklei...@sonic.net wrote: >>> I'm using this to write a program I'm calling T

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Steven D'Aprano
On 16/09/12 13:48, aklei...@sonic.net wrote: What interests me, and I acknowledge that this is more a question for a computer science forum than a python one, is: can this be done in a non recursive way so the limiting factor will be time, not memory? I couldn't think of a way. Of course. Th

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Dave Angel
On 09/15/2012 11:48 PM, aklei...@sonic.net wrote: >> On 09/15/2012 10:03 PM, Scurvy Scott wrote: That list would fill all the PC's on the planet a few billions times. The number of items in the list has 25 digits in it. print 32**16 >> I can't see any reason why it changes anything.

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Steven D'Aprano
Akleider, you didn't include attribution for the person you are quoting, which is a bit rude and also means I can't be sure who it was. From context, I *think* it is the original poster Scott: On 16/09/12 13:06, aklei...@sonic.net wrote: I'm using this to write a program I'm calling TORdialer wi

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread akleider
> On 09/15/2012 10:03 PM, Scurvy Scott wrote: >>> >>> That list would fill all the PC's on the planet a few billions times. >>> The number of items in the list has 25 digits in it. print 32**16 >>> >> > > I can't see any reason why it changes anything. The world doesn't have > enough disk space t

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Dave Angel
On 09/15/2012 10:03 PM, Scurvy Scott wrote: >> >> That list would fill all the PC's on the planet a few billions times. >> The number of items in the list has 25 digits in it. print 32**16 >> >> I actually should've specified that the list I'm trying to create would > not start at say "000

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Steven D'Aprano
On 16/09/12 08:50, Scurvy Scott wrote: Hello again python tutor list. I have what I see as a somewhat complicated problem which I have no idea where to begin. I'm hoping you fine folks can help me. I'm trying to generate a list of every possible 16 character string containing only 2-7 and a-z lo

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Steven D'Aprano
On 16/09/12 13:06, aklei...@sonic.net wrote: #!/usr/bin/env python # file : every.py print 'Running "every.py"' possible = "234567abcdefghijklmnopqrstuvwxyz" word_length = 16 word_list = [] def add_word(word): if len(word)==word_length: word_list.append(word) print wor

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread akleider
>> Hello again python tutor list. >> I have what I see as a somewhat complicated problem which I have no idea >> where to begin. I'm hoping you fine folks can help me. >> >> I'm trying to generate a list of every possible 16 character string >> containing only 2-7 and a-z lowercase. I've seen some

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread akleider
> possible = "234567abcdefghijklmnopqrstuvwxyz" > word_length = 16 > print 'Running "every.py"' > word_list = [] > def add_word(word): > if len(word)==word_length: > word_list.append(word) > print word > else: > for c in possible: > new_word = word + c >

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread akleider
#!/usr/bin/env python # file : every.py print 'Running "every.py"' possible = "234567abcdefghijklmnopqrstuvwxyz" word_length = 16 word_list = [] def add_word(word): if len(word)==word_length: word_list.append(word) print word # There may come a time you won't want this li

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Scurvy Scott
possible = "234567abcdefghijklmnopqrstuvwxyz" word_length = 16 print 'Running "every.py"' word_list = [] def add_word(word): if len(word)==word_length: word_list.append(word) print word else: for c in possible: new_word = word + c add_word(new

Re: [Tutor] [Semi-OT] Yes or no on using a Graphical IDE?

2012-09-15 Thread Steven D'Aprano
On 15/09/12 22:51, leam hall wrote: Hey all, not trying to contribute to the flames of one graphical IDE over another. I'm just trying to figure out if they are worth the learning curve? I have been doing most of my work in vi and the graphical IDE I'm supposed to use for a class keeps adding cra

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread akleider
> Hello again python tutor list. > I have what I see as a somewhat complicated problem which I have no idea > where to begin. I'm hoping you fine folks can help me. > > I'm trying to generate a list of every possible 16 character string > containing only 2-7 and a-z lowercase. I've seen some exampl

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Scurvy Scott
> > That list would fill all the PC's on the planet a few billions times. > The number of items in the list has 25 digits in it. print 32**16 > > I actually should've specified that the list I'm trying to create would not start at say "0001". I'm attempting to generate all possible .on

Re: [Tutor] Cube root

2012-09-15 Thread akleider
> On Sat, Sep 15, 2012 at 5:36 PM, Dave Angel wrote: >> On 09/15/2012 05:28 PM, Amanda Colley wrote: >>> Ok, I have to get input from a user ('enter a number') and then get >>> the >>> cube root of that number. I am having trouble with the code to get the >>> cube root. If anyone can help me sol

Re: [Tutor] Cube root

2012-09-15 Thread akleider
> On Sat, Sep 15, 2012 at 5:36 PM, Dave Angel wrote: >> On 09/15/2012 05:28 PM, Amanda Colley wrote: >>> Ok, I have to get input from a user ('enter a number') and then get >>> the >>> cube root of that number. I am having trouble with the code to get the >>> cube root. If anyone can help me sol

Re: [Tutor] Cube root

2012-09-15 Thread Steven D'Aprano
On 16/09/12 07:28, Amanda Colley wrote: Ok, I have to get input from a user ('enter a number') and then get the cube root of that number. I am having trouble with the code to get the cube root. If anyone can help me solve this I would greatly appreciate it. ('enter a number') n=number ??? cube

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Dave Angel
On 09/15/2012 06:50 PM, Scurvy Scott wrote: > Hello again python tutor list. > I have what I see as a somewhat complicated problem which I have no idea > where to begin. I'm hoping you fine folks can help me. > > I'm trying to generate a list of every possible 16 character string > containing only

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Peter Otten
Scurvy Scott wrote: > Hello again python tutor list. > I have what I see as a somewhat complicated problem which I have no idea > where to begin. I'm hoping you fine folks can help me. > > I'm trying to generate a list of every possible 16 character string > containing only 2-7 and a-z lowercase.

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Joel Goldstick
On Sat, Sep 15, 2012 at 6:50 PM, Scurvy Scott wrote: > Hello again python tutor list. > I have what I see as a somewhat complicated problem which I have no idea > where to begin. I'm hoping you fine folks can help me. > > I'm trying to generate a list of every possible 16 character string > contai

[Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Scurvy Scott
Hello again python tutor list. I have what I see as a somewhat complicated problem which I have no idea where to begin. I'm hoping you fine folks can help me. I'm trying to generate a list of every possible 16 character string containing only 2-7 and a-z lowercase. I've seen some examples using re

Re: [Tutor] Cube root

2012-09-15 Thread Joel Goldstick
On Sat, Sep 15, 2012 at 5:36 PM, Dave Angel wrote: > On 09/15/2012 05:28 PM, Amanda Colley wrote: >> Ok, I have to get input from a user ('enter a number') and then get the >> cube root of that number. I am having trouble with the code to get the >> cube root. If anyone can help me solve this I

Re: [Tutor] Cube root

2012-09-15 Thread Dave Angel
On 09/15/2012 05:28 PM, Amanda Colley wrote: > Ok, I have to get input from a user ('enter a number') and then get the > cube root of that number. I am having trouble with the code to get the > cube root. If anyone can help me solve this I would greatly appreciate it. > ('enter a number') > n=num

[Tutor] Cube root

2012-09-15 Thread Amanda Colley
Ok, I have to get input from a user ('enter a number') and then get the cube root of that number. I am having trouble with the code to get the cube root. If anyone can help me solve this I would greatly appreciate it. ('enter a number') n=number ??? cube root?? -- Amanda Colley ___

Re: [Tutor] is this use or abuse of __getitem__ ?

2012-09-15 Thread eryksun
On Sat, Sep 15, 2012 at 10:18 AM, Albert-Jan Roskam wrote: > Thanks, I hadn't noticed this yet. I am refactoring some of the rest of my > code > and I hadn't run anything yet. My code has two methods that return record(s): > an iterator (__getitem__) and a generator (readFile, which is also call

Re: [Tutor] [Semi-OT] Yes or no on using a Graphical IDE?

2012-09-15 Thread Modulok
> Hey all, not trying to contribute to the flames of one graphical IDE over > another. I'm just trying to figure out if they are worth the learning > curve? I have been doing most of my work in vi and the graphical IDE I'm > supposed to use for a class keeps adding crap that I have to erase, and I

Re: [Tutor] Python help

2012-09-15 Thread Joel Goldstick
On Sat, Sep 15, 2012 at 11:21 AM, Daniel Hulse wrote: > Hi. I am trying to solve a problem and I'm stuck. The problem is something > like as x goes up by 1, y goes up by the previous value times 2. I have no > idea where to start. So lets say x = 10 and y=5, when x=11, why would be > equal to

[Tutor] Python help

2012-09-15 Thread Daniel Hulse
Hi. I am trying to solve a problem and I'm stuck. The problem is something like as x goes up by 1, y goes up by the previous value times 2. I have no idea where to start. So lets say x = 10 and y=5, when x=11, why would be equal to 10. ___ Tutor maill

Re: [Tutor] is this use or abuse of __getitem__ ?

2012-09-15 Thread Albert-Jan Roskam
>On Sat, Sep 15, 2012 at 4:43 AM, eryksun wrote: > >>     else: >>         start = index(self.nCases + key if key < 0 else key)  # may >> raise TypeError >>         stop = start + 1 >>         step = 1 > > >Gmail is such a pain sometimes. I should have called index first anyway: > >        key =

[Tutor] [Semi-OT] Yes or no on using a Graphical IDE?

2012-09-15 Thread leam hall
Hey all, not trying to contribute to the flames of one graphical IDE over another. I'm just trying to figure out if they are worth the learning curve? I have been doing most of my work in vi and the graphical IDE I'm supposed to use for a class keeps adding crap that I have to erase, and I have to

Re: [Tutor] is this use or abuse of __getitem__ ?

2012-09-15 Thread eryksun
On Sat, Sep 15, 2012 at 4:43 AM, eryksun wrote: > else: > start = index(self.nCases + key if key < 0 else key) # may > raise TypeError > stop = start + 1 > step = 1 Gmail is such a pain sometimes. I should have called index first anyway: key = index(key) #

Re: [Tutor] (no subject)

2012-09-15 Thread Dwight Hutto
How to think like a computer scientist, in python: http://greenteapress.com/thinkpython/thinkpython.html And plenty of practice: Print Lists Dicts Tuples DB Files, you parse for data yourself Basic manipulation of data. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com _

Re: [Tutor] is this use or abuse of __getitem__ ?

2012-09-15 Thread eryksun
On Fri, Sep 14, 2012 at 2:33 PM, Albert-Jan Roskam wrote: >> On 14/09/12 22:16, Albert-Jan Roskam wrote: > > Is it recommended to define the geitem() function inside the __getitem__() > method? > I was thinking I could also define a _getitem() private method. > > def getitem(key): >

Re: [Tutor] (no subject)

2012-09-15 Thread Albert-Jan Roskam
___ > From: Johny Rei >To: "tutor@python.org" >Sent: Saturday, September 15, 2012 7:09 AM >Subject: [Tutor] (no subject) > > >hi  to all readers, i 'm a newbie and i'm interested to learn python >programming, can anybody please guide me out to learn basic to advanc

Re: [Tutor] (no subject)

2012-09-15 Thread Steven D'Aprano
On 15/09/12 15:09, Johny Rei wrote: hi to all readers, i 'm a newbie and i'm interested to learn python programming, can anybody please guide me out to learn basic to advance python programming, be actually can anyone out there should suggest a free book that i can read it on just to learn from