Python Debug » History » Version 2
Alexis Jeandet, 09/07/2015 09:24 PM
1 | 1 | Alexis Jeandet | h1. Python Debug |
---|---|---|---|
2 | |||
3 | It is possible to use a Python debugger with SocExplorer, to do so you need to install winpdb (packaged on fedora). |
||
4 | |||
5 | * First you have to start the server from SocExplorer python console, you just need to type: |
||
6 | |||
7 | <pre><code class="python"> |
||
8 | |||
9 | import rpdb2; rpdb2.start_embedded_debugger('some password') |
||
10 | |||
11 | </code></pre> |
||
12 | |||
13 | 2 | Alexis Jeandet | p=. !{width: 80%}SocExplorerRpdbStart.png(SocExplorerPlot rpdb2 start)! |
14 | 1 | Alexis Jeandet | |
15 | * Then you have to start winpdb, and connect it to your running rpdb2 server (File->Attach): |
||
16 | |||
17 | 2 | Alexis Jeandet | p=. !{width: 20%}WinPdbAttach.png(Winpdb attach)! |
18 | 1 | Alexis Jeandet | |
19 | Note that you have to provide the same password than used to start the server! |
||
20 | You should get a list of running sessions like this: |
||
21 | |||
22 | 2 | Alexis Jeandet | p=. !{width: 20%}WinPdbSessionsList.png(Winpdb sessions list)! |
23 | 1 | Alexis Jeandet | |
24 | And once connected, you should get this: |
||
25 | |||
26 | p=. !{width: 80%}ConnectedWinpdb.png(Winpdb connected)! |
||
27 | |||
28 | * Now if you want to add some breakpoints you need to open the python file from winpdb(File->Open Source) and set them: |
||
29 | |||
30 | p=. !{width: 80%}WinpdbWithSomeBPs.png(Winpdb with some breakpoints)! |
||
31 | |||
32 | Note that you need to click on the arrow to start debugging but SocExplorer will not evaluate the python file, you need to execute by dragging your file in the SocExplorer Python console, then have some fun! |