ä¸é¨ä¿®æ£ãã¾ããï¼åãæ¶ãç·é¨ï¼ ä¸é£ã®ã³ãã³ããèµ°ããããã£ãã®ã§ãããç§ã¯ã·ã§ã«ã¹ã¯ãªããã®ææ³ãè¦æã§ããããã§ãPython 3ã§ã·ã§ã«ã®ã³ãã³ããå®è¡ãããæ¹æ³ã調ã¹ã¦ã¿ã¾ãããæ¸ããããããããé«ç´ãªãã¨ãã§ããã¨æãã¾ãã subprocessã¢ã¸ã¥ã¼ã« ä»ã«ãä½ãããã¿ããã§ãããç¾å¨ã¯subprocessã¢ã¸ã¥ã¼ã«ã®run()é¢æ°ãç¨ããã®ãæ¨å¥¨ããã¦ããããã§ããPython 3.5ã§è¿½å ãããã»ãã»ãã®é¢æ°ã§ãã 以ä¸ã®ããã«ããã¨$ ls -l /usr/binãå®è¡ã§ãã¾ãã cmd = ['ls', '-l', '/usr/bin'] subprocess.run(cmd) çµæã¯æ¨æºåºåã«åºåããã¾ããçµæãããã°ã©ã å ã§ä½¿ãããå ´åã¯å¼æ°ã«stdout=subprocess.PIPEã追å ãã¦ãã ãããrun()ã®è¿ãå¤ã¯CompletedProcessã¯ã©
{{#tags}}- {{label}}
{{/tags}}