[wingide-users] Debugging code invoked by pkg_resources

Wingware Support support at wingware.com
Mon Jan 31 07:44:48 MST 2011


On 1/28/11 8:09 PM, Jeremy Lewi wrote:
>
> I want to debug a python script “my_script.py” that is invoked as follows:
>
> dumbo start my_script.py
>
> dumbo is a python executable script that uses pkg_resources to start 
> code; i.e the code is below.
>
> __requires__=’dumbo==0.21.29’
>
> Import sys
>
> from pkg_resources import load_entry_point
>
> sys.exit(
>
> load_entry_point(‘dumbo==0.21.29’,’console_scripts’,’dumbo’)
>
> )
>
> I would like to put a break point in “my_script.py”.
>
> Is there a simple way to start python and then break into it when it 
> enters my_script.py?
>

If load_entry_point does not start a new process the you should just be 
able to set the Run Arguments in Wing for the file dumbo and debug it. 
Run Args are under the Debug Tab in File Properties, which are accessed 
by right clicking on the file in the editor or Project view.

If that does start a sub-process, you would need to use 'import 
wingdbstub' in the my_script.py code and launch dumbo outside of Wing's 
debugger. This is documented at 
http://wingware.com/doc/debug/debugging-externally-launched-code

Please let us know if this does not help.

Thanks!

-- 

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com



More information about the wingide-users mailing list