Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,3 @@
import os
exit_code = os.system('ls') # Just execute the command, return a success/fail code
output = os.popen('ls').read() # If you want to get the output data. Deprecated.

View file

@ -0,0 +1,5 @@
import subprocess
# if the exit code was non-zero these commands raise a CalledProcessError
exit_code = subprocess.check_call(['ls', '-l']) # Python 2.5+
assert exit_code == 0
output = subprocess.check_output(['ls', '-l']) # Python 2.7+

View file

@ -0,0 +1,3 @@
from subprocess import PIPE, Popen, STDOUT
p = Popen('ls', stdout=PIPE, stderr=STDOUT)
print p.communicate()[0]

View file

@ -0,0 +1,4 @@
import commands
stat, out = commands.getstatusoutput('ls')
if not stat:
print out