Sorry gmail send it automatic.<br><br>Hi,<br>I need to "emulate" a terminal and need to automaticly run the code after<br>the QDialog shows and close the QDialog after it ends the task.<br>The best I find was this:<br>
<br style="font-family:courier new,monospace">
<font size="1"><span style="font-family:courier new,monospace">class ConsoleClass(QDialog): ...</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">def main():</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">    app = QApplication(sys.argv)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    main.form = ConsoleClass()</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">    </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    main.form.show()</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">    app.processEvents()<br>    run_my_code()<br style="font-family:courier new,monospace"></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">main()</span></font><br>

<br>It works fine, but if I call it from a another form it closes all the application.<br><br>How can I prevent the main application to be closed?<br><br>Thank you in advance for your help.<br><br>zorze <br>