5
Contributors
5
Replies
8
Views
4 Years
Discussion Span
Last Post by sneekula
Featured Replies
  • 1

    Take a look at: http://www.daniweb.com/software-development/python/code/445504/an-almost-ide-wxpython Should have enough hints how to do this with wxPython. Basically ... # using module subprocess to get the # directory of drive C:\ # Python27 code import subprocess p = subprocess.Popen("dir C:\\", shell=True, stdout=subprocess.PIPE) # allow external program to work p.wait() # read the … Read More

0

No, I think. You must execute the command by yourself. wx is only for window management.

0

I see, so just to clarify, there is no way to "capture" the dos output in a window, isn't it?
What I would like to do is similar to what happens in linux when you want to install one package with synaptic and you click to show the details during the installation (sorry but I don't know how else to explain what I need to do).
If this is not possible, thanks anyway for your help,
G.

1

Take a look at:
http://www.daniweb.com/software-development/python/code/445504/an-almost-ide-wxpython

Should have enough hints how to do this with wxPython.

Basically ...

# using module subprocess to get the
# directory of drive C:\
# Python27 code

import subprocess

p = subprocess.Popen("dir C:\\", shell=True, stdout=subprocess.PIPE)

# allow external program to work
p.wait()

# read the result to a string
# (Python3 gives bytearray rather than string)
result = p.stdout.read()

print(result)

Edited by vegaseat

0

The wxWin tool set is a GUI library, but you can run any C or C++ code inside your wx functions. There are C functions which will run an external program and have the ability to pipe (as shown in the python example posted by vegaseat) the output to the calling process. You capture that output and stick it in an appropriate GUI widget.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.