2007年06月12日 星期二 10:48
Çë½Ì¸÷λ´óÏÀ£º ÓÃpythonÆô¶¯ÁËÒ»¸ö×Ó½ø³Ì£¬×Ó½ø³ÌÊÇÒ»¸ögui³ÌÐò£¬µÈ´ýÓû§ÊäÈë¡£ÎÒµÄÒÉ»óÊÇÔõÑù¶¨Î»µ½ÎÒÒªÊäÈëµÄλÖÃ(±ÈÈç˵£¬Òª»Ø³µÈý´Î²ÅÄܶ¨Î»£¬Õâ¸ö»Ø³µ·û¸ÃÔõô´¦ÀíÄØ£©£¬²¢ÇÒÔõÑù»ñÈ¡Êä³ö½á¹û£¿ ÏÂÃæÊÇÎÒµÄһЩÏë·¨£¬Çë´ó¼ÒÖ¸µãһϣº p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr= subprocess.PIPE) # cmd Æô¶¯Ò»¸ögui³ÌÐò (output, stderr) = p.communicate(input="\n\n\nXXX\n") ££ ÎҵĴ¦Àí°ì·¨½«'\n'´«µÝ½øÈ¥£¬¿ÉÊÇûÓÐЧ¹û¡£Í£ÔÚºÚÌå×ÖÄÇÁË¡£ File "getXXX.py", line 27, in getXXX (output, stderr) = p.communicate(input="\n\n\nXXX\n") File "/usr/local/lib/python2.5/subprocess.py", line 651, in communicate return self._communicate(input) File "/usr/local/lib/python2.5/subprocess.py", line 1109, in _communicate rlist, wlist, xlist = select.select(read_set, write_set, []) KeyboardInterrupt -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070612/b12839fd/attachment.html
Zeuux © 2025
京ICP备05028076号