0

As a totally wxpython newbie, I’ve unsuccessfully tried to execute this example:

#!/usr/bin/env python # -*- coding: utf-8 -*- import wx if __name__ == '__main__': app = wx.App(False) pid = wx.Execute('echo blabla', wx.EXEC_ASYNC) print(pid) 

It returns pid = 0, i.e., the command could not be executed. I am using Python 3.7.5 with wxPython 4.1.0 on Windows 10. What am I missing?

Thanks in advance.

1 Answer 1

1

Running your example result in an error for me:

Execution of command 'echo blabla' failed (error 2: the system cannot find the file specified.)

Adding cmd /c to the start of the command string results in the following output:

11412 blabla 

The full code is:

#!/usr/bin/env python # -*- coding: utf-8 -*- import wx if __name__ == '__main__': app = wx.App(False) pid = wx.Execute('cmd /c echo blabla', wx.EXEC_ASYNC) print(pid) 
Sign up to request clarification or add additional context in comments.

1 Comment

I think this message solves the problem: discuss.wxpython.org/t/using-wx-execute/34778/4?u=franpena

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.