Ticket #506 (closed: fixed)
Investigate problem with scoping in Python scripts running inside MantidPlot
Reported by: | Martyn Gigg | Owned by: | Martyn Gigg |
---|---|---|---|
Priority: | major | Milestone: | Iteration 16 |
Component: | Keywords: | ||
Cc: | Blocked By: | ||
Blocking: | Tester: |
Description
The following code runs perfectly fine in a stand-alone Python editor but it fails with a name error when run through MantidPlot
import re
def myfunc():
re.compile('regex') print 'done'
myfunc()
Change History
Note: See
TracTickets for help on using
tickets.
(In [2292]) Fixed issues with scoping with Python and MantidPlot. All function definitions are now applied to the main global dictionary rather than the local one. Imported scripts that contain mantid commands will need to import the simple API separately since external scripts maintain a separate global dictionary. Re #506