[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Why is C so popular?



On Thu, 28 Aug 2003 05:09:03 -0500
Ron Johnson <ron.l.johnson@cox.net> wrote:
> On Thu, 2003-08-28 at 02:04, Steve Lamb wrote:
> > On Thu, 28 Aug 2003 01:51:23 -0500
> > Alex Malinovich <demonbane@the-love-shack.net> wrote:
> [snip]
> >     Of course now step 1 has been replaced with "rewrite in Python".  I
> >     still
> > have Perl coursing through my veins though.  The other day I caught myself
> > trying to upper(s) a string instead of string.upper().  The deciding day
> > that
 
> There's an even quicker way, that's even OO:
> >>> import string
> >>> s = 'foo'
> >>> s.upper()
> 'FOO'

    Well, actually, as of 2.1 or so that isn't needed.  All the methods from
string are already applicable to strings.  Hence..

> > trying to upper(s) a string instead of string.upper().  The deciding day
                                           ^^^^^^^^^^^^^^^

    :)

> > Python.  All I gotta say is that os.path.walk() is a godsend.  :)
 
> As are, IMO, 
>  .isabs()
>  .isfile()
>  .isdir()
>  .islink()
>  .ismount()
>  .realpath()

    .basepath() is fun too.  Fun with symlinks!  :)

name = os.path.basename(sys.argv[0])
if (name == 'spam' or name == 'ham'):
    sa_learn = '/usr/bin/sudo -u mail /usr/bin/sa-learn --%s --file *' %
                (name)


-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
       PGP Key: 8B6E99C5       | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------

Attachment: pgpaVvu1lNNme.pgp
Description: PGP signature


Reply to: