Quantitative Analysis
Parallel Processing
Numerical Analysis
C++ Multithreading
Python for Excel
Python Utilities
Services
Author

I. Motivation and design (PFE).
II. Installation of the Python for Excel.
III. Tutorial introduction into the Python for Excel.
1. Stability guarantee.
2. PythonForExcel ControlShell.
3. What to do if the connection to Excel from the ControlShell is lost or if the prompt "waits" for too long.
4. Possible littering of memory with orphaned Excel processes.
5. In-cell execution of Python statements.
6. Calling Python from VBA.
7. Calling VBA from Python.
8. Debugging with Python for Excel.
9. Unicode support.
10. Deactivation of Python for Excel.
11. Very important note about pfe-script execution.
IV. PFE Programmer's reference.
Index. Contents.

Debugging with Python for Excel.


lace the following script

01\ global f,g

02\ def f(x,y) :

03\ z=x+y

04\ g(z)

05\ def g(a) :

06\ return a/0

into a file testDbg.pfe. Note the "global" statement. Create and Excel-start the file named testDbg.xls. Type =pfeEval("f(1,2)") into a cell.


Figure

The ControlShell pops up with the error message:


Figure

At this point the post-mortem debugging may be started. Press <Ctrl>+<Enter> to switch to the addin shell and type pdb.pm(). The debugger starts and installs the current debugging position at the exception line.


Figure

See Python's documentation for more information on the pdb module and debugging of Python scripts.





Index. Contents.


















Copyright 2007