Re: [Tutor] Python working with Bash....arrrggggh!

2012-08-24 Thread Steven D'Aprano
On 24/08/12 17:05, Ray Jones wrote: On 08/24/2012 12:02 AM, Steven D'Aprano wrote: On 24/08/12 16:27, Ray Jones wrote: I am forever confused, however, on which methods can be found where. I just spent quarter of an hour searching in sys,* os.*, and shutil.*. for a 'kill' command that I knew I

Re: [Tutor] Python working with Bash....arrrggggh!

2012-08-24 Thread Mark Lawrence
On 24/08/2012 08:02, Steven D'Aprano wrote: On 24/08/12 16:27, Ray Jones wrote: I am forever confused, however, on which methods can be found where. I just spent quarter of an hour searching in sys,* os.*, and shutil.*. for a 'kill' command that I knew I'd seen beforeI found it hidden in su

Re: [Tutor] Python working with Bash....arrrggggh!

2012-08-24 Thread Ray Jones
On 08/24/2012 12:02 AM, Steven D'Aprano wrote: > On 24/08/12 16:27, Ray Jones wrote: > >> I am forever confused, however, on which methods can be found where. I >> just spent quarter of an hour searching in sys,* os.*, and shutil.*. for >> a 'kill' command that I knew I'd seen beforeI found it

Re: [Tutor] Python working with Bash....arrrggggh!

2012-08-24 Thread Steven D'Aprano
On 24/08/12 16:27, Ray Jones wrote: I am forever confused, however, on which methods can be found where. I just spent quarter of an hour searching in sys,* os.*, and shutil.*. for a 'kill' command that I knew I'd seen beforeI found it hidden in subprocess.Popen. Arrrgggh. These various impor

Re: [Tutor] Python working with Bash....arrrggggh!

2012-08-23 Thread Ray Jones
On 08/23/2012 10:37 PM, eryksun wrote: > On Thu, Aug 23, 2012 at 11:55 PM, Ray Jones wrote: > >> For example, if I wish to test if a file exists, I might do >> >> test = Popen('[ -f file-i-want-to-test-for ]') >> >> But the moment I invoke Bash for a test, I must deal with the fact that >> Bash re

Re: [Tutor] Python working with Bash....arrrggggh!

2012-08-23 Thread Ray Jones
On 08/23/2012 09:53 PM, aklei...@sonic.net wrote: >> As I code Python, I find myself falling back on Bash to handle basic OS >> tasks. How do you gurus deal with Python --> Bash conflicts? >> >> For example, if I wish to test if a file exists, I might do >> >> test = Popen('[ -f file-i-want-to-test

Re: [Tutor] Python working with Bash....arrrggggh!

2012-08-23 Thread eryksun
On Thu, Aug 23, 2012 at 11:55 PM, Ray Jones wrote: > For example, if I wish to test if a file exists, I might do > > test = Popen('[ -f file-i-want-to-test-for ]') > > But the moment I invoke Bash for a test, I must deal with the fact that > Bash returns a zero for true and a non-zero for false.

Re: [Tutor] Python working with Bash....arrrggggh!

2012-08-23 Thread akleider
> As I code Python, I find myself falling back on Bash to handle basic OS > tasks. How do you gurus deal with Python --> Bash conflicts? > > For example, if I wish to test if a file exists, I might do > > test = Popen('[ -f file-i-want-to-test-for ]') > > But the moment I invoke Bash for a test, I

[Tutor] Python working with Bash....arrrggggh!

2012-08-23 Thread Ray Jones
As I code Python, I find myself falling back on Bash to handle basic OS tasks. How do you gurus deal with Python --> Bash conflicts? For example, if I wish to test if a file exists, I might do test = Popen('[ -f file-i-want-to-test-for ]') But the moment I invoke Bash for a test, I must deal wit