2017-03-22 9 views
0
for i in default_proxy_config_data: 
     command = "command get %s" % i 
     actual_ats_value = os.system(command) 

Ich erwartete, dass die Variable die Ausgabe des Befehls erhalten wird. Aber wenn ich das Skript ausgeführt habe, druckt es den Wert des Befehls.Python os.command druckt Wert auf der Konsole

config.exec_thread.limit: 2 
config.exec_thread.autoconfig: 1 
config.accept_threads: 1 
+0

möglich dupe von: [in Python, holen Sie sich die Ausgabe des Systembefehls als String] (http://StackOverflow.com/Questions/19243020/in-Python-Tes-Der-output-of-system-command- as-a-string), [Ausführen des Shell-Befehls von Python und Erfassen der Ausgabe] (http://stackoverflow.com/questions/4760215/running-shell-command-from-python-and-capturing-the-output) – davedwards

Antwort

0

System gibt den Status der Kündigung. unter Code half.

tmp = os.popen("ls").read() 

Danke für die Hilfe.

Verwandte Themen