Python in Qt Console App
Verfasst: 17. Februar 2009 23:38
Hi@all Wissende.
Ich bin im Moment dabei für mein Projekt ShoutPad Python Support einzufügen. Es soll ein FTP-Server-Script geladen werden.
Hab hierfür folgenden Code:
Kompiliert wird alles wunderbar nur stürzt das Programm sofort bei Start ab. Nichtmal die anderen Initialisierungen (und das sind einige) werden durchgeführt.
Hab natürlich an "#include "PythonInclude/Python.h"" und "LIBS += PythonLibs\python26.lib" gedacht
Jemand eine Idee?
Ich bin im Moment dabei für mein Projekt ShoutPad Python Support einzufügen. Es soll ein FTP-Server-Script geladen werden.
Hab hierfür folgenden Code:
Code: Alles auswählen
/********************************************************************************
** FTP Server starten
********************************************************************************/
Py_Initialize();
QFile* pyFile = new QFile("ftp/server_start.py");
if (!pyFile->open(QIODevice::ReadOnly | QIODevice::Text))
{
printf("Error loading Python Server file! Shutting down.");
exit(1);
}
QString pyString = pyFile->readAll();
pyFile->close();
delete pyFile;
PyRun_SimpleString(pyString.toAscii());
Py_Finalize();
Hab natürlich an "#include "PythonInclude/Python.h"" und "LIBS += PythonLibs\python26.lib" gedacht
Jemand eine Idee?