[Tutor] Not sure how to use external command within python code (3.6)

Alan Gauld alan.gauld at yahoo.co.uk
Sat Dec 7 14:41:43 EST 2019


On 07/12/2019 16:16, Robert Alexander wrote:

> process = subprocess.Popen(['/usr/local/bin/speedtest', '-f json'],

Sorry I haven't looked at this closely but it might be better to pass
the flag and value seperately:

process = subprocess.Popen(['/usr/local/bin/speedtest', '-f', 'json'],...

Just a thought,

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list