Difference between revisions of "Python library: subprocess"

From wikieduonline
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
https://docs.python.org/3/library/subprocess.html
  
 
  [[import]] subprocess as sp
 
  [[import]] subprocess as sp
 
  output = sp.getoutput('[[whoami --version]]')
 
  output = sp.getoutput('[[whoami --version]]')
  print (output)
+
  [[print]] (output)
  
  
==See also==
+
== Related ==
<code>[[import os]]</code>
+
* <code>[[import os]]</code>
 +
* <code>os.system("[[uptime]]")</code>
 +
* <code>[[subprocess.run]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 18:13, 12 April 2022

Advertising: