On Friday, 21 September 2012 02:37:01 UTC+5:30, gelonida wrote:
> I'd like to implement the equivalent functionality of the unix command
>
> /usr/bin/which
>
>
>
> The function should work under Linux and under windows.
>
>
>
> Did anybody already implement such a function.
>
> If not, is
On 21/09/12 04:31:17, Dave Angel wrote:
> On 09/20/2012 06:04 PM, Jason Swails wrote:
>> On Thu, Sep 20, 2012 at 5:06 PM, Gelonida N wrote:
>>
>>> I'd like to implement the equivalent functionality of the unix command
>>> /usr/bin/which
>>>
>>> The function should work under Linux and under window
On 9/21/12 1:59 AM, Nobody wrote:
On Thu, 20 Sep 2012 23:06:46 +0200, Gelonida N wrote:
I'd like to implement the equivalent functionality of the unix command
/usr/bin/which
The function should work under Linux and under windows.
Note that "which" attempts to emulate the behaviour of execvp()
On 2012.09.20 21:31, Dave Angel wrote:
> I don't have a Windows machine set up right now, but I believe there are
> two more directories to search, besides the ones described in the PATH
> variable.
>
> One is the current directory, and the other is the Windows directory
> (maybe also the xxx/syst
On 09/20/2012 06:04 PM, Jason Swails wrote:
> On Thu, Sep 20, 2012 at 5:06 PM, Gelonida N wrote:
>
>> I'd like to implement the equivalent functionality of the unix command
>> /usr/bin/which
>>
>> The function should work under Linux and under windows.
>>
>> Did anybody already implement such a fu
On Thu, 20 Sep 2012 23:06:46 +0200, Gelonida N wrote:
> I'd like to implement the equivalent functionality of the unix command
> /usr/bin/which
>
> The function should work under Linux and under windows.
Note that "which" attempts to emulate the behaviour of execvp() etc. The
exec(3) manpage wil
On 21/09/2012 00:15, Gelonida N wrote:
On 09/21/2012 12:04 AM, Jason Swails wrote:
Thanks a lot Jason,
I've used the following in programs I write:
def which(program):
def is_exe(fpath):
return os.path.exists(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split
On 09/21/2012 12:04 AM, Jason Swails wrote:
Thanks a lot Jason,
I've used the following in programs I write:
def which(program):
def is_exe(fpath):
return os.path.exists(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
if fpath:
if is_exe
On 09/21/2012 12:21 AM, Chris Angelico wrote:
On Fri, Sep 21, 2012 at 7:47 AM, Mark Lawrence wrote:
On 20/09/2012 22:06, Gelonida N wrote:
I'd like to implement the equivalent functionality of the unix command
/usr/bin/which
The function should work under Linux and under windows.
Did anybod
On Fri, Sep 21, 2012 at 8:32 AM, Ian Kelly wrote:
> On Thu, Sep 20, 2012 at 4:21 PM, Chris Angelico wrote:
>> os.sep is the directory separator, but os.pathsep may be what you
>> want. Between that and os.getenv('path') you can at least get the
>> directories. Then on Windows, you also need to ch
On Thu, Sep 20, 2012 at 4:21 PM, Chris Angelico wrote:
> os.sep is the directory separator, but os.pathsep may be what you
> want. Between that and os.getenv('path') you can at least get the
> directories. Then on Windows, you also need to check out
> os.getenv('pathext') and split _that_ on the s
On Fri, Sep 21, 2012 at 7:47 AM, Mark Lawrence wrote:
> On 20/09/2012 22:06, Gelonida N wrote:
>>
>> I'd like to implement the equivalent functionality of the unix command
>> /usr/bin/which
>>
>> The function should work under Linux and under windows.
>>
>> Did anybody already implement such a fun
On Thu, Sep 20, 2012 at 5:06 PM, Gelonida N wrote:
> I'd like to implement the equivalent functionality of the unix command
> /usr/bin/which
>
> The function should work under Linux and under windows.
>
> Did anybody already implement such a function.
> If not, is there a portable way of splittin
On 20/09/2012 22:06, Gelonida N wrote:
I'd like to implement the equivalent functionality of the unix command
/usr/bin/which
The function should work under Linux and under windows.
Did anybody already implement such a function.
Searching found nothing obvious to me :(
If not, is there a por
I'd like to implement the equivalent functionality of the unix command
/usr/bin/which
The function should work under Linux and under windows.
Did anybody already implement such a function.
If not, is there a portable way of splitting the environment variable PATH?
Thanks for any sugestions
--
15 matches
Mail list logo