b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/commands.pyc
Size2.43 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:28
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@sFdZdddgZd�Zd�Zd�Zd�Zd�Zd S(
s-Execute shell commands via os.popen() and return status, output.

Interface summary:

import commands

outtext = commands.getoutput(cmd)
(exitstatus, outtext) = commands.getstatusoutput(cmd)
outtext = commands.getstatus(file) # returns output of "ls -ld file"

A trailing newline is removed from the output string.

Encapsulates the basic operation:

pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')
text = pipe.read()
sts = pipe.close()

[Note: it would be nice to add functions to interpret the exit status.]
tgetstatusoutputt getoutputt getstatuscCs3ddk}|idtd�tdt|��S(s-Return output of "ls -ld <file>" in a string.iÿÿÿÿNs"commands.getstatus() is deprecatedisls -ld(twarningstwarntDeprecationWarningRtmkarg(tfileR((s /usr/lib64/python2.6/commands.pyR!s cCst|�dS(s=Return output (stdout or stderr) of executing cmd in a shell.i(R(tcmd((s /usr/lib64/python2.6/commands.pyR,scCs~ddk}|id|dd�}|i�}|i�}|djo
d}n|ddjo|d }n||fS(s4Return (status, output) of executing cmd in a shell.iÿÿÿÿNs{ s; } 2>&1tris
(tostpopentreadtclosetNone(RR
tpipettexttsts((s /usr/lib64/python2.6/commands.pyR4s   

cCs?ddkl}|d�ddk}t|ii||��S(Niÿÿÿÿ(twarnpy3ks In 3.x, mk2arg has been removed.(RRR
Rtpathtjoin(theadtxRR
((s /usr/lib64/python2.6/commands.pytmk2argAs
 cCs~ddkl}|d�d|jo
d|dSd}x3|D]+}|djo|d}n||}qAW|d }|S(
Niÿÿÿÿ(Rsin 3.x, mkarg has been removed.s's 's "s\$"`s\t"(RR(RRtstc((s /usr/lib64/python2.6/commands.pyROs




N(t__doc__t__all__RRRRR(((s /usr/lib64/python2.6/commands.pyt<module>s