Jump to content

debug python otl


dulo

Recommended Posts

Here's one idea but haven't tried it myself.

1. Launch a Python Shell window. This will cause all future python output to go to this window

2. Instrument your code with the pdb module:

def cookGeo():
 # This code is called when instances of this SOP cook.
 geo = hou.pwd().geometry()

 # Add code to modify the contents of geo.
 print 'here'


import pdb
pdb.runcall(cookGeo)

3. Debug in the python shell window opened in step 1.

Link to comment
Share on other sites

Here's one idea but haven't tried it myself.

1. Launch a Python Shell window. This will cause all future python output to go to this window

2. Instrument your code with the pdb module:

def cookGeo():
 # This code is called when instances of this SOP cook.
 geo = hou.pwd().geometry()

 # Add code to modify the contents of geo.
 print 'here'


import pdb
pdb.runcall(cookGeo)

3. Debug in the python shell window opened in step 1.

ok .. i think i get steps 1 and 2 but how about step 3 ?

I have the wingide and with this ide i debug my python code, but how would i attach the debugger the the hom shell ??

I often do it with visual studio ( attach to process , ... ) but no idea how to handle this in python.

thx dulo

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...