Comments for Winpdb - A Platform Independent Python Debugger http://winpdb.org Tue, 12 Dec 2017 04:38:21 +0000 http://wordpress.org/?v=2.7 hourly 1 Comment on Requirements by Philippe Fremy http://winpdb.org/docs/requirements/comment-page-1/#comment-893567 Philippe Fremy Sat, 08 Jul 2017 20:40:14 +0000 http://winpdb.org/?page_id=6#comment-893567 Hi, I am maintaining a fork of winpdb on Github ( https://github.com/bluebird75/winpdb ) since the original author Nir Aides has kind of abandoned his project. By default, winpdb will launch with the terminal it knows, the code is here : https://github.com/bluebird75/winpdb/blob/master/rpdb2.py#L3517 As you can see the options for the terminals are hardcoded. I would be interested in extending this list. Which terminal are you using by default ? I would like to make sure winpdb provides an option for choosing it correctly. Cheers, Philippe Hi,

I am maintaining a fork of winpdb on Github ( https://github.com/bluebird75/winpdb ) since the original author Nir Aides has kind of abandoned his project.

By default, winpdb will launch with the terminal it knows, the code is here :
https://github.com/bluebird75/winpdb/blob/master/rpdb2.py#L3517

As you can see the options for the terminals are hardcoded. I would be interested in extending this list.

Which terminal are you using by default ? I would like to make sure winpdb provides an option for choosing it correctly.

Cheers,

Philippe

]]>
Comment on Download by Phlippe Fremy http://winpdb.org/download/comment-page-1/#comment-893566 Phlippe Fremy Sat, 08 Jul 2017 20:31:16 +0000 http://localhost/home/pythondebugger/?page_id=3#comment-893566 Hi, I maintain a version of winpdb which is compatible with latest version of Python on Github : https://github.com/bluebird75/winpdb The original author of Winpdb (Nir Aides) seems to have abandon his project. My version on GitHub is only partially compatible with python 3.6 : the remote debugger rpdb2.py but the GUI is still blocked on python 2. So, to debug a python 3 script : - install the winpdb version of my repository above, along with python 2 and WxWidget. - launch winpdb with python 2 - select your python 3 script to debug - in the execution dialog, specify the python 3 interpreter. - enjoy WxWidget has now released experimental packages which support python 3. I intend to work on full python 3 support this summer, so that python 3.6 support becomes natural. Philippe Hi,

I maintain a version of winpdb which is compatible with latest version of Python on Github : https://github.com/bluebird75/winpdb

The original author of Winpdb (Nir Aides) seems to have abandon his project.

My version on GitHub is only partially compatible with python 3.6 : the remote debugger rpdb2.py but the GUI is still blocked on python 2.

So, to debug a python 3 script :
- install the winpdb version of my repository above, along with python 2 and WxWidget.
- launch winpdb with python 2
- select your python 3 script to debug
- in the execution dialog, specify the python 3 interpreter.
- enjoy

WxWidget has now released experimental packages which support python 3. I intend to work on full python 3 support this summer, so that python 3.6 support becomes natural.

Philippe

]]>
Comment on Documentation by Allen http://winpdb.org/docs/comment-page-1/#comment-893565 Allen Mon, 24 Apr 2017 01:57:40 +0000 http://winpdb.org/?page_id=5#comment-893565 Hi, I would like to debug a python script that gimp is using. I have imported rpdb2 and inserted rpdb2.start_embedded_debugger("pass"). I use the attach feature in the file pulldown, I provide the password, it sees the process but the OK button is grayed out and I can not continue. Can you please indicate what I am doing wrong? Running winpdb on a python script works fine. I just can not attach to the process. Thanks! Hi,

I would like to debug a python script that gimp is using. I have imported rpdb2 and inserted
rpdb2.start_embedded_debugger(”pass”).

I use the attach feature in the file pulldown, I provide the password, it sees the process but the OK button is grayed out and I can not continue.

Can you please indicate what I am doing wrong? Running winpdb on a python script works fine. I just can not attach to the process.

Thanks!

]]>
Comment on Download by kk http://winpdb.org/download/comment-page-1/#comment-893564 kk Thu, 09 Feb 2017 12:28:12 +0000 http://localhost/home/pythondebugger/?page_id=3#comment-893564 Hi. Given that all posts are v old and I am v new to Python with Spyder IDE. May I ask: - Winpdb for Windows is it available for Python 3.6? The link in "to use Winpdb in Windows you need to install the wxPython runtime" prompts only to Python 2.x Any other instructions would be appreciated. Thanks Hi.
Given that all posts are v old and I am v new to Python with Spyder IDE.
May I ask:
- Winpdb for Windows is it available for Python 3.6?
The link in “to use Winpdb in Windows you need to install the wxPython runtime” prompts only to Python 2.x

Any other instructions would be appreciated.
Thanks

]]>
Comment on Launch Time by Ajju http://winpdb.org/docs/launch-time/comment-page-1/#comment-893562 Ajju Wed, 30 Nov 2016 06:46:08 +0000 http://winpdb.org/?page_id=8#comment-893562 Hello there You said "You can limit rpdb2 to use one with the screen utility. Type rpdb2 -h and see the help on the -s command line switch". Did just that but all I get is a blank screen with nothing. Hello there

You said

“You can limit rpdb2 to use one with the screen utility. Type rpdb2 -h and see the help on the -s command line switch”. Did just that but all I get is a blank screen with nothing.

]]>
Comment on Requirements by Jose Borreguero http://winpdb.org/docs/requirements/comment-page-1/#comment-893560 Jose Borreguero Wed, 10 Aug 2016 22:01:15 +0000 http://winpdb.org/?page_id=6#comment-893560 If you use Ubuntu, make sure "xterm" is installed on your system. Otherwise winpdb will prompt "The debugger does not know how to open a new console on this system" If you use Ubuntu, make sure “xterm” is installed on your system. Otherwise winpdb will prompt “The debugger does not know how to open a new console on this system”

]]>
Comment on Launch Time by skregas http://winpdb.org/docs/launch-time/comment-page-1/#comment-893559 skregas Wed, 27 Apr 2016 14:56:28 +0000 http://winpdb.org/?page_id=8#comment-893559 using the tool in this form on the Linux command line: rpdb2 -d I get the following stack trace: File "/home/dev/athena-venv/bin/rpdb2", line 31, in rpdb2.main() File "/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py", line 14470, in main StartServer(_rpdb2_args, fchdir, _rpdb2_pwd, fAllowUnencrypted, fAllowRemote, secret) File "/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py", line 14212, in StartServer g_module_main = -1 File "/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py", line 14212, in StartServer g_module_main = -1 File "/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py", line 7324, in trace_dispatch_init self.__set_signal_handler() File "/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py", line 7286, in __set_signal_handler handler = signal.getsignal(value) File "/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py", line 13682, in __getsignal File "/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py", line 13682, in __getsignal handler = g_signal_handlers.get(signum, g_signal_getsignal(signum)) ValueError: signal number out of range If i simply run: rpdb2 from the terminal, I enter the debugger and can execute commands. any advice? using the tool in this form on the Linux command line:
rpdb2 -d

I get the following stack trace:
File “/home/dev/athena-venv/bin/rpdb2″, line 31, in
rpdb2.main()
File “/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py”, line 14470, in main
StartServer(_rpdb2_args, fchdir, _rpdb2_pwd, fAllowUnencrypted, fAllowRemote, secret)
File “/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py”, line 14212, in StartServer
g_module_main = -1
File “/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py”, line 14212, in StartServer
g_module_main = -1
File “/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py”, line 7324, in trace_dispatch_init
self.__set_signal_handler()
File “/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py”, line 7286, in __set_signal_handler
handler = signal.getsignal(value)
File “/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py”, line 13682, in __getsignal
File “/home/dev/athena-venv/lib/python3.4/site-packages/rpdb2.py”, line 13682, in __getsignal
handler = g_signal_handlers.get(signum, g_signal_getsignal(signum))
ValueError: signal number out of range

If i simply run:
rpdb2

from the terminal, I enter the debugger and can execute commands.

any advice?

]]>
Comment on About by Joseph Schachner http://winpdb.org/about/comment-page-1/#comment-893558 Joseph Schachner Wed, 13 Apr 2016 20:35:14 +0000 #comment-893558 I have a program into which we have embedded a Python interpreter, it runs scripts that the program is holding. I made a python callable function that can return as a python string the source code of the module currently being interpreted. However, I can't pass that as a "sourcecode_provider" because, I believe, Python has a global interpreter lock, so there is no way for rpdb2 to call that function while it's in the Python module that has called rpdb2. So, plan B: get the Python source code into a string, save it to a file. Tell rpdb2 to use the file. I know that MUST be possible, I've been looking inside rpdb2 to see how, and I am just confused. If necessary I could always use the exact same file path and name, and I could hard code that into rpdb2 if only I knew where! Has anyone done something like this and can say something helpful? Please? I have a program into which we have embedded a Python interpreter, it runs scripts that the program is holding. I made a python callable function that can return as a python string the source code of the module currently being interpreted. However, I can’t pass that as a “sourcecode_provider” because, I believe, Python has a global interpreter lock, so there is no way for rpdb2 to call that function while it’s in the Python module that has called rpdb2.

So, plan B: get the Python source code into a string, save it to a file. Tell rpdb2 to use the file.

I know that MUST be possible, I’ve been looking inside rpdb2 to see how, and I am just confused. If necessary I could always use the exact same file path and name, and I could hard code that into rpdb2 if only I knew where!

Has anyone done something like this and can say something helpful? Please?

]]>
Comment on About by John_L http://winpdb.org/about/comment-page-1/#comment-893555 John_L Fri, 16 Oct 2015 00:14:45 +0000 #comment-893555 LibreOffice 4. includes python. Check out: Tools >> Macros >> Organize Macros >> Python … >> LibreOffice Macros >> Hello World which appends “Hello World (in Python)” to your currently open document. LibreOffice 4. is Python 3.3, so I downloaded and installed wxPython cocoa from the wxPython website (Attention! Must install from Admin to have sufficient privileges). Now download winpdb from the website, which I unzipped in my Applications/LibreOffice 4.3.5 folder. Again had to enter Admin account to run the sudo command via a terminal with sufficient privileges: John$ WD="/Applications/LibreOffice 4.3.5/winpdb/winpdb-1.4.8" John$ P3="/Applications/LibreOffice 4.3.5/LibreOffice.app/Contents/MacOS/LibreOfficePython.framework/Versions/3.3/bin" John$ cd "$WD" John$ sudo “$P3”/python3 setup.py install -f John$ SP="/Applications/LibreOffice 4.3.5/LibreOffice.app/Contents/MacOS/LibreOfficePython.framework/Versions/3.3/lib/python3.3/site-packages" John$ cp rpdb2.py “$SP” Now copy HelloWorld.py and edit it to prepare for the debugger → WinPdb_HelloWorldPython.py. SD=”/Applications/LibreOffice 4.3.5/LibreOffice.app/Contents/share/Scripts/python” John$ ls “$SD” Capitalise.py LibreLogo pythonSamples HelloWorld.py WinPdb_HelloWorld.py rpdb2.py # HelloWorld python script for the scripting framework # … import rpdb2 def HelloWorldPython( ): """Prints the string 'Hello World(in Python)' into the current document""" rpdb2.start_embedded_debugger("your password here") #start debugger INSIDE function desktop = XSCRIPTCONTEXT.getDesktop() #get the doc model = desktop.getCurrentComponent() … Voila'!!! Hello World (in Python) – curtesy of stepping through WinPdb_HelloWorldPython!!! Some other handy shortcuts for LibreOffice. Create new Macros entry on main toolbar: Tools >> Customize... >> Menus | [ New ] “Macros” Tools >> Customize... >> Menus | [ Menus ] “Macros” | [Add ] (Categories) [LibreOffice] [LibreOffice] WinPdb_HelloWorld HelloWorldPython now accessible by the Macros Menu (much less cumbersome!). Tools >> HelloWorldPython LibreOffice 4. includes python. Check out:
Tools >> Macros >> Organize Macros >> Python … >> LibreOffice Macros >> Hello World
which appends “Hello World (in Python)” to your currently open document.
LibreOffice 4. is Python 3.3, so I downloaded and installed wxPython cocoa from the wxPython website (Attention! Must install from Admin to have sufficient privileges).
Now download winpdb from the website, which I unzipped in my Applications/LibreOffice 4.3.5 folder. Again had to enter Admin account to run the sudo command via a terminal with sufficient privileges:

John$ WD=”/Applications/LibreOffice 4.3.5/winpdb/winpdb-1.4.8″

John$ P3=”/Applications/LibreOffice 4.3.5/LibreOffice.app/Contents/MacOS/LibreOfficePython.framework/Versions/3.3/bin”

John$ cd “$WD”
John$ sudo “$P3”/python3 setup.py install -f

John$ SP=”/Applications/LibreOffice 4.3.5/LibreOffice.app/Contents/MacOS/LibreOfficePython.framework/Versions/3.3/lib/python3.3/site-packages”
John$ cp rpdb2.py “$SP”

Now copy HelloWorld.py and edit it to prepare for the debugger → WinPdb_HelloWorldPython.py.

SD=”/Applications/LibreOffice 4.3.5/LibreOffice.app/Contents/share/Scripts/python”
John$ ls “$SD”
Capitalise.py LibreLogo pythonSamples
HelloWorld.py WinPdb_HelloWorld.py rpdb2.py

# HelloWorld python script for the scripting framework
# …
import rpdb2

def HelloWorldPython( ):
“”"Prints the string ‘Hello World(in Python)’ into the current document”"”

rpdb2.start_embedded_debugger(”your password here”) #start debugger INSIDE function

desktop = XSCRIPTCONTEXT.getDesktop() #get the doc
model = desktop.getCurrentComponent()

Voila’!!!
Hello World (in Python) – curtesy of stepping through WinPdb_HelloWorldPython!!!
Some other handy shortcuts for LibreOffice. Create new Macros entry on main toolbar:
Tools >> Customize… >> Menus | [ New ] “Macros”
Tools >> Customize… >> Menus | [ Menus ] “Macros”
| [Add ] (Categories) [LibreOffice] [LibreOffice] WinPdb_HelloWorld

HelloWorldPython now accessible by the Macros Menu (much less cumbersome!).
Tools >> HelloWorldPython

]]>
Comment on About by John_L http://winpdb.org/about/comment-page-1/#comment-893554 John_L Sun, 27 Sep 2015 14:14:03 +0000 #comment-893554 This is to repeat my comment on: http://stackoverflow.com/questions/20763448/writing-gimp-plugins-in-python-on-windows-how-do-i-debug-where-is-the-output/32808634#32808634 I am a newbie to python, but I would like to give a shout-out, first to winpdb, and then to this comment for integrating winpdb into GIMP. This same procedure works as well for LibreOffice 4. If I may be allowed to vent a little; I have a moderate amount of experience with Visual Basic, more or less at a hobbiest level, but I decided a few years ago to get into OpenOffice when MicroSoft threatened to abandon VB for the Mac. I don't want to say that VB in OpenOffice was onerous, but the lack of anything resembling an IDE is tedious. Now, with winpdb, I will never be looking back. It's python from here on out, baby. Steps taken: -- As suggested by Omid (see stackoverflow reference above), I first got winpdb running out of GIMP (relatively painless). -- I copied the rpdb2.py file to C:\Program Files\LibreOffice 4\program\python-core-3.3.3\lib\site-packages\rpdb2.py. (Win 7, LibreOffice 4.4.03) -- I edited the HelloWorld.py file in C:\Program Files\LibreOffice 4\share\Scripts\python directory (saved in WinPDb_HelloWorld.py to same directory). # HelloWorld python script for the scripting framework # This file is part of the LibreOffice project. # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. blah, blah, blah ... import rpdb2 #rpdb2.start_embedded_debugger("Your Password Here") # << DON'T start debugger here. # It only gets you lost in the LO python wrapper when debugging. def HelloWorldPython( ): """Prints the string 'Hello World(in Python)' into the current document""" # start debugger INSIDE function, where it will be called from LO Macros -- Duh!! rpdb2.start_embedded_debugger("YourPasswordHere") #get the doc from the scripting context which is made available to all scripts desktop = XSCRIPTCONTEXT.getDesktop() #... etc., see HelloWorld.py WinPDb_HelloWorld appears under LibreOffice Macros in the Macro Selector (see https://wiki.openoffice.org/wiki/Python_as_a_macro_language for more on that). This is to repeat my comment on:
http://stackoverflow.com/questions/20763448/writing-gimp-plugins-in-python-on-windows-how-do-i-debug-where-is-the-output/32808634#32808634

I am a newbie to python, but I would like to give a shout-out, first to winpdb, and then to this comment for integrating winpdb into GIMP. This same procedure works as well for LibreOffice 4.

If I may be allowed to vent a little; I have a moderate amount of experience with Visual Basic, more or less at a hobbiest level, but I decided a few years ago to get into OpenOffice when MicroSoft threatened to abandon VB for the Mac. I don’t want to say that VB in OpenOffice was onerous, but the lack of anything resembling an IDE is tedious. Now, with winpdb, I will never be looking back. It’s python from here on out, baby.

Steps taken:

– As suggested by Omid (see stackoverflow reference above), I first got winpdb running out of GIMP (relatively painless).

– I copied the rpdb2.py file to C:\Program Files\LibreOffice 4\program\python-core-3.3.3\lib\site-packages\rpdb2.py. (Win 7, LibreOffice 4.4.03)

– I edited the HelloWorld.py file in C:\Program Files\LibreOffice 4\share\Scripts\python directory (saved in WinPDb_HelloWorld.py to same directory).

# HelloWorld python script for the scripting framework
# This file is part of the LibreOffice project.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. blah, blah, blah …

import rpdb2
#rpdb2.start_embedded_debugger(”Your Password Here”) # << DON’T start debugger here.
# It only gets you lost in the LO python wrapper when debugging.

def HelloWorldPython( ):
“”"Prints the string ‘Hello World(in Python)’ into the current document”"”

# start debugger INSIDE function, where it will be called from LO Macros — Duh!!
rpdb2.start_embedded_debugger(”YourPasswordHere”)

#get the doc from the scripting context which is made available to all scripts
desktop = XSCRIPTCONTEXT.getDesktop()
#… etc., see HelloWorld.py

WinPDb_HelloWorld appears under LibreOffice Macros in the Macro Selector (see https://wiki.openoffice.org/wiki/Python_as_a_macro_language for more on that).

]]>