當前位置: 首頁>>代碼示例>>Python>>正文


Python popen2.popen3方法代碼示例

本文整理匯總了Python中popen2.popen3方法的典型用法代碼示例。如果您正苦於以下問題:Python popen2.popen3方法的具體用法?Python popen2.popen3怎麽用?Python popen2.popen3使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在popen2的用法示例。


在下文中一共展示了popen2.popen3方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_popen3

# 需要導入模塊: import popen2 [as 別名]
# 或者: from popen2 import popen3 [as 別名]
def test_popen3(self):
        if os.name == 'posix':
            r, w, e = popen2.popen3([self.cmd])
            self.validate_output(self.teststr, self.expected, r, w, e)

        r, w, e = popen2.popen3(self.cmd)
        self.validate_output(self.teststr, self.expected, r, w, e) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:9,代碼來源:test_popen2.py

示例2: test_os_popen3

# 需要導入模塊: import popen2 [as 別名]
# 或者: from popen2 import popen3 [as 別名]
def test_os_popen3(self):
        # same test as test_popen3(), but using the os.popen*() API
        if os.name == 'posix':
            w, r, e = os.popen3([self.cmd])
            self.validate_output(self.teststr, self.expected, r, w, e)

            w, r, e = os.popen3(["echo", self.teststr])
            got = r.read()
            self.assertEqual(got, self.teststr + "\n")
            got = e.read()
            self.assertFalse(got, "unexpected %r on stderr" % got)

        w, r, e = os.popen3(self.cmd)
        self.validate_output(self.teststr, self.expected, r, w, e) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:16,代碼來源:test_popen2.py

示例3: fetchList

# 需要導入模塊: import popen2 [as 別名]
# 或者: from popen2 import popen3 [as 別名]
def fetchList(self):
        (stdout, stdin, stderr) = popen3("%s --getfilelist '%s*.*'" % (self.bin, self.dir))
        list = stdout.readlines()
        # Useless gnokii prompt
        del list[0]
        # Get rid of whitespaces at the ends of the file name
        self.file_list = map(lambda x: x.strip(), list) 
開發者ID:ActiveState,項目名稱:code,代碼行數:9,代碼來源:recipe-475181.py

示例4: fetchPhoto

# 需要導入模塊: import popen2 [as 別名]
# 或者: from popen2 import popen3 [as 別名]
def fetchPhoto(self, p):
        print "Fetching file %s..." % p
        (stdout, stdin, stderr) = popen3("%s --getfile '%s%s' '%s/%s'" % (self.bin,
                self.dir, p, self.dest, p))
        # Make it blocking, so the program will wait for gnokii
        stdout.read(1) 
開發者ID:ActiveState,項目名稱:code,代碼行數:8,代碼來源:recipe-475181.py


注:本文中的popen2.popen3方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。