Share

Debugging a Python script

Use the Moldflow Python API's built-in logging to locate and fix issues in your automation scripts.

You can enable detailed logging in several ways.

  • Set the logging level to DEBUG before creating your moldflow objects:

      import logging
    
      logging.getLogger().setLevel(logging.DEBUG)
  • Enable console and file logging when constructing Synergy:

      from moldflow import Synergy
    
      synergy = Synergy()
  • Run the script from the command line:

      python C:pathtoscript.py
Note: When calling into the application via COM, stepping into COM methods is not available. DEBUG logging provides call and argument traces emitted by the moldflow Python package, which is the recommended way to diagnose issues.

Was this information helpful?