Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Python では、コマンドが変数にテキストとして保存されている間に、シェル コマンドを実行することは可能ですか? 例えば:
self.command_editor = QTextEditor() self.command_editor.append("echo command") cmd = str(self.command_editor.toPlainText()) call(cmd)
このコードは動作しません!
これは正しい答えです:
self.command_editor = QTextEditor() self.command_editor.append("echo command") cmd = str(self.command_editor.toPlainText()) call(cmd, shell = True) #the mistake was here