Ich versuche gerade einen cmd ersatz für windows zu programmieren.
Das Fenster und so gibt es alles schon, jetzt muss ich aber die Befehle "popen".
Das ist mein Code, den ich bis jetzt geschrieben habe:
Code: Alles auswählen
def executeInput(self, input):
sp = subprocess.Popen(input,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
print ":", sp.stdout.read()
1. subprocess führt keine Befehle wie cls oder echo aus. Mit IF habe ich das noch nicht probiert.
2. Was ist denn wenn jetzt ein programm einen input in stdin will? Dann wird mein programm gedost
Habt ihr irgenteine Idee wie man das verhindern kann?
Edit:
Code: Alles auswählen
statt [code] verwendet