Message 1 of 1
cprofiler with python api
Not applicable
08-06-2018
06:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Does anyone know how to set up profiler with the python api?
import cProfile
import adsk.core, adsk.fusion, traceback
def myrun(context):
### my code is here...
def run(context):
try:
app = adsk.core.Application.get()
ui = app.userInterface
myrun(context)
cProfile.run("myrun(context)")
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))If i try this I get myrun is not defined, but the code truly ran by the function call myrun(context). What am I doing wrong?
Thank you!
fred