How do I pass a variable to os.popen?

Dan M catdude at gmail.com
Mon Oct 31 16:40:20 EDT 2011


On Mon, 31 Oct 2011 13:16:25 -0700, extraspecialbitter wrote:


>     cmd = 'ethtool %interface'

Do you perhaps mean:

    cmd = 'ethtool %s' % (interface, )



More information about the Python-list mailing list