On 2010-07-14, Steven W. Orr wrote:
> On 07/12/10 21:29, quoth Kenny Meyer:
>
>> I have to figure out if a string is callable on a Linux system. I'm
>> actually doing this:
>>
>> def is_valid_command(command):
>> retcode = 100 # initialize
>> if command:
>> retcode
On 07/12/10 21:29, quoth Kenny Meyer:
> Hello,
>
> I have to figure out if a string is callable on a Linux system. I'm
> actually doing this:
>
> def is_valid_command(command):
> retcode = 100 # initialize
> if command:
> retcode = subprocess.call(command, shell=Tr
On Jul 13, 4:14 pm, Hans Mulder wrote:
> Chris Rebert wrote:
> > `where` seems to be a zsh built-in:
> > $ # I'm in UR bash
> > $ nonexistent
> > -bash: nonexistent: command not found
> > $ where bash
> > -bash: where: command not found
>
> > And not everyone has zsh installed, so...
> > I don't s
On Tue, Jul 13, 2010 at 6:59 AM, Kenny Meyer wrote:
> Hello,
>
> I have to figure out if a string is callable on a Linux system. I'm
> actually doing this:
>
>def is_valid_command(command):
>retcode = 100 # initialize
>if command:
>retcode = subprocess.call(command
Chris Rebert (c...@rebertia.com) wrote:
> On Mon, Jul 12, 2010 at 6:29 PM, Kenny Meyer wrote:
> > Hello,
> >
> > I have to figure out if a string is callable on a Linux system. I'm
>
> "callable" seems vague. Is a command string with invalid arguments but
> a valid executable "callable"? If no, t
Chris Rebert wrote:
`where` seems to be a zsh built-in:
$ # I'm in UR bash
$ nonexistent
-bash: nonexistent: command not found
$ where bash
-bash: where: command not found
And not everyone has zsh installed, so...
I don't see why one shouldn't use the standard `which` *nix command instead.
Be
On Tue, Jul 13, 2010 at 4:33 AM, Jean-Michel Pichavant
wrote:
> Kenny Meyer wrote:
>> I have to figure out if a string is callable on a Linux system. I'm
>> actually doing this:
>>
>> def is_valid_command(command):
>> retcode = 100 # initialize
>> if command:
>> retcode
Kenny Meyer wrote:
Hello,
I have to figure out if a string is callable on a Linux system. I'm
actually doing this:
def is_valid_command(command):
retcode = 100 # initialize
if command:
retcode = subprocess.call(command, shell=True)
if retcode is 0:
Kenny Meyer wrote:
>
>I have to figure out if a string is callable on a Linux system. I'm
>actually doing this:
>...
>Never mind the code, because this is not the original.
>The side effect of subprocess.call() is that it *actually* executes
>it, but I just need the return code. What are better wa
On Mon, Jul 12, 2010 at 6:29 PM, Kenny Meyer wrote:
> Hello,
>
> I have to figure out if a string is callable on a Linux system. I'm
"callable" seems vague. Is a command string with invalid arguments but
a valid executable "callable"? If no, then there's no general way to
test "callability" witho
10 matches
Mail list logo