Need help calling python program through mono

View: New views
3 Messages — Rating Filter:   Alert me  

Need help calling python program through mono

by KPS1 () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Need help I am trying to execute a python program, but have been very unsuccessful.
My program needs to open a new terminal window, when the user click a command button, and display/run the python program. When the python program has finished it will close out.  Any advice would be greatly appreciated.

Currently this is what I have tried.

   Dim processStartInfo = New ProcessStartInfo("DISPLAY=:32 /root/rxvt -geometry 80x25+150+150+sb -fn 9x15 -e /path/ProgramName", param)

                processStartInfo.UseShellExecute = False
                processStartInfo.ErrorDialog = False
                processStartInfo.WindowStyle = ProcessWindowStyle.Normal
                processStartInfo.RedirectStandardError = True
                processStartInfo.RedirectStandardInput = True
                processStartInfo.RedirectStandardOutput = True
                processStartInfo.CreateNoWindow = False

                Dim process As New Process()
                process.StartInfo = processStartInfo
                Dim processStarted As Boolean = process.Start()

Re: Need help calling python program through mono

by Rolf Bjarne Kvinge-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

> Need help I am trying to execute a python program, but have been very
> unsuccessful.

In exactly which way unsuccessful? Error messages? Nothing happens?

> My program needs to open a new terminal window,

This you can do (and I can't see anything obviously wrong with the code
below)

> when the user click a
> command button, and display/run the python program.

It's the terminal that would have to do this (unless you can find a way to
remotely control the terminal window somehow, but I suspect it's a lot
easier to make the newly created terminal window execute a script that does
this).

Once again, knowing what actually happens would make it easier to find the
problem.

Rolf

> When the python
> program has finished it will close out.  Any advice would be greatly
> appreciated.
>
> Currently this is what I have tried.
>
>    Dim processStartInfo = New ProcessStartInfo("DISPLAY=:32 /root/rxvt
> -geometry 80x25+150+150+sb -fn 9x15 -e /path/ProgramName", param)
>
>                 processStartInfo.UseShellExecute = False
>                 processStartInfo.ErrorDialog = False
>                 processStartInfo.WindowStyle =
> ProcessWindowStyle.Normal
>                 processStartInfo.RedirectStandardError = True
>                 processStartInfo.RedirectStandardInput = True
>                 processStartInfo.RedirectStandardOutput = True
>                 processStartInfo.CreateNoWindow = False
>
>                 Dim process As New Process()
>                 process.StartInfo = processStartInfo
>                 Dim processStarted As Boolean = process.Start()
>

Rolf

_______________________________________________
Mono-vb mailing list
Mono-vb@...
http://lists.ximian.com/mailman/listinfo/mono-vb

Re: Need help calling python program through mono

by KPS1 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

KPS1 wrote:
Need help I am trying to execute a python program, but have been very unsuccessful.
My program needs to open a new terminal window, when the user click a command button, and display/run the python program. When the python program has finished it will close out.  Any advice would be greatly appreciated.

Currently this is what I have tried.

   Dim processStartInfo = New ProcessStartInfo("DISPLAY=:32 /root/rxvt -geometry 80x25+150+150+sb -fn 9x15 -e /path/ProgramName", param)

                processStartInfo.UseShellExecute = False
                processStartInfo.ErrorDialog = False
                processStartInfo.WindowStyle = ProcessWindowStyle.Normal
                processStartInfo.RedirectStandardError = True
                processStartInfo.RedirectStandardInput = True
                processStartInfo.RedirectStandardOutput = True
                processStartInfo.CreateNoWindow = False

                Dim process As New Process()
                process.StartInfo = processStartInfo
                Dim processStarted As Boolean = process.Start()
Solved... http://ubuntuforums.org/showthread.php?p=7955421#post7955421