  | | | Interactive Python debugging in XSI: | Interactive Python debugging in XSI: 2005-04-08 - By Jerry Gamache
Back Try this in XSI:
for i in range (0,12): if i == 3: import pywin.debugger pywin.debugger.brk() Application.LogMessage(i) After outputting a few values, a debugger should pop-up. It has all the traditionnal debugger windows:
Interactive shell: In the shell, try changing the value of "i" before hitting F10 to step and see your new value being LogMessaged.
You can also control and experiment with XSI from the shell, just try:
[Dbg]>>> oSphere = Application.CreatePrim("Sphere","MeshSurface") [Dbg]>>> oSphere.radius = 2 [Dbg]>>>
Variable browser: you can explore all local and global variables.
Watch window: enter any expression and see it update as you step.
Enjoy! Jerry.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0"> <TITLE>Interactive Python debugging in XSI:</TITLE> </HEAD> <BODY> <!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Try this in XSI:</FONT> </P>
<P><FONT SIZE=2 FACE="Courier New">for i in range (0,12):</FONT>
<BR> <FONT SIZE=2 FACE="Courier New" >if i == 3:</FONT>
<BR><B>   ; <FONT SIZE=2 FACE="Courier New">import pywin.debugger</FONT></B>
<BR><B>   ; <FONT SIZE=2 FACE="Courier New">pywin.debugger.brk()</FONT></B>
<BR> <FONT SIZE=2 FACE="Courier New" >Application.LogMessage(i)</FONT>
<BR>
<BR><FONT SIZE=2 FACE="Arial">After outputting a few values, a debugger should pop-up. It has all the traditionnal debugger windows:</FONT> </P>
<P><U><FONT SIZE=2 FACE="Arial">Interactive shell:</FONT></U>
<BR> <FONT SIZE=2 FACE="Arial">In the shell, try changing the value of "i" before hitting F10 to step and see your new value being LogMessaged. </FONT></P>
<P><FONT SIZE=2 FACE="Arial">You can also control and experiment with XSI from the shell, just try:</FONT> </P>
<P><FONT SIZE=2 FACE="Courier New">[Dbg]>>> oSphere = Application .CreatePrim("Sphere","MeshSurface")</FONT>
<BR><FONT SIZE=2 FACE="Courier New">[Dbg]>>> oSphere.radius = 2</FONT>
<BR><FONT SIZE=2 FACE="Courier New">[Dbg]>>> </FONT> </P>
<P><U><FONT SIZE=2 FACE="Arial">Variable browser:</FONT></U>
<BR> <FONT SIZE=2 FACE="Arial">you can explore all local and global variables.</FONT> </P>
<P><U><FONT SIZE=2 FACE="Arial">Watch window:</FONT></U>
<BR> <FONT SIZE=2 FACE="Arial">enter any expression and see it update as you step.</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">Enjoy!</FONT>
<BR><FONT SIZE=2 FACE="Arial">Jerry.</FONT> </P>
</BODY> </HTML>
|
|
 |