basic python-unix question

phil hunt philh at comuno.freeserve.co.uk
Thu Jul 19 13:46:03 CEST 2001


On 18 Jul 2001 22:38:54 GMT, Quinn Dunkan <quinn at yak.ugcs.caltech.edu> wrote:
>
>Yes.  Automatic substitution does not take place at all.  Strings will never
>change their contents.

Quite right too! if you want sustitution, use P*rl!

>There are many functions that operate on strings, though.
>
>You can concatenate strincgs with (+):
>    'ps ef | grep ' + eachProcess
>
>You can interpolate strings with (%):
>    'ps ef | grep %s' % eachProcess
>
>Read the docs for more.
>
>As an aside, the above os.system is not a very good way to check for running
>processes (you want a >/dev/null in there at least, not to mention that it
>will break if you move it to a bsd). 

Because BSD doesn't like ``ps ef''? Or because there's a problem 
with os.system()?


-- 
#===== Philip Hunt == philh at comuno.freeserve.co.uk ======#
    Herbivore: effort-free public key encryption. See:
<http://www.vision25.demon.co.uk/oss/herbivore/intro.html>
        ** First software release coming soon! **






More information about the Python-list mailing list