Wie ich mit dem subprocess modul die Kommandozeile öffne weiß ich.
Code: Alles auswählen
subprocess.Popen('cmd')
Code: Alles auswählen
c = subprocess.Popen('cmd', stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
c.communicate('ipconfig/all')
Fehlermeldung :Traceback (most recent call last):
File "C:\Python31\Meine scripts\subprocess_cmd2.py", line 6, in <module>
c.communicate('ipconfig/all')
File "C:\Python31\lib\subprocess.py", line 727, in communicate
return self._communicate(input)
File "C:\Python31\lib\subprocess.py", line 937, in _communicate
self.stdin.write(input)
TypeError: must be bytes or buffer, not str
Idiotenfreundiche Hilfe bitte