mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-29 06:12:18 -06:00
bazaar: Python: some python test cases, very basic and alpha
git-svn-id: svn://ultimatepp.org/upp/trunk@3319 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
926d7915f0
commit
6ecf478516
36 changed files with 841 additions and 0 deletions
34
bazaar/PyShell/PyShell.cpp
Normal file
34
bazaar/PyShell/PyShell.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include "PyShell.h"
|
||||
|
||||
// Arkon, 09 July 2004 RageStorm
|
||||
// http://ragestorm.net
|
||||
// Feel free to do with this whatever you want!
|
||||
// Thanks goes to Sagiv Malihi for this great idea and help.
|
||||
//http://www.ragestorm.net/tutorial?id=21
|
||||
//http://www.ragestorm.net/sample?id=79
|
||||
|
||||
void PyShell::Proc()
|
||||
{
|
||||
/*
|
||||
The following code is what we run below, it will open PyShell using TkInter.
|
||||
it runs blocking
|
||||
*/
|
||||
AtomicInc(a);
|
||||
int ret = PyRun_SimpleString(
|
||||
"from Tkinter import Tk\n"
|
||||
"from idlelib.PyShell import PyShell, PyShellFileList, fixwordbreaks\n"
|
||||
"import idlelib.PyShell\n"
|
||||
"\n"
|
||||
"idlelib.PyShell.use_subprocess = False\n"
|
||||
"root = Tk()\n"
|
||||
"fixwordbreaks(root)\n"
|
||||
"flist = PyShellFileList(root)\n"
|
||||
"flist.pyshell = PyShell(flist)\n"
|
||||
"\n"
|
||||
"root.withdraw()\n"
|
||||
"flist.pyshell.begin()\n"
|
||||
"root.mainloop()\n"
|
||||
"root.destroy()\n"
|
||||
);
|
||||
AtomicDec(a);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue