
{"id":16961,"date":"2018-03-06T15:34:37","date_gmt":"2018-03-06T15:34:37","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=16961"},"modified":"2018-03-06T15:34:37","modified_gmt":"2018-03-06T15:34:37","slug":"calling-an-external-command-in-python","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2018\/03\/06\/calling-an-external-command-in-python\/","title":{"rendered":"Calling an external command in Python"},"content":{"rendered":"<pre>\n$pwd\n\/home\/jeffrin\/beautifulwork\/github\n$ls\nbeautifulwork-github.php  beautifulwork-github.py\n$ls -l\ntotal 8\n-rw-r--r-- 1 jeffrin jeffrin  414 Dec 10  2016 beautifulwork-github.php\n-rw-r--r-- 1 jeffrin jeffrin 1300 Dec 10  2016 beautifulwork-github.py\n$cat ..\/..\/ls.py \nfrom subprocess import call\ncall([\"ls\", \"-l\"])\n$python ..\/..\/ls.py \ntotal 8\n-rw-r--r-- 1 jeffrin jeffrin  414 Dec 10  2016 beautifulwork-github.php\n-rw-r--r-- 1 jeffrin jeffrin 1300 Dec 10  2016 beautifulwork-github.py\n$\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>$pwd \/home\/jeffrin\/beautifulwork\/github $ls beautifulwork-github.php beautifulwork-github.py $ls -l total 8 -rw-r&#8211;r&#8211; 1 jeffrin jeffrin 414 Dec 10 2016 beautifulwork-github.php -rw-r&#8211;r&#8211; 1 jeffrin jeffrin 1300 Dec 10 2016 beautifulwork-github.py $cat ..\/..\/ls.py from subprocess import call call([&#8220;ls&#8221;, &#8220;-l&#8221;]) $python ..\/..\/ls.py total 8 -rw-r&#8211;r&#8211; 1 jeffrin jeffrin 414 Dec 10 2016 beautifulwork-github.php -rw-r&#8211;r&#8211; 1 jeffrin jeffrin 1300 Dec 10 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2018\/03\/06\/calling-an-external-command-in-python\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Calling an external command in Python&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[83,91],"tags":[1077,1332,1509],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16961"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=16961"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16961\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=16961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=16961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=16961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}