blob: e833d21d7a3e6bbaddcec24d63d721dafc58b67e (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
import subprocess
def test():
# proc = subprocess.Popen(['env'], stdout=subprocess.PIPE)
proc = subprocess.Popen(['nvidia-smi'], stdout=subprocess.PIPE)
# proc = subprocess.Popen(['nvidia-smi', '-q', '-i', '0'], stdout=subprocess.PIPE)
# proc = subprocess.Popen(['ls', '/usr/bin/'], stdout=subprocess.PIPE)
# proc = subprocess.Popen('ls', stdout=subprocess.PIPE)
return proc.stdout.read()
|