Today to see other people's code, write a GUI front, on the GUI point after the RUN, the breakpoint will only stop when the GUI py files, by calling other py files inside this file cannot be suspended, even if I add a breakpoint to execute code will not pause,
He used inside the
Runner=multiprocessing. The process ()
Runner. The start ()
I want to suspend execution step by step in the start, then the debug, I added a breakpoint within the corresponding file, at the time of execution does not stop there,
Also used in the threading. Thread (). Also can not be suspended,
My main question is, why not pause, how to operate, how to understand the multiprocessing, thank you!
CodePudding user response:
In what way you call other py filesCodePudding user response:
Tried this way call, debugging a problemAmy polumbo y
The import wx
The class MyFrame (wx. Frame) :
Def __init__ (self) :
Wx. Frame. __init__ (self, None)
The panel=wx. A panel (self)
Btn1=wx. Button (panel, label='test', pos=(5, 55))
The self. The Bind (wx. EVT_BUTTON, self clickBtn, btn1)
Def clickBtn (self, event) :
The from other_file import test
The import multiprocessing as mp
M=mp Process (target=test, args=(1))
Margaret spellings tart ()
Modes oin ()
If __name__=="__main__ ':
=wx app. The app ()
Frame1=MyFrame ()
Frame1. The Show ()
App. MainLoop ()
Other_file. Py
Def test (x) :
Print (x)
CodePudding user response: