Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Embedding a python console inside a python application

Reply
Thread Tools

Embedding a python console inside a python application

 
 
Zorigaman
Guest
Posts: n/a
 
      08-17-2009
Hi,

I am starting an application in which I would like to have some
scripting functionality. It will obviously be done in Python. The
thing is that I would like my scripts to have access to the rest of
the application as an object it could manipulate.
I made some research and I found the code module, which allows to have
a Python interpreter inside an application, but I am not sure if I can
access to the "parent" which created this interpreter. A solution
could be to launch my application through an interpreter, but the
problem there is how to integrate it back into the GUI, redirecting
streams ?
Another option is the cmd module, but here, same problem, I am not
sure if can have access to my application's objects.
I am using PyQt with Python 2.6.1, I could switch to Python 3.0 if
necessary.
I am familiar with programming, but that's my first script-enabled
application, tell me if I am missing something obvious.

http://docs.python.org/library/code.html
http://docs.python.org/library/cmd.html
 
Reply With Quote
 
 
 
 
Zorigaman
Guest
Posts: n/a
 
      08-17-2009
On 17 août, 20:46, Zorigaman <zoriga...@gmail.com> wrote:
> Hi,
>
> I am starting an application in which I would like to have some
> scripting functionality. It will obviously be done in Python. The
> thing is that I would like my scripts to have access to the rest of
> the application as an object it could manipulate.
> I made some research and I found the code module, which allows to have
> a Python interpreter inside an application, but I am not sure if I can
> access to the "parent" which created this interpreter. A solution
> could be to launch my application through an interpreter, but the
> problem there is how to integrate it back into the GUI, redirecting
> streams ?
> Another option is the cmd module, but here, same problem, I am not
> sure if can have access to my application's objects.
> I am using PyQt with Python 2.6.1, I could switch to Python 3.0 if
> necessary.
> I am familiar with programming, but that's my first script-enabled
> application, tell me if I am missing something obvious.
>
> http://docs.python.org/library/code....brary/cmd.html


D'oh. The code module offers exactly what I need, you can specify
object in the interpreter's constructor. D'oh.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedding a executable inside Python Script Shankarjee Krishnamoorthi Python 2 09-19-2007 05:10 PM
embedding console in wxpython app Janto Dreijer Python 2 08-07-2006 06:58 AM
Embedding Python: Creating Python Class from Application Kakacek Python 1 01-12-2006 04:32 PM
How to start ASP.Net application from console application? Mike ASP .Net 9 11-30-2005 12:26 AM
embedding an interactive console Paul Miller Python 1 04-28-2005 09:20 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57