Hallo, ich möchte die Ausgabe eines os.system("Befehl")'s in einem Text-Widget realisieren, also im Programm die jeweiligen Konsolenergebnisse angezeigt bekommen. Kann ich das mit dem Text-Widget realisieren und ist hier text.insert("0.0", Konsolenergebnis usw.) die richtige Methode? Es soll keine Nachbearbeitung im Ausgabefenster erfolgen, nur die Ausgabe! Ich muß für mein Prgramm externe Konsolenprogramme benutzen, möchte aber ohne xterm, rxvt usw. arbeiten! Vielen Dank für evt. Tipps! Es grüßt Frank aus LE _________________________________________________________________ Schützen Sie Ihren Posteingang vor unerwünschten E-Mails. http://www.msn.de/antispam/prevention/junkmailfilter Jetzt Hotmail-Junk-Filter aktivieren! _______________________________________________ python-de maillist - python-de@python.net http://python.net/mailman/listinfo/python-de
Hallo Frank, Am Mittwoch, 2. Juni 2004 08:29 schrieb Frank Hildesheim:
[...] text.insert("0.0", Konsolenergebnis usw.) die richtige Methode? Es soll [...]
Versuche es mal mit text.insert("end", ...). Damit wird die Ausgabe immer an das Ende des aktuellen Textes angehängt. Gruß, Christian _______________________________________________ python-de maillist - python-de@python.net http://python.net/mailman/listinfo/python-de
On Wednesday 02 June 2004 08:29, Frank Hildesheim wrote:
Hallo, ich mchte die Ausgabe eines os.system("Befehl")'s in einem Text-Widget realisieren, also im Programm die jeweiligen Konsolenergebnisse angezeigt bekommen. Kann ich das mit dem Text-Widget realisieren und ist hier text.insert("0.0", Konsolenergebnis usw.) die richtige Methode? Es soll keine Nachbearbeitung im Ausgabefenster erfolgen, nur die Ausgabe! Ich mu�fr mein Prgramm externe Konsolenprogramme benutzen, mchte aber ohne xterm, rxvt usw. arbeiten!
Das Problem kommt mir bekannt vor ;-) Mein Prog nutzt LateX. os.system gibt aber nur Erfolg oder Misserfolg zurück. Die Fehlermeldungen landen immer noch auf der Standartausgabe. Ich glaube der Weg über popen3() ist der richtige. Dann müsste man noch versehentliche "endlosausgaben" abfangen, wie es der Befehl 'top' auslösen würde. Beim Text-Widget müsste man sich noch überlegen, ob man die Zeilenausgabe begrenzt, in dem man das älteste zu Gunsten des neueren raus wirft. PS Ist PyTK das selbe wie Tkinter ? Olaf _______________________________________________ python-de maillist - python-de@python.net http://python.net/mailman/listinfo/python-de
On Wed, 2 Jun 2004 11:30:12 +0200 Olaf 'Rübezahl' Radicke <olaf_rad@gmx.de> wrote:
Das Problem kommt mir bekannt vor ;-) Mein Prog nutzt LateX. os.system gibt aber nur Erfolg oder Misserfolg zurück. Die Fehlermeldungen landen immer noch auf der Standartausgabe. Ich glaube der Weg über popen3() ist der richtige. Dann müsste man noch versehentliche "endlosausgaben" abfangen, wie es der Befehl 'top' auslösen würde. Beim Text-Widget müsste man sich noch überlegen, ob man die Zeilenausgabe begrenzt, in dem man das älteste zu Gunsten des neueren raus wirft. Ich nutze auch os.popen3 allerding wenn man nut stdin und stdout braucht reicht auch os.popen2. Wenn due Rückgabewerte auch noch haben willst muss du die popen funktionen aus dem modul popen2 nehmen, das geht aber angeblich nur unter Unix.
Ist PyTK das selbe wie Tkinter ? Oder soll es PyGTK sein?
grüße, Marek _______________________________________________ python-de maillist - python-de@python.net http://python.net/mailman/listinfo/python-de
participants (4)
-
Christian Mönch
-
Frank Hildesheim
-
Marek Kubica
-
Olaf 'Rübezahl' Radicke