本文整理汇总了Python中commands.getstatus方法的典型用法代码示例。如果您正苦于以下问题:Python commands.getstatus方法的具体用法?Python commands.getstatus怎么用?Python commands.getstatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类commands
的用法示例。
在下文中一共展示了commands.getstatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getstatus
# 需要导入模块: import commands [as 别名]
# 或者: from commands import getstatus [as 别名]
def getstatus(file):
"""Return output of "ls -ld <file>" in a string."""
import warnings
warnings.warn("commands.getstatus() is deprecated", DeprecationWarning, 2)
return getoutput('ls -ld' + mkarg(file))
# Get the output from a shell command into a string.
# The exit status is ignored; a trailing newline is stripped.
# Assume the command will work with '{ ... ; } 2>&1' around it..
#
示例2: getstatus
# 需要导入模块: import commands [as 别名]
# 或者: from commands import getstatus [as 别名]
def getstatus(file):
"""Return output of "ls -ld <file>" in a string."""
return getoutput('ls -ld' + mkarg(file))
# Get the output from a shell command into a string.
# The exit status is ignored; a trailing newline is stripped.
# Assume the command will work with '{ ... ; } 2>&1' around it..
#