我有一個問題,我得到的錯誤,當我嘗試用Python來執行該代碼3.2.2爲stdin.write格式化字符串()在python 3.x的
working_file = subprocess.Popen(["/pyRoot/iAmAProgram"], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
working_file.stdin.write('message')
我明白了Python 3改變了它處理字符串的方式,但我不明白如何格式化'消息'。有誰知道我會如何改變這個代碼是有效的?
千恩萬謝
喬恩
更新:繼承人的錯誤消息我得到
Traceback (most recent call last):
File "/pyRoot/goRender.py", line 18, in <module>
working_file.stdin.write('3')
TypeError: 'str' does not support the buffer interface
你忘記了錯誤信息。 –