[socal-piggies] What is your favorite Python stdlib module and why?

Jathan McCollum jathan at gmail.com
Fri Jun 17 14:23:36 PDT 2011


I'm going with optparse/argparse (optparse was recently deprecated by
argparse in 2.7.x and 3.2). I use it in pretty much every single
command-line tool I create (which in operations & engineering is A
LOT). The immense flexibility of this module in properly and
infallibly parsing command-line arguments is invaluable.

Having come from a long history of automating sysadmin tasks with Perl
and being forced to deal with Getopt::Long/Getopt::Std, having such a
robust and useful standard library to parse arguments is a godsend.

On Thu, Jun 16, 2011 at 7:02 PM, Andrew Kou <andrew.kou at gmail.com> wrote:
> Oh geez...where do I even start...
> First, I also have a love hate relationship with re., but I guess that's
> more because of regex than re itself. But over time I seen to have gotten
> better at identifying what I shouldn't use regex for. Hybrid regex solutions
> seems to be the most maintainable in a lot of cases.
> itertools, pprint, json, csv, contextlib makes me happy.
> urllib etc. is surprisingly useful at random times...
> There's just too much good stuff! I can't decide which my favorite is.
> - Andrew
> On Thu, Jun 16, 2011 at 6:07 PM, Alex Chang <maverick.chang at gmail.com>
> wrote:
>>
>> regexbuddy has made regex-ing alot quicker for me.  if you dont use
>> it, highly recommend checking it out.
>>
>> On Thursday, June 16, 2011, Daniel Greenfeld <pydanny at gmail.com> wrote:
>> > This is a tough one. I change my mind on it every day.
>> >
>> > Today my favorite is JSON because it lets me serialize data for
>> > storage or messages so trivially. And unlike Pickle everything in the
>> > world can read in a JSON file.
>> >
>> > Danny
>> >
>> > On Thu, Jun 16, 2011 at 5:22 PM, Christopher Mahan
>> > <chris.mahan at gmail.com> wrote:
>> >> I find that when I use regular expressions, I end up maintaining the
>> >> code,
>> >> cuz nobody else wants to touch it, so I avoid it.
>> >>
>> >> Christopher Mahan
>> >> 818.671.1709
>> >> chris.mahan at gmail.com
>> >> http://christophermahan.com
>> >>
>> >> On Jun 16, 2011 5:19 PM, "Grig Gheorghiu" <grig.gheorghiu at gmail.com>
>> >> wrote:
>> >>> I use regular expressions a lot in my code, so I have a love/hate
>> >>> relationship with the 're' module. It's not a favorite necessarily,
>> >>> but other than os and system it's probably the one I use most. This is
>> >>> one area of Python (probably the only area) that I wish was as
>> >>> polished as Perl's ;-)
>> >>>
>> >>> Grig
>> >>>
>> >>> _______________________________________________
>> >>> socal-piggies mailing list
>> >>> socal-piggies at lists.idyll.org
>> >>> http://lists.idyll.org/listinfo/socal-piggies
>> >>
>> >> _______________________________________________
>> >> socal-piggies mailing list
>> >> socal-piggies at lists.idyll.org
>> >> http://lists.idyll.org/listinfo/socal-piggies
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > 'Knowledge is Power'
>> > Daniel Greenfeld
>> > http://pydanny.com
>> > http://cartwheelweb.com
>> >
>> > _______________________________________________
>> > socal-piggies mailing list
>> > socal-piggies at lists.idyll.org
>> > http://lists.idyll.org/listinfo/socal-piggies
>> >
>>
>> _______________________________________________
>> socal-piggies mailing list
>> socal-piggies at lists.idyll.org
>> http://lists.idyll.org/listinfo/socal-piggies
>
>
> _______________________________________________
> socal-piggies mailing list
> socal-piggies at lists.idyll.org
> http://lists.idyll.org/listinfo/socal-piggies
>
>



-- 
Jathan.
--



More information about the socal-piggies mailing list