basic python-unix question

Kalle Svensson kalle at gnupung.net
Wed Jul 18 18:18:28 EDT 2001


Sez Ed T:
> import os, sys
> process = ("test1", "test2")
> 
> for eachProcess in process:
>      os.system('ps ef | grep eachProcess')

That last line should be
    os.system('ps ef | grep %s' % eachProcess)
or
    os.system('ps ef | grep ' + eachProcess)

Peace,
  Kalle
-- 
Email: kalle at gnupung.net     | You can tune a filesystem, but you
Web: http://www.gnupung.net/ | can't tune a fish. -- man tunefs(8)
PGP fingerprint: 0C56 B171 8159 327F 1824 F5DE 74D7 80D7 BF3B B1DD
 [ Not signed due to lossage.  Blame Microsoft Outlook Express. ]




More information about the Python-list mailing list