plz help how to print python variable using os.system()

Grant Edwards grante at visi.com
Fri Jan 18 11:46:15 EST 2008


On 2008-01-16, Lutz Horn <lutz.horn at fastmail.fm> wrote:
> Hi,
>
> On Wed, 16 Jan 2008 05:29:08 -0800 (PST), jitender001001 at gmail.com said:
>>         var = "/home/anonymous"
>>         os.system("echo $var)
>
> os.system("echo %s" % var)

Though one wonders why one would do that instead of simply doing

print var

-- 
Grant Edwards                   grante             Yow! I'm ZIPPY the PINHEAD
                                  at               and I'm totally committed
                               visi.com            to the festive mode.



More information about the Python-list mailing list