On 08/26/2011 10:42 AM, Wonjun, Choi wrote:
> is there some example for this?
Don't tell me you are working on yet another wxPython IDE:-(
There are a few projects out there which are not that bad - just to name
a few in no particular order Boa, Editra, UliPad.
Maybe better use of time would be to join one of these projects.
But if you "must" create another IDE then these projects are all open
source and you can see how they are doing things.
just my 0.02�
Werner
Hi,
you can check the existing IDEs or simply take a look at the wxPython demo.
For the simplest case, it can be jsut something like this:
######################################
#! Python
# -*- coding: utf-8 -*-
import wx
import wx.py
app = wx.App(False)
frm = wx.Frame(None, -1, "wxPyShell")
wx.py.shell.Shell(frm)
frm.Show()
app.MainLoop()
#######################################
regards,
vbr
Well, that's what you get. A genuine "console window" is created and
managed by the Windows CSRSS subsystem, and can only be a top-level
window. It cannot be embedded. The embedded interpreters that you see
in GUIs are GUI windows that simulate a real console. That's the best
you can do, and in the vast majority of cases, that's perfectly fine.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
There isn't a way to embed a real console in a wx application. It is
either a service provided by the system or another independent process
and so the window belongs to it.
Depending on how much of the console functionality you need it may be
possible to emulate it in your application. If all you need is to
display the child process' simple text output then you can run it with
the subprocess module such and read from the stdout and stderr pipes it
can create for you, and display that text in a window. If you want to
be able to interact with the child precess then you can also use its
stdin pipe to send it input, but the UI will be more tricky here as
you'll need to handle keyboard events and display the input as it is
being typed, etc.
The other option of course is to go ahead and run the console
application for the platform, (cmd.exe on Windows, some terminal
emulator on the other platforms) telling it what program to run. This
will give you a full console for interacting with the target program,
but it will be a separate window and you will not have much programatic
control over it.
--
Robin Dunn
Software Craftsman
http://wxPython.org