I must be missing something obvious: os.path.isexecutable?

Steve Lamb grey at despair.rpglink.com
Thu Jan 18 16:22:06 EST 2001


    OK, working on converting a friend's Perl script to configure network/X
configuration based on the configuratio of the computer at the time of boot to
Python.  I'm stumped by what seems to be something that should be simple in
Python but is not.

Perlism:

if ((-l "$xbin_dir/X) && (-x "$xbin_dir/X.linux)){
  blahblahblah
}

Python:

if (os.path.islink('%sXF86Config' % ($xconfigdir)) and ???????):
  blahblahblah

    I cannot, for the life of me, find a comparable call in Python to replace
the -x call in Perl.  The closest I have come is doing an os.stat() call on
the file in question and then doing a painful parsing of the mode itself.  I
would have thought there would have been a comparable call in os.path or os
but there is not.  Also looked into os.stat() to see if there was something I
was missing there, no go.  Finally checked the FAQs on www.python.org and
tried to do a check on deja.com to no avail.  Am I just missing something
painfully obvious?

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
         ICQ: 5107343          | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------



More information about the Python-list mailing list