For Counter Variable

D

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.
 
S

Steven D'Aprano

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 of code I wrote on a Linux
machine was a shell script that (very badly, and even more very slowly)
counted the number of files in a directory. 20 lines (if I remember
correctly) to duplicate a simple:

ls | wc -l


It was a humbling lesson to always check what features a programming
environment or language offers before reinventing the wheel with four
sides.
 
C

Chris Angelico

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.

Dwight/David, may I courteously recommend and request that you refrain
from posting until you've calmed down a little? You're really not
doing your reputation much good. Unfortunately you're also impacting
the reputation of the list/newsgroup. People will come here looking
for help, and will see that people are biting and scratching at one
another[1], and will turn away. And that, in turn, reflects badly on
the language.

It's fine to disagree with someone - that's one of the best ways to
explore a problem space and turn up more information. What's not fine
is the bad language and vitriol.

To Paul Rubin (whose name and citation were omitted from Dwight's
quoted text): My apologies, I fear I am feeding a troll here. But
something needed to be said.

[1] Galations 5:15, eg http://bible.cc/galatians/5-15.htm - come to
think of it, the whole chapter applies fairly well here.
http://www.biblegateway.com/passage/?search=Galatians+5

ChrisA
 
M

Mark Lawrence

And me.

Not just Python either. The very first piece of code I wrote on a Linux
machine was a shell script that (very badly, and even more very slowly)
counted the number of files in a directory. 20 lines (if I remember
correctly) to duplicate a simple:

ls | wc -l


It was a humbling lesson to always check what features a programming
environment or language offers before reinventing the wheel with four
sides.

Thankfully easier in a relatively concise language like Python as
opposed to (say) Java. Which reminds me, in what version of Python are
we getting the singletonMap? :)
 
W

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:
.... '{} {}'.format(i, s)
....
'2 c'
'1 b'
'0 a'

I did it so many times with a reverse/enumerate combination,
I'm unable to do it again, I simply do not remember!


One another really annoying aspect of Python, illustrated
in my previous code: ''.format() .
Was it not supposed to be *the* new formating scheme?

I'm toying more and more with the go language. I really
appreciate and rediscover the strictness I learned with
Pascal.

jmf
 
W

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:
.... '{} {}'.format(i, s)
....
'2 c'
'1 b'
'0 a'

I did it so many times with a reverse/enumerate combination,
I'm unable to do it again, I simply do not remember!


One another really annoying aspect of Python, illustrated
in my previous code: ''.format() .
Was it not supposed to be *the* new formating scheme?

I'm toying more and more with the go language. I really
appreciate and rediscover the strictness I learned with
Pascal.

jmf
 
M

Mark Lawrence

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
little bit the situation. I just opened my interactive
interpreter and produced this:
... '{} {}'.format(i, s)
...
'2 c'
'1 b'
'0 a'

I did it so many times with a reverse/enumerate combination,
I'm unable to do it again, I simply do not remember!


Based on things I've read as I've never used it myself try using Perl as
that should simplify things for you.
One another really annoying aspect of Python, illustrated
in my previous code: ''.format() .
Was it not supposed to be *the* new formating scheme?

That might have been the original intention but it's not going to take
over the world as there's too much legacy code using the C style %
formatters. IIRC isn't there also something about string templates???
I'm toying more and more with the go language. I really
appreciate and rediscover the strictness I learned with
Pascal.

So go and use go as nobody here is stopping you.
 
M

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.
 
T

Tim Chase

Am 25.09.2012 01:39 schrieb Dwight Hutto:

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.

As a beginning Pythonista, I found myself doing the same thing. I
implemented my own CSV parsing until I discovered how easy it was to
do with the built-in library. I implemented my own option-parsing
until I found optparse/argparse. I implemented config-files until I
found ConfigFile.

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 first stop before I
try implementing anything I think might have even a remote
possibility of being there.

-tkc
 
M

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 first stop before I
try implementing anything I think might have even a remote
possibility of being there.

-tkc

I find the above paragraph amusing given the recent discussion about the
Java singletonMap, i.e. it's someone that is rarely if ever needed but
core functionalities are missing, how strange.

I think the next port of call after the standard library should be pypi
followed by the search engine, possibly targetted at sites like github,
followed by a question here. I'm not certain about the next step, help
please.
 
C

Chris Angelico

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

Something got cut off. I wonder if Steven's computer's Power Supply
Unit just let off its magic smoke...

ChrisA
 
D

Dennis Lee Bieber

It was a humbling lesson to always check what features a programming
environment or language offers before reinventing the wheel with four
sides.

Especially since wheels with six sides work so much better (and only
require defining the value of Pi as 3 <G>)
 
D

Dennis Lee Bieber

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.
At least it isn't a chupacabra you need to get off...


{silliness seems to abound today -- maybe I got out of bed too
early}
 
P

Prasad, Ramit

Tim said:
[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, unless you meant
earlier than 2.6.

... print idx, x
...
10 0
11 1
12 2
13 3
14 4

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
 
R

Ramchandra Apte

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 Hutto

CEO: http://www.hitwebdevelopment.com

There are children (such as me) here!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top