-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
158 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<html> | ||
<body> | ||
<b> Express Python </b> | ||
<br /> | ||
Written by Bhathiya Perera<br /> | ||
<br /> | ||
<b>Credits</b> | ||
<ul> | ||
<li>Qt 5.3.2</li> | ||
<li>Python 3.4.2</li> | ||
<li>Frankie Simon's Python Syntax Highlight Code (Modified)</li> | ||
<li>Mateusz Loskot's Embedding Code (Modified)</li> | ||
<li>Train Icon from awicons.com</li> | ||
<li>All Other Icons from Open Icon Library</li> | ||
</ul> | ||
<br /> | ||
<b>License</b> | ||
<pre> | ||
Express Python | ||
Copyright (C) 2014 Bhathiya Perera | ||
|
||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License along | ||
with this program; if not, write to the Free Software Foundation, Inc., | ||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
</pre> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
#include "PythonAccess/emb.h" | ||
#include "pythonworker.h" | ||
|
||
PythonWorker::PythonWorker(QObject *parent) : | ||
QObject(parent) | ||
PythonWorker::PythonWorker(QObject* parent) | ||
: QObject(parent) | ||
{ | ||
} | ||
|
||
void PythonWorker::RunPython(const QString &startme, const QString& code) | ||
{ | ||
emit StartPythonRun(); | ||
PyImport_AppendInittab("emb", emb::PyInitEmbConnect); | ||
PyImport_AppendInittab("express_api", emb::PyInitApiConnection); | ||
Py_Initialize(); | ||
PyImport_ImportModule("emb"); | ||
|
||
emb::StdOutWriteType write = [this](std::string s) { | ||
emit this->WriteOutput(QString::fromStdString(s)); | ||
}; | ||
|
||
emb::SetStdout(write); | ||
PyRun_SimpleString(startme.toStdString().c_str()); | ||
PyRun_SimpleString(code.toStdString().c_str()); | ||
emb::ResetStdOut(); | ||
Py_Finalize(); | ||
emit EndPythonRun(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.