On Monday 07 July 2008 13:11:45 Franz Rittmannsberger wrote:
Ich hab eine Frage zum Laufen von python-Anwendungen im Browser. Ziel wäre es, dass ein Python-Script von einer HTML Seite aus gestartet wird dieses Script dann wieder den BRowser aufruft und eine neue Seite anzeigt. Folgendes schaffe ich (Datei heisst sb_direct.py):
'''Diese Datei wird von einer HTML Seite mit action="sb_direct.py" aufgerufen. ''' import os
#Hier kommt später der Code hin
# Der nächste Befehl öffnet die neue Seite - aber leider in einem neuen Tab os.startfile("C:\\Python25\\sb_exitus.html")
Wie schaffe ich es, dass ich die andere Seite auch im selben Tab aufmache, wie die Ursprungsseite und nicht in einem Neuen (Oder wie kann ich den alten Tab zumachen - was auf das gleiche hinausläuft)? Der "target=_self" Verweis in der html-Seite geht hier nicht.
Noch ein Hinweis: ich verwende Firefox!
Hat irgendwer eine Idee dazu?
Sowas geht so nicht. Dazu musst du schon einen "richtigen" HTTP-Server benutzen. Denn was du da oben machst ist einfach den FF neu starten, mit einer uebergebenen HTML-Datei. Dein FF ist halt so konfiguriert das er ein neues Tab aufmacht - er koennte aber auch ein neues Fenster aufmachen. Was du stattdessen machen musst ist den Inhalt von sb_exitus.html einlesen und in sb_direct.py als Ergebnis zurueckgeben. Ich frage mich aber eh, wie es ueberhaupt klappt das sb_direct.py ausgefuehrt wird. Hast du irgendeine Form von HTTP-Server laufen? Diez