client = paramiko.SSHClient()
stdin, stdout, stderr = client.exec_command(command)
Run Code Online (Sandbox Code Playgroud)
有没有办法获得命令返回码?
很难解析所有stdout/stderr并知道命令是否成功完成.
在阅读Django的源代码时,我发现了一些声明:
class Field(object):
"""Base class for all field types"""
__metaclass__ = LegacyConnection
# Generic field type description, usually overriden by subclasses
def _description(self):
return _(u'Field of type: %(field_type)s') % {
'field_type': self.__class__.__name__
}
description = property(_description)
class AutoField(Field):
description = _("Integer")
Run Code Online (Sandbox Code Playgroud)
我知道它将描述设置为'整数',但不理解语法:description = _("Integer").
有人可以帮忙吗?