On Dec 6, 5:00 am, Bertilo Wennergren <[EMAIL PROTECTED]> wrote:
> I'm planning to start learning Python now, using Python 3000.
> I have no previous Python skills, but I now Perl pretty well.
> I'm also well experienced with JavaScript.
>
> Any pointers and tips how
In article <[EMAIL PROTECTED]>,
Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Sat, 06 Dec 2008 08:50:20 -0500, Roy Smith wrote:
>
> > For your first
> > project, pick something that's small enough that you think you could
> > tackle it in under 50 lines of Perl.
>
> Is there anything which *c
News123 wrote:
What's more painful is to learn which functianilty is in which library
and which library exists.
Yes and one mistake I still often find myself doing is, when confronted
with a particular problem, that I write some helper code to deal with
it. Of course later on I discover tha
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Aahz)
wrote:
> In article <[EMAIL PROTECTED]>,
> Bertilo Wennergren <[EMAIL PROTECTED]> wrote:
> >
> >I don't suppose there is any introductory material out there that is
> >based on Python 3000 and that is also geared at people with a Perl
> >b
e"
And there's of course this newsgroup whenever you're stuck with a
'missing' feature, (though mostly the features aren't missing, but just
a little different)
bye
N
Roy Smith wrote:
> In article <[EMAIL PROTECTED]>,
> Bertilo Wennergren <[EMAIL
In article <[EMAIL PROTECTED]>,
Bertilo Wennergren <[EMAIL PROTECTED]> wrote:
>
>I don't suppose there is any introductory material out there that is
>based on Python 3000 and that is also geared at people with a Perl
>background? Too early for that I guess..
Honestly, the differences between 2.x
On Sat, 06 Dec 2008 08:50:20 -0500, Roy Smith wrote:
> For your first
> project, pick something that's small enough that you think you could
> tackle it in under 50 lines of Perl.
Is there anything which *can't* be written in under 50 lines of Perl?
:-)
> One of the very first things you'll pr
Bertilo Wennergren wrote:
Roy Smith wrote:
Bertilo Wennergren <[EMAIL PROTECTED]> wrote:
I'm planning to start learning Python now, using Python 3000.
I have no previous Python skills, but I now Perl pretty well.
I'm also well experienced with JavaScript.
Any pointer
Roy Smith wrote:
Bertilo Wennergren <[EMAIL PROTECTED]> wrote:
I'm planning to start learning Python now, using Python 3000.
I have no previous Python skills, but I now Perl pretty well.
I'm also well experienced with JavaScript.
Any pointers and tips how I should go ab
In article <[EMAIL PROTECTED]>,
Bertilo Wennergren <[EMAIL PROTECTED]> wrote:
> I'm planning to start learning Python now, using Python 3000.
> I have no previous Python skills, but I now Perl pretty well.
> I'm also well experienced with JavaScript.
>
>
I'm planning to start learning Python now, using Python 3000.
I have no previous Python skills, but I now Perl pretty well.
I'm also well experienced with JavaScript.
Any pointers and tips how I should go about getting into
Python?
--
Bertilo Wennergren <http://bertilow
I like two 1. www.diveintopython.com and 2. Core Python Programming.
On Mon, Sep 8, 2008 at 6:15 AM, Alan G Isaac <[EMAIL PROTECTED]> wrote:
> On 9/6/2008 5:17 AM James Pilling apparently wrote:
>
>> Hi im currently starting to learn python in sixth form at school any tips?
>>
>
> The books sugge
On 9/6/2008 5:17 AM James Pilling apparently wrote:
Hi im currently starting to learn python in sixth form at school any tips?
The books suggestions of others are quite good.
Here is another approach: pick an easily understandable
application, and work doing things with it.
Perhaps immodestly,
James,
I have several Python books and am currently working my way through John
Zelle's PYTHON PROGRAMMING: An Introduction to Computer Science
(Publisher: Franklin, Beedle & Associates, ISBN-10: 1887902996, ISBN-13:
978-1887902991). I think this is a very good introduction to both Python
AND
James Pilling wrote:
Hi im currently starting to learn python in sixth form at school any tips?
GET FREE 5GB EMAIL - Check out spam free email with many cool features!
Visit http://www.inbox.com/email to find out more!
There are sugges
On Sep 6, 3:17 pm, James Pilling <[EMAIL PROTECTED]> wrote:
> Hi im currently starting to learn python in sixth form at school any tips?
>
Just pickup a good book and make sure you code all the examples and
exercises yourself, even if it seems easy.
Have fun with Python!
regards,
Subeen.
http://l
Hi im currently starting to learn python in sixth form at school any tips?
GET FREE 5GB EMAIL - Check out spam free email with many cool features!
Visit http://www.inbox.com/email to find out more!
--
http://mail.python.org/mailman/listi
Hi Edward,
I like "Dive into Python" because it's been written for people who
know programming with other languages. This could be an advantage or a
disadvantage, if you feel really uncomfortable reading Python code (if
you can't imagine absolutly nothing about what it does), my advice is
to choos
gt; wrote:
>
> > > > Which computer books are the best to begin learning Python 2.5 with?
> > > > I've heard that Learning Python 3rd Edition is a good choice - can
> > > > anyone give any more advice on this?
>
> > > > Thanks.
>
> &
On Aug 7, 1:12 pm, Beliavsky <[EMAIL PROTECTED]> wrote:
> On Aug 6, 4:08 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote:
>
> > On Aug 6, 2:56 pm, Edward Cormier <[EMAIL PROTECTED]> wrote:
>
> > > Which computer books are the best to begin learning Pytho
Dnia Thu, 7 Aug 2008 11:12:03 -0700 (PDT), Beliavsky napisa�(a):
> I have the 2nd edition. Has the 3rd edition been rewritten so that all
> of its code will be valid in Python 3? I'd prefer not to buy Python
> books that will become obsolete.
I guess it's for Python 2.x, but I wouldn't worry about
Dnia Thu, 7 Aug 2008 12:37:55 -0700 (PDT), Samir napisa�(a):
> Some good online tutorials that I found really helpful include:
You might find it useful:
http://linkmingle.com/list/List-of-Free-Online-Python-Books-freebooksandarticles
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa
> > There's lots of good books to read, including a few online ones. A lot
> > of people like "Dive Into Python" (http://diveintopython.org/). If you
> > want LOTS of information and some good code examples, Lutz's
> > "Programming Python 3rd Ed" is great.
>
> I have the 2nd edition. Has the 3rd ed
On Aug 6, 4:08 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote:
> On Aug 6, 2:56 pm, Edward Cormier <[EMAIL PROTECTED]> wrote:
>
> > Which computer books are the best to begin learning Python 2.5 with?
> > I've heard that Learning Python 3rd Edition is a good ch
On Aug 6, 2:56 pm, Edward Cormier <[EMAIL PROTECTED]> wrote:
> Which computer books are the best to begin learning Python 2.5 with?
> I've heard that Learning Python 3rd Edition is a good choice - can
> anyone give any more advice on this?
>
> Thanks.
There's lots o
Which computer books are the best to begin learning Python 2.5 with?
I've heard that Learning Python 3rd Edition is a good choice - can
anyone give any more advice on this?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Simple. dir(object)
[EMAIL PROTECTED] wrote:
> I am new to python .But interest in it .
> I think if python could provide a method that show every method of an
> object or an module.it will be great! We can save a lot of time to
> find the document
>
I am new to python .But interest in it .
I think if python could provide a method that show every method of an
object or an module.it will be great! We can save a lot of time to
find the document
take win32com as an example:
if code like this
"win32com.query"(or some other name that means query)
it
Taygun Kekec wrote:
hi guys.
I would be glad to join your group because i want to learn deeper
python but i am frustrated of isolation too. It would provide
stimulation and encourage to study and will boost our desire to learn.
So count me in!
hello all,
I just started studying python myself a
hi guys.
I would be glad to join your group because i want to learn deeper
python but i am frustrated of isolation too. It would provide
stimulation and encourage to study and will boost our desire to learn.
So count me in!
--
http://mail.python.org/mailman/listinfo/python-list
I guess it's time to choose what a project your group will work at.
Personally, I'm working at the project relating to text analysis, but
it's rather specific because I use Russian texts. So, maybe we should
to choose more 'international' implementation.
-Ed
--
http://mail.python.org/mailman/listin
On Jun 23, 1:12 pm, Mensanator <[EMAIL PROTECTED]> wrote:
> On Jun 22, 5:43�am, "Jonathan Roberts" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Hi all,
>
> > I'm looking to learn Python (as my first programming language) and I'm
> > pretty sure I'd be more successful doing this with a group of other
> >
On Jun 22, 5:43�am, "Jonathan Roberts" <[EMAIL PROTECTED]>
wrote:
> Hi all,
>
> I'm looking to learn Python (as my first programming language) and I'm
> pretty sure I'd be more successful doing this with a group of other
> people.
>
> I've currently got one other person to learn with me, and we pla
You can count me in too.I've been into python for sometime now.
I agree that a collaborative learning makes it fun and helps you reach
your goal faster.
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 22 Jun 2008 08:44:25 -0500, Saul Spatz wrote:
> macoovacany wrote:
>> http://macoovacany.wordpress.com/
> When I tried to run it, I got all kinds of syntax errors because of
> non-ASCII characters; namely, you have fancy left and right single and
> double quotes.
That's probably WordPress
I would like to be a part of this if enough people are able to join
up, I nabbed python less than two days ago, and have been trying to
absorb as much as I can out of websites and practice projects.
Learning this together would speed up the process slightly because we
could share tips and such, all
I might be interested in joining your group. I'm trying to learn
python, too, but tend to get frustrated by the isolation. can you
send me, or post, some details?
- O
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 22, 3:43 am, "Jonathan Roberts" <[EMAIL PROTECTED]>
wrote:
> Hi all,
>
> I'm looking to learn Python (as my first programming language) and I'm
> pretty sure I'd be more successful doing this with a group of other
> people.
hi Jon, I'm in the same situation as you and think a co-op method o
> I'm sure that many (myself included) would be happy to help out, but
> due to timezone differences, working hours, etc you may only get
> responses up to 24 hours (or more) later.
Awesome, heh I'm sure we'll have questions for the list in good time :)
>
> What needs does your (non-face-to-face)
macoovacany wrote:
http://macoovacany.wordpress.com/
When I tried to run it, I got all kinds of syntax errors because of
non-ASCII characters; namely, you have fancy left and right single
and double quotes. Once I replaced these with the ASCII equivalents,
it worked fine. I suggest you use a
On Sun, Jun 22, 2008 at 1:52 PM, Jonathan Roberts
<[EMAIL PROTECTED]> wrote:
>> If you want people to meet with you (in person) as a mentor you should
>> probably ask on your local Python or Linux users group mailing list.
>
> We're not really too worried about doing it in person - mostly because
>
> If you want people to meet with you (in person) as a mentor you should
> probably ask on your local Python or Linux users group mailing list.
We're not really too worried about doing it in person - mostly because
the people doing it so far are all at least 1000 miles away from each
other :)
Bes
On Sun, Jun 22, 2008 at 12:43 PM, Jonathan Roberts
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm looking to learn Python (as my first programming language) and I'm
> pretty sure I'd be more successful doing this with a group of other
> people.
>
> I've currently got one other person to learn with me
I'm a beginner, too.But python wasn't my first programming language.
On Sun, Jun 22, 2008 at 6:43 PM, Jonathan Roberts <[EMAIL PROTECTED]>
wrote:
> Hi all,
>
> I'm looking to learn Python (as my first programming language) and I'm
> pretty sure I'd be more successful doing this with a group of ot
Hi all,
I'm looking to learn Python (as my first programming language) and I'm
pretty sure I'd be more successful doing this with a group of other
people.
I've currently got one other person to learn with me, and we plan to
work remotely over the net using tools such as IM/VoiP/Gobby/WIkis
etc. W
http://macoovacany.wordpress.com/
--
http://mail.python.org/mailman/listinfo/python-list
Hello all,
I'm trying to learn various programming languages (I did MATLAB at
uni), and have decided to start with Python. The programming exercises
are derived from Larry O'brien's http://www.knowing.net/
PermaLink,guid,f3b9ba36-848e-43f8-9caa-232ec216192d.aspx">15
Programming Exercises . First
I decided to learn Python.
I decided to learn Python because I hate visual basic for applications and I
can feel my brain shrink everytime I invoke that freaking macro editor.
It's bad enough that Mwfdg [EMAIL PROTECTED] <[EMAIL PROTECTED]> had to
eliminate the
original simple keystroke macro to
John Salerno wrote:
Just something that crosses my mind every time I delve into "Learning
Python" each night. Does anyone see any value in learning Python when you
don't need to for school, work, or any other reason? I mean, sure, there's
value in learning anything
Martin v. Löwis wrote:
> OTOH: do you plan to do any programming at all, in your
> life? If yes: consider using Python for every programming
> task you'll encounter
Yeah, I do plan to use it for fun (if I can think of little projects to
work on!), and Python is definitely the only language I care
notbob wrote:
> On 2008-05-12, John Salerno <[EMAIL PROTECTED]> wrote:
>
>> language, I can't help but feel that I will be mostly unable to use what I
>> learn simply because I have no reason to use it.
>
>> The *process* of learning is enough fun for me, and every now and then I do
>> find a sm
Matthew Woodcraft wrote:
> I can't tell from what you wrote whether you feel you won't have any
> reason to do any programming, or whether you already know several other
> programming languages and you feel you won't have any reason to use
> Python in particular.
Definitely the former. I've loved
On May 13, 5:50 am, JustMe <[EMAIL PROTECTED]> wrote:
> I'm in the same boat. My work seems fixated with .Net but IMHO I think
> they would be better off going with Python. Still, who am I to stand
> in the way of hundreds of .Net programmers.
You could always be the hero who teaches them IronPyth
n sake, or
> they're using it for something.
>
> If it is a silly endeavor, I'm going to have to ask you to stop this
> thread, it's too silly.
>
> -Chuckk
>
>
>
>
>
> On Mon, May 12, 2008 at 8:27 PM, John Salerno <[EMAIL PROTECTED]> wrot
it for something.
If it is a silly endeavor, I'm going to have to ask you to stop this
thread, it's too silly.
-Chuckk
On Mon, May 12, 2008 at 8:27 PM, John Salerno <[EMAIL PROTECTED]> wrote:
> Just something that crosses my mind every time I delve into "Learning
> Pyth
On May 12, 1:27 pm, "John Salerno" <[EMAIL PROTECTED]> wrote:
> Just something that crosses my mind every time I delve into "Learning
> Python" each night. Does anyone see any value in learning Python when you
> don't need to for school, work, or any other
ay, 20:02, Mensanator <[EMAIL PROTECTED]> wrote:
>
> I'm in the same boat. My work seems fixated with .Net but IMHO I think
> they would be better off going with Python. Still, who am I to stand
> in the way of hundreds of .Net programmers.
>
> However, learning Python in the
John Salerno <[EMAIL PROTECTED]> wrote:
> Just something that crosses my mind every time I delve into "Learning
> Python" each night. Does anyone see any value in learning Python when you
> don't need to for school, work, or any other reason? I mean, sure, there
On 12 May, 20:02, Mensanator <[EMAIL PROTECTED]> wrote:
> On May 12, 12:27 pm, "John Salerno" <[EMAIL PROTECTED]> wrote:
>
> > Just something that crosses my mind every time I delve into "Learning
> > Python" each night. Does anyone see any value
2008/5/12 Grant Edwards <[EMAIL PROTECTED]>:
> For windows/unix hosted user-space applications, Python is
> pretty hard to beat.
Apparently, pythons _can_ be beat: (warning: graphic)
http://www.proexotics.com/graphics/ball_python_live_prey_1.jpg
Dotan Cohen
http://what-is-what.com
http://gibberi
On May 12, 12:27 pm, "John Salerno" <[EMAIL PROTECTED]> wrote:
> Just something that crosses my mind every time I delve into "Learning
> Python" each night. Does anyone see any value in learning Python when you
> don't need to for school, work, or any other
On May 12, 12:27 pm, "John Salerno" <[EMAIL PROTECTED]> wrote:
> The *process* of learning is enough fun for me, and every now and then I do
> find a small use for Python that really pays off, but for the most part I'm
> wondering what people's thoughts are as far as simply learning it for the
> s
On 2008-05-12, John Salerno <[EMAIL PROTECTED]> wrote:
> language, I can't help but feel that I will be mostly unable to use what I
> learn simply because I have no reason to use it.
> The *process* of learning is enough fun for me, and every now and then I do
> find a small use for Python that
On 2008-05-12, Martin v. L?wis <[EMAIL PROTECTED]> wrote:
> OTOH: do you plan to do any programming at all, in your
> life? If yes: consider using Python for every programming
> task you'll encounter - unless there are outside constraints
> demanding a different language. Python is flexible enough
> Hopefully this question even makes sense!
I completely agree that you don't need to spend time on
learning a language if you don't plan on using it; I'll
leave alone the entire discussion of doing things for fun
only (you don't *need* to eat ice cream, either - right?)
OTOH: do you plan to do
Just something that crosses my mind every time I delve into "Learning
Python" each night. Does anyone see any value in learning Python when you
don't need to for school, work, or any other reason? I mean, sure, there's
value in learning anything at any time, but for somethin
[EMAIL PROTECTED] wrote:
> On Apr 1, 2:42 pm, "Eduardo O. Padoan" <[EMAIL PROTECTED]>
> wrote:
>> On Tue, Apr 1, 2008 at 4:20 PM, <[EMAIL PROTECTED]> wrote:
>
>>> You misunderstand. C++ has a lot of "warts" to maintain backwards
>>> compatibility with C. The standards committee could eliminat
En Tue, 01 Apr 2008 15:57:21 -0300, <[EMAIL PROTECTED]> escribió:
> On Apr 1, 12:47 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
> wrote:
>> Please explain how the existence of Python 3.0 would break your
>> production
>> code.
>
> The existence of battery acid won't hurt me either, unless I co
as the
> computers at my workplace only sport the python interpreter, it probably
> means that learning python will end up serving me better, at least in the
> short run. Plus, you know how Perl goes.
>
> So far the decision seems to be a no brainer. Yet, Python 3000 will arrive
On Apr 1, 2:42 pm, "Eduardo O. Padoan" <[EMAIL PROTECTED]>
wrote:
> On Tue, Apr 1, 2008 at 4:20 PM, <[EMAIL PROTECTED]> wrote:
> > You misunderstand. C++ has a lot of "warts" to maintain backwards
> > compatibility with C. The standards committee could eliminate these
> > warts to make the l
>
>
> > > Backward compatibility is important. C++ could break all ties with
> C
> > > to "clean up" as well, but it would be a braindead move that would
> > > break existing code bases upon upgrade.
> >
> > C++ is not C. No one "upgrades" from C to C++.
>
> You misunderstand. C++ has a lot o
On Tue, Apr 1, 2008 at 4:20 PM, <[EMAIL PROTECTED]> wrote:
> > > > Please explain how the existence of Python 3.0 would break your
> production
> > > > code.
> >
> > > The existence of battery acid won't hurt me either, unless I come into
> > > contact with it. If one eventually upgrades
On Apr 1, 2:11 pm, "Eduardo O. Padoan" <[EMAIL PROTECTED]>
wrote:
> On Tue, Apr 1, 2008 at 3:57 PM, <[EMAIL PROTECTED]> wrote:
> > On Apr 1, 12:47 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
> > wrote:
> > > En Tue, 01 Apr 2008 13:57:55 -0300, <[EMAIL PROTECTED]> escribió:
>
> > > > On Mar 31,
On Tue, Apr 1, 2008 at 3:57 PM, <[EMAIL PROTECTED]> wrote:
> On Apr 1, 12:47 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
> wrote:
> > En Tue, 01 Apr 2008 13:57:55 -0300, <[EMAIL PROTECTED]> escribió:
>
> >
> > > On Mar 31, 1:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
> > > wrote:
> >
> >
On Apr 1, 12:47 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Tue, 01 Apr 2008 13:57:55 -0300, <[EMAIL PROTECTED]> escribió:
>
> > On Mar 31, 1:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
> > wrote:
>
> >> Don't be scared by the "backwards incompatible" tag - it's the way to
> >> get
En Tue, 01 Apr 2008 13:57:55 -0300, <[EMAIL PROTECTED]> escribió:
> On Mar 31, 1:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
> wrote:
>
>> Don't be scared by the "backwards incompatible" tag - it's the way to
>> get
>> rid of nasty things that could not be dropped otherwise.
>
> I would con
On Mar 31, 1:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> Don't be scared by the "backwards incompatible" tag - it's the way to get
> rid of nasty things that could not be dropped otherwise.
I would consider breaking production code to be "nasty" as well.
--
http://mail.python.org/m
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of Ant
> Sent: Monday, March 31, 2008 5:58 PM
> To: python-list@python.org
> Subject: Re: Is this a good time to start learning python?
>
> On Mar 31, 5:40 pm, Rui
After reading all replies I've decided to keep the subscription to this
group, crank up the tutorials and start getting my head around Python.
Thanks for all the helpful replies. Kudos, everyone!
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
| tutorials and wrote a couple of irrelevant pet projects) but, as the
> | computers at my workplace only sport the python interpreter, it probably
> | means that learning python will end up serving me better, at least in the
> | short run. Plus, you know how Perl goes.
>
> If you i
efore migrating to 3k.
In addition, the 2.x branch is AFAIK going to be maintained up to (but
no further than) a 2.9 release. So there will be plenty of time to
adjust!
In short, any time invested in learning Python at this stage (except
perhaps old-style classes as pointed out above) will be time
pet projects) but, as the
| computers at my workplace only sport the python interpreter, it probably
| means that learning python will end up serving me better, at least in the
| short run. Plus, you know how Perl goes.
If you intend to use Python on the computer at your workplace, then learn
t
levant pet projects) but, as the
> computers at my workplace only sport the python interpreter, it probably
> means that learning python will end up serving me better, at least in the
> short run. Plus, you know how Perl goes.
>So far the decision seems to be a no brainer. Yet, Python 30
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of Rui Maciel
> Sent: Monday, March 31, 2008 12:41 PM
> To: python-list@python.org
> Subject: Is this a good time to start learning python?
>
> Recently I woke up incline
means that learning python will end up serving me better, at least in the
short run. Plus, you know how Perl goes.
So far the decision seems to be a no brainer. Yet, Python 3000 will arrive
in a few months. As it isn't backwards compatible with today's Python,
there is the risk that no
Mike Meyer <[EMAIL PROTECTED]> writes:
> On 11 Jan 2008 03:50:53 -0800 Paul Rubin <"http://phr.cx"@NOSPAM.invalid>
> wrote:
>
>> rent <[EMAIL PROTECTED]> writes:
>> > keys = freq.keys()
>> > keys.sort(key = freq.get, reverse = True)
>> > for k in keys:
>> > print "%-10s: %d" % (k, freq[k])
>
On 11 Jan 2008 03:50:53 -0800 Paul Rubin <"http://phr.cx"@NOSPAM.invalid> wrote:
> rent <[EMAIL PROTECTED]> writes:
> > keys = freq.keys()
> > keys.sort(key = freq.get, reverse = True)
> > for k in keys:
> > print "%-10s: %d" % (k, freq[k])
>
> I prefer (untested):
>
> def snd((x,y)): ret
rent <[EMAIL PROTECTED]> writes:
> keys = freq.keys()
> keys.sort(key = freq.get, reverse = True)
> for k in keys:
> print "%-10s: %d" % (k, freq[k])
I prefer (untested):
def snd((x,y)): return y # I wish this was built-in
sorted_freq = sorted(freq.iteritems(), key=snd, reverse=True)
[k])
On Jan 9, 6:58 pm, Andrew Savige <[EMAIL PROTECTED]> wrote:
> I'm learning Python by reading David Beazley's "Python Essential Reference"
> book and writing a few toy programs. To get a feel for hashes and sorting,
> I set myself this little problem today
Paul Hankin a écrit :
> On Jan 9, 12:19 pm, Bruno Desthuilliers [EMAIL PROTECTED]> wrote:
>> Andrew Savige a écrit :
>>> and the -x hack above to
>>> achieve a descending sort feels a bit odd to me, though I couldn't think
>>> of a better way to do it.
>> The "other" way would be to pass a custom
MRAB a écrit :
> On Jan 9, 12:19 pm, Bruno Desthuilliers [EMAIL PROTECTED]> wrote:
(snip)
> That actually prints:
>
> kevin : 3
> fred : 2
> jock : 2
> andrew : 1
> bill : 1
> freddy : 1
>
> It says that "fred" occurs twice because of "freddy".
oops ! My bad, didn
On Jan 9, 12:19 pm, Bruno Desthuilliers wrote:
> Andrew Savige a écrit :
> > and the -x hack above to
> > achieve a descending sort feels a bit odd to me, though I couldn't think
> > of a better way to do it.
>
> The "other" way would be to pass a custom comparison callback to sort,
> which would
On Jan 9, 12:19 pm, Bruno Desthuilliers wrote:
> Andrew Savige a écrit :
>
>
>
> > I'm learning Python by reading David Beazley's "Python Essential Reference"
> > book and writing a few toy programs. To get a feel for hashes and sorting,
> > I
Ant a écrit :
>> I'm interested to learn how more experienced Python folks would solve
>> this little problem.
>
> I think I'd do the following:
>
> from collections import defaultdict
>
> names = "freddy fred bill jock kevin andrew kevin kevin jock"
> freq = defaultdict(lambda: 0)
>
> for name
Andrew Savige wrote:
> Fredrik Lundh wrote:
>
>># sort items on descending count
>>deco = sorted(freq.items(), key=lambda x: -x[1])
>
> Neat. Is there any way to use sorted() with multiple sort keys? ...
> Given that the spec calls for sorting by _two_ keys: first by
> frequency (descend
Andrew Savige a écrit :
> I'm learning Python by reading David Beazley's "Python Essential Reference"
> book and writing a few toy programs. To get a feel for hashes and sorting,
> I set myself this little problem today (not homework, BTW):
>
> Given a strin
Andrew Savige wrote:
> Neat. Is there any way to use sorted() with multiple sort keys? ...
sure! just return the "composite key" as a tuple:
# sort on descending count, ascending name
deco = sorted(freq.items(), key=lambda x: (-x[1], x[0]))
(when comparing tuples, Python first compares
Fredrik Lundh wrote:
># sort items on descending count
>deco = sorted(freq.items(), key=lambda x: -x[1])
Neat. Is there any way to use sorted() with multiple sort keys? ...
Given that the spec calls for sorting by _two_ keys: first by
frequency (descending), then by name (ascending). To c
Andrew Savige wrote:
> I'm learning Python by reading David Beazley's "Python Essential
> Reference" book and writing a few toy programs. To get a feel for hashes
> and sorting, I set myself this little problem today (not homework, BTW):
>
> Given a string c
> I'm interested to learn how more experienced Python folks would solve
> this little problem.
I think I'd do the following:
from collections import defaultdict
names = "freddy fred bill jock kevin andrew kevin kevin jock"
freq = defaultdict(lambda: 0)
for name in names.split():
freq[name]
301 - 400 of 584 matches
Mail list logo