Re: For Counter Variable

2012-09-29 Thread Ramchandra Apte
On Tuesday, 25 September 2012 05:48:22 UTC+5:30, David Hutto wrote: > > Is the animated GIF on your website under 60MB yet? > > yeah a command line called convert, and taking out a few jpegs used to > > convert, and I can reduce it to any size, what's the fucking point of > > that question othe

RE: For Counter Variable

2012-09-27 Thread Prasad, Ramit
Tim Chase wrote: > [snip] though I'm minorly miffed that > enumerate()'s starting-offset wasn't back-ported into earlier 2.x > versions and have had to code around it for 1-based indexing; either > extra "+1"s or whip up my own simple enumerate() generator). Starting offset is in Python 2.6, unle

Re: For Counter Variable

2012-09-25 Thread Chris Angelico
On Wed, Sep 26, 2012 at 12:19 AM, Steven D'Aprano wrote: > On Tue, 25 Sep 2012 11:16:40 +0100, Mark Lawrence wrote: > >> On 25/09/2012 10:53, Chris Rebert wrote: >> >> [snip] >> >>> Well, the PSU might, except they emphatically do not exist... >> >> I know that they exist > > You are delusional. T

Re: For Counter Variable

2012-09-25 Thread Steven D'Aprano
On Tue, 25 Sep 2012 11:16:40 +0100, Mark Lawrence wrote: > On 25/09/2012 10:53, Chris Rebert wrote: > > [snip] > >> Well, the PSU might, except they emphatically do not exist... > > I know that they exist You are delusional. The PSU certainly do not exist and it is a myth that they -- ht

Re: For Counter Variable

2012-09-25 Thread Mark Lawrence
On 25/09/2012 11:57, Tim Chase wrote: [snip] Coming from C where just about *nothing* is in the stdlib and Java & PHP where only some core functionalities are in the stdlib, to Python where just the list of modules in the stdlib is humongous, I have to make http://docs.python.org/library/ my f

Re: For Counter Variable

2012-09-25 Thread Tim Chase
On 09/25/12 00:53, Thomas Rachel wrote: > Am 25.09.2012 01:39 schrieb Dwight Hutto: >> You don't always know all the built-ins, so the builtin is >> simpler, but knowing how to code it yourself is the priority of >> learning to code in a higher level language, which should be >> simpler to the user

Re: For Counter Variable

2012-09-25 Thread Mark Lawrence
On 25/09/2012 10:53, Chris Rebert wrote: [snip] Well, the PSU might, except they emphatically do not exist... I know that they exist but if I admit to it I'd have to shoot myself. If I can get the bra off of the debutante that is. Cheers, Chris -- PEP-401 compliant -- Cheers. Mark L

Re: For Counter Variable

2012-09-25 Thread Chris Rebert
On Tue, Sep 25, 2012 at 2:46 AM, Mark Lawrence wrote: > On 25/09/2012 10:32, wxjmfa...@gmail.com wrote: >> >> I wrote my first program on a PDP-8. I discovered Python >> at release 1.5.? >> >> Now years later... I find Python more and more unusable. >> I'm toying more and more with the go languag

Re: For Counter Variable

2012-09-25 Thread Mark Lawrence
On 25/09/2012 10:32, wxjmfa...@gmail.com wrote: I wrote my first program on a PDP-8. I discovered Python at release 1.5.? Now years later... I find Python more and more unusable. Dementia is a growing problem for us older people :) As an exemple related to this topic, which summarizes a lit

Re: For Counter Variable

2012-09-25 Thread wxjmfauth
I wrote my first program on a PDP-8. I discovered Python at release 1.5.? Now years later... I find Python more and more unusable. As an exemple related to this topic, which summarizes a little bit the situation. I just opened my interactive interpreter and produced this: >>> for i in range(len(

Re: For Counter Variable

2012-09-25 Thread Mark Lawrence
On 25/09/2012 08:46, Steven D'Aprano wrote: On Tue, 25 Sep 2012 07:53:55 +0200, Thomas Rachel wrote: When learning Python, it often happend me to re-inven the wheel. But as soon as I saw the presence of something I re-wrote, I skipped my re-written version and used the built-in. And me. Not

Re: For Counter Variable

2012-09-25 Thread Chris Angelico
On Tue, Sep 25, 2012 at 11:32 AM, Dwight Hutto wrote: >> By now I think we're in the DNFTT zone. >> -- > Taking a bite yourself there buddy. Hop under the bridge, and > comment...it make you a troll, and you're trying to feed yourself with > pile on comment from the rest of the under bridge dwelle

Re: For Counter Variable

2012-09-25 Thread Steven D'Aprano
On Tue, 25 Sep 2012 07:53:55 +0200, Thomas Rachel wrote: > When learning Python, it often happend me to re-inven the wheel. But as > soon as I saw the presence of something I re-wrote, I skipped my > re-written version and used the built-in. And me. Not just Python either. The very first piece o

Re: For Counter Variable

2012-09-25 Thread Dwight Hutto
> By now I think we're in the DNFTT zone. > -- Taking a bite yourself there buddy. Hop under the bridge, and comment...it make you a troll, and you're trying to feed yourself with pile on comment from the rest of the under bridge dwellers. -- Best Regards, David Hutto CEO: http://www.hitwebdevelo

Re: For Counter Variable

2012-09-24 Thread Thomas Rachel
Am 25.09.2012 01:39 schrieb Dwight Hutto: It's not the simpler solution I'm referring to, it's the fact that if you're learning, then you should be able to design the built-in, not just use it. In some simpler cases you are right here. But the fact that you are able to design it doesn't neces

Re: For Counter Variable

2012-09-24 Thread Paul Rubin
alex23 writes: > To highlight the vast gulf between what you think you are and what you > actually produce. By now I think we're in the DNFTT zone. -- http://mail.python.org/mailman/listinfo/python-list

Re: For Counter Variable

2012-09-24 Thread Dwight Hutto
On Mon, Sep 24, 2012 at 8:32 PM, Littlefield, Tyler wrote: > On 9/24/2012 6:25 PM, Dwight Hutto wrote: >>> >>> To highlight the vast gulf between what you think you are and what you >>> actually produce. >> >> I produce working code, and if it works, then I don't just think...I know. >> >> Working

Re: For Counter Variable

2012-09-24 Thread Littlefield, Tyler
On 9/24/2012 6:25 PM, Dwight Hutto wrote: To highlight the vast gulf between what you think you are and what you actually produce. I produce working code, and if it works, then I don't just think...I know. Working code != good code. Just an observation. Also, I've noticed a vast differences be

Re: For Counter Variable

2012-09-24 Thread Oscar Benjamin
On 25 September 2012 01:17, Dwight Hutto wrote: > > Is the animated GIF on your website under 60MB yet? > yeah a command line called convert, and taking out a few jpegs used to > convert, and I can reduce it to any size, what's the fucking point of > that question other than ignorant rhetoric, th

Re: For Counter Variable

2012-09-24 Thread Dwight Hutto
> To highlight the vast gulf between what you think you are and what you > actually produce. I produce working code, and if it works, then I don't just think...I know. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list

Re: For Counter Variable

2012-09-24 Thread Dwight Hutto
> Is the animated GIF on your website under 60MB yet? yeah a command line called convert, and taking out a few jpegs used to convert, and I can reduce it to any size, what's the fucking point of that question other than ignorant rhetoric, that you know is easily fixable? -- Best Regards, David H

Re: For Counter Variable

2012-09-24 Thread alex23
On Sep 25, 10:18 am, Dwight Hutto wrote: > what's the fucking point of that question To highlight the vast gulf between what you think you are and what you actually produce. -- http://mail.python.org/mailman/listinfo/python-list

Re: For Counter Variable

2012-09-24 Thread alex23
On Sep 25, 9:49 am, Dwight Hutto wrote: > Rolling> your own version of an existing function from scratch is _not_ the > > "professional" approach. > > Yes it is, if you don't know the builtin, and everyone has memory flaws. Let me break this down for you in simple terms. Code represents experien

Re: For Counter Variable

2012-09-24 Thread Dwight Hutto
Propaganda over... -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list

Re: For Counter Variable

2012-09-24 Thread Dwight Hutto
>> Well if you're learning then the builtin might be more like how we >> answer students questions here, than those doing work. > > STOP SAYING THIS NONSENSE. > > Using a pre-defined function is _not_ the "student" approach. What are talking about, I suggested they roll there own in several respons

Re: For Counter Variable

2012-09-24 Thread alex23
On Sep 25, 9:39 am, Dwight Hutto wrote: > It's not the simpler solution I'm referring to, it's the fact that if > you're learning, then you should be able to design the built-in, not > just use it. Garbage. I don't need to be able to build a SQLAlchemy to use it. I don't need to be able to build

Re: For Counter Variable

2012-09-24 Thread Dwight Hutto
On Sep 25, 8:26 am, Dwight Hutto wrote: > It's a function usage. Not to be too serious, there are usually > simpler solutions, and built in functions. `enumerate` _is_ a built-in function. Please provide an example of a "simpler solution". It's not the simpler solution I'm referring to, it's the

Re: For Counter Variable

2012-09-24 Thread alex23
On Sep 25, 8:58 am, Dwight Hutto wrote: > Well if you're learning then the builtin might be more like how we > answer students questions here, than those doing work. STOP SAYING THIS NONSENSE. Using a pre-defined function is _not_ the "student" approach. Rolling your own version of an existing f

Re: For Counter Variable

2012-09-24 Thread Dwight Hutto
> *How* would one implement this better, more simply (for the user, not the > implementator) or in a more readable manner? Chose *any* one of those. Well if you're learning then the builtin might be more like how we answer students questions here, than those doing work. Write out the algorithmic

Re: For Counter Variable

2012-09-24 Thread Joshua Landau
On 24 September 2012 23:26, Dwight Hutto wrote: > On Mon, Sep 24, 2012 at 6:09 PM, Ethan Furman wrote: > > jimbo1qaz wrote: > >> > >> On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote: > >>> > >>> Am I missing something obvious, or do I have to manually put in a > counter > >>> in

Re: For Counter Variable

2012-09-24 Thread Dwight Hutto
On Mon, Sep 24, 2012 at 6:09 PM, Ethan Furman wrote: > jimbo1qaz wrote: >> >> On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote: >>> >>> Am I missing something obvious, or do I have to manually put in a counter >>> in the for loops? That's a very basic request, but I couldn't find an

Re: For Counter Variable

2012-09-24 Thread Ethan Furman
jimbo1qaz wrote: On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote: Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I couldn't find anything in the documentation. Ya, they should really give a better w

Re: For Counter Variable

2012-09-23 Thread Mark Lawrence
On 24/09/2012 01:05, Tim Chase wrote: On 09/23/12 18:52, Alec Taylor wrote: You can always use a counter if you don't like our fancy for-each loops; foolist = [1,24,24,234,23,423,4] for i in xrange(len(foolist)): print foolist[i] http://www.seas.upenn.edu/~lignos/py_antipatterns.html Th

Re: For Counter Variable

2012-09-23 Thread Tim Chase
On 09/23/12 18:52, Alec Taylor wrote: > You can always use a counter if you don't like our fancy for-each loops; > > foolist = [1,24,24,234,23,423,4] > for i in xrange(len(foolist)): > print foolist[i] http://www.seas.upenn.edu/~lignos/py_antipatterns.html The first one on the list of anti-p

Re: For Counter Variable

2012-09-23 Thread Alec Taylor
You can always use a counter if you don't like our fancy for-each loops; foolist = [1,24,24,234,23,423,4] for i in xrange(len(foolist)): print foolist[i] On Mon, Sep 24, 2012 at 9:29 AM, Tim Chase wrote: > On 09/23/12 17:54, Steven D'Aprano wrote: > > On Sun, 23 Sep 2012 10:45:53 -0700, jimb

Re: For Counter Variable

2012-09-23 Thread Tim Chase
On 09/23/12 17:54, Steven D'Aprano wrote: > On Sun, 23 Sep 2012 10:45:53 -0700, jimbo1qaz wrote: >> On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote: >>> Am I missing something obvious, or do I have to manually put in a >>> counter in the for loops? That's a very basic request, but I

Re: For Counter Variable

2012-09-23 Thread Steven D'Aprano
On Sun, 23 Sep 2012 10:45:53 -0700, jimbo1qaz wrote: > On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote: >> Am I missing something obvious, or do I have to manually put in a >> counter in the for loops? That's a very basic request, but I couldn't >> find anything in the documentatio

Re: For Counter Variable

2012-09-23 Thread Oscar Benjamin
On Sep 23, 2012 6:52 PM, "jimbo1qaz" wrote: > > On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote: > > Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I couldn't find anything in the documentation. > > Ya, t

Re: For Counter Variable

2012-09-23 Thread jimbo1qaz
On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote: > Am I missing something obvious, or do I have to manually put in a counter in > the for loops? That's a very basic request, but I couldn't find anything in > the documentation. Ya, they should really give a better way, but for now

Re: For Counter Variable

2012-09-23 Thread Chris Angelico
On Mon, Sep 24, 2012 at 2:36 AM, jimbo1qaz wrote: > Am I missing something obvious, or do I have to manually put in a counter in > the for loops? That's a very basic request, but I couldn't find anything in > the documentation. You mean, if you want the indices as well as the values? Try the en

For Counter Variable

2012-09-23 Thread Oscar Benjamin
On Sep 23, 2012 5:42 PM, "jimbo1qaz" wrote: > > Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I couldn't find anything in the documentation. Have you seen the enumerate function? Oscar -- http://mail.python.org/mailm

Re: For Counter Variable

2012-09-23 Thread Rodrick Brown
On Sep 23, 2012, at 12:42 PM, jimbo1qaz wrote: > Am I missing something obvious, or do I have to manually put in a counter in > the for loops? That's a very basic request, but I couldn't find anything in > the documentation. for idx in : print (idx) i.e.. for idx in range(10): print(idx) > -

For Counter Variable

2012-09-23 Thread jimbo1qaz
Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I couldn't find anything in the documentation. -- http://mail.python.org/mailman/listinfo/python-list