Re: [Tutor] *nix-specific Python Scripting [Off Topic]

2005-05-12 Thread ZIYAD A. M. AL-BATLY
On Thu, 2005-05-12 at 13:37 -0400, William O'Higgins wrote: > I am trying to learn Python by translating some of my Perl scripts. One > thing that is eluding me is assigning the results of system calls to > variables. Here's what I want to do in Perl: > > $isxrunning = `ps -C startx | gr

Re: [Tutor] *nix-specific Python Scripting

2005-05-12 Thread William O'Higgins
On Thu, May 12, 2005 at 09:37:03PM +0200, Roel Schroeven wrote: >William O'Higgins wrote: >> It is a simple check to see if the X server is running (this is >> inelegant, but it works - if you have a better way, I'd love to know >> about it, but I would like to be able to do things like this in Pyt

Re: [Tutor] *nix-specific Python Scripting

2005-05-12 Thread Roel Schroeven
William O'Higgins wrote: > It is a simple check to see if the X server is running (this is > inelegant, but it works - if you have a better way, I'd love to know > about it, but I would like to be able to do things like this in Python - > so I might better write scripts with it). Checking for star

Re: [Tutor] *nix-specific Python Scripting

2005-05-12 Thread Danny Yoo
On Thu, 12 May 2005, William O'Higgins wrote: > I am trying to learn Python by translating some of my Perl scripts. One > thing that is eluding me is assigning the results of system calls to > variables. Here's what I want to do in Perl: > > $isxrunning = `ps -C startx | grep "startx"`; >

[Tutor] *nix-specific Python Scripting

2005-05-12 Thread William O'Higgins
I am trying to learn Python by translating some of my Perl scripts. One thing that is eluding me is assigning the results of system calls to variables. Here's what I want to do in Perl: $isxrunning = `ps -C startx | grep "startx"`; if ($isxrunning =~ "startx") { do somet