Index: src/sas/sasgui/perspectives/calculator/model_editor.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/model_editor.py	(revision cb4ef58d8aabd8393aae14823d3fa98d1ba0c1a2)
+++ src/sas/sasgui/perspectives/calculator/model_editor.py	(revision 26d6e0456318cb4a88efcb2e4a432527408e4a7d)
@@ -30,4 +30,5 @@
 from wx.py.editwindow import EditWindow
 from sas.sasgui.guiframe.documentation_window import DocumentationWindow
+from .pyconsole import show_model_output, check_model
 
 
@@ -45,17 +46,4 @@
 PANEL_WIDTH = 500
 _BOX_WIDTH = 55
-
-
-def _compile_file(path):
-    """
-    Compile the file in the path
-    """
-    try:
-        import py_compile
-        py_compile.compile(file=path, doraise=True)
-        return ''
-    except:
-        _, value, _ = sys.exc_info()
-        return value
 
 def _delete_file(path):
@@ -384,6 +372,7 @@
             name2 = label[1]
             self.write_string(fname, name1, name2)
-            self.compile_file(fname)
-            self.parent.update_custom_combo()
+            success = show_model_output(self, fname)
+            if success:
+                self.parent.update_custom_combo()
             msg = self._notes
             info = 'Info'
@@ -618,5 +607,5 @@
         """
         path = self.fname
-        _compile_file(path)
+        show_model_output(self, path)
 
     def delete_file(self, path):
@@ -954,4 +943,5 @@
         info = 'Info'
         msg = ''
+        result, check_err = '', ''
         # Sort out the errors if occur
         # First check for valid python name then if the name already exists
@@ -969,4 +959,11 @@
                     self.write_file(self.fname, name, description, param_str,
                                     pd_param_str, func_str)
+                    try:
+                        result, msg = check_model(self.fname), None
+                    except Exception:
+                        import traceback
+                        result, msg = None, "error building model"
+                        check_err = "\n"+traceback.format_exc(limit=2)
+
                     # Modified compiling test, as it will fail for sasmodels.sasview_model class
                     # Should add a test to check that the class is correctly built 
@@ -1031,7 +1028,7 @@
             color = 'red'
         else:
-            msg = "Successful! "
+            self._notes = result
+            msg = "Successful! Please look for %s in Customized Models."%name
             msg += "  " + self._notes
-            msg += " Please look for it in the Customized Models."
             info = 'Info'
             color = 'blue'
@@ -1041,5 +1038,6 @@
         if self.base != None:
             from sas.sasgui.guiframe.events import StatusEvent
-            wx.PostEvent(self.base.parent, StatusEvent(status=msg, info=info))
+            wx.PostEvent(self.base.parent,
+                         StatusEvent(status=msg+check_err, info=info))
         self.warning = msg
 
Index: src/sas/sasgui/perspectives/calculator/pyconsole.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/pyconsole.py	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sasgui/perspectives/calculator/pyconsole.py	(revision 26d6e0456318cb4a88efcb2e4a432527408e4a7d)
@@ -4,9 +4,10 @@
 import sys
 import os
+
+import numpy as np
+
 import wx
-import wx.lib.dialogs
+from wx.lib.dialogs import ScrolledMessageDialog
 import wx.py.editor as editor
-import wx.py.frame as frame
-import py_compile
 
 if sys.platform.count("win32") > 0:
@@ -18,18 +19,58 @@
     PANEL_HEIGHT = 730
     FONT_VARIANT = 1
-ID_COMPILE = wx.NewId()
+ID_CHECK_MODEL = wx.NewId()
 ID_RUN = wx.NewId()
 
-def compile_file(path):
+def check_model(path):
     """
-    Compile a python file
+    Check that the model on the path can run.
     """
+    # try running the model
+    from sasmodels.core import load_model, call_kernel
+    model = load_model(path)
+
+    q =  np.array([0.01, 0.1])
+    kernel = model.make_kernel([q])
+    Iq = call_kernel(kernel, {})
+
+    qx, qy =  np.array([0.01, 0.01]), np.array([0.1, 0.1])
+    kernel = model.make_kernel([qx, qy])
+    Iqxy = call_kernel(kernel, {})
+
+    result = """
+    Iq(%s) = %s
+    Iqxy(%s, %s) = %s
+    """%(q, Iq, qx, qy, Iqxy)
+
+    return result
+
+def show_model_output(parent, fname):
+    # Make sure we have a python file; not sure why we care though...
+    if not (fname and os.path.exists(fname) and fname.endswith('.py')):
+        mssg = "\n This is not a python file."
+        wx.MessageBox(str(mssg), 'Error', style=wx.ICON_ERROR)
+        return False
+
     try:
-        import py_compile
-        py_compile.compile(file=path, doraise=True)
-    except:
-        type, value, traceback = sys.exc_info()
-        return value
-    return None
+        result, errmsg = check_model(fname), None
+    except Exception:
+        import traceback
+        result, errmsg = None, traceback.format_exc(limit=2)
+
+    parts = ["Running model '%s'..." % os.path.basename(fname)]
+    if errmsg is not None:
+        parts.extend(["", "Error occurred:", errmsg, ""])
+        title, icon = "Error", wx.ICON_ERROR
+    else:
+        parts.extend(["", "Success:", result, ""])
+        title, icon = "Info", wx.ICON_INFORMATION
+    text = "\n".join(parts)
+    dlg = ScrolledMessageDialog(parent, text, title, size=((550, 250)))
+    fnt = wx.Font(10, wx.TELETYPE, wx.NORMAL, wx.NORMAL)
+    dlg.GetChildren()[0].SetFont(fnt)
+    dlg.GetChildren()[0].SetInsertionPoint(0)
+    dlg.ShowModal()
+    dlg.Destroy()
+    return errmsg is None
 
 class PyConsole(editor.EditorNotebookFrame):
@@ -65,7 +106,7 @@
         self.Bind(wx.EVT_MENU, self.OnSaveFile, id=wx.ID_SAVE)
         self.Bind(wx.EVT_MENU, self.OnSaveAsFile, id=wx.ID_SAVEAS)
-        self.Bind(wx.EVT_MENU, self.OnCompile, id=ID_COMPILE)
+        self.Bind(wx.EVT_MENU, self.OnCheckModel, id=ID_CHECK_MODEL)
         self.Bind(wx.EVT_MENU, self.OnRun, id=ID_RUN)
-        self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateCompileMenu, id=ID_COMPILE)
+        self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateCompileMenu, id=ID_CHECK_MODEL)
         self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateCompileMenu, id=ID_RUN)
         self.Bind(wx.EVT_CLOSE, self.on_close)
@@ -81,6 +122,6 @@
         """
         self.compileMenu = wx.Menu()
-        self.compileMenu.Append(ID_COMPILE, 'Compile',
-                 'Compile the file')
+        self.compileMenu.Append(ID_CHECK_MODEL, 'Check model',
+                 'Loading and run the model')
         self.compileMenu.AppendSeparator()
         self.compileMenu.Append(ID_RUN, 'Run in Shell',
@@ -192,5 +233,5 @@
         Run
         """
-        if self._check_changed():
+        if not self._check_saved():
             return True
         if self.buffer and self.buffer.doc.filepath:
@@ -207,20 +248,21 @@
             icon = wx.ICON_ERROR
             wx.MessageBox(str(mssg), title, style=icon)
-            return 0
-
-    def OnCompile(self, event):
+            return False
+
+    def OnCheckModel(self, event):
         """
         Compile
         """
-        if self._check_changed():
+        if not self._check_saved():
             return True
-        run_out = self.OnRun(None)
-        if self._get_err_msg(run_out):
-            if self._manager != None and self.panel != None:
-                self._manager.set_edit_menu_helper(self.parent)
-                # Update custom model list in fitpage combobox
-                wx.CallAfter(self._manager.update_custom_combo)
-
-    def _check_changed(self):
+        fname = self.editor.getStatus()[0]
+        success = show_model_output(self, fname)
+
+        # Update custom model list in fitpage combobox
+        if success and self._manager != None and self.panel != None:
+            self._manager.set_edit_menu_helper(self.parent)
+            wx.CallAfter(self._manager.update_custom_combo)
+
+    def _check_saved(self):
         """
         If content was changed, suggest to save it first
@@ -228,52 +270,5 @@
         if self.bufferHasChanged() and self.buffer.doc.filepath:
             cancel = self.bufferSuggestSave()
-            if cancel:
-                return cancel
-
-    def _get_err_msg(self, text=''):
-        """
-        Get err_msg
-        """
-        name = None
-        mssg = "\n This is not a python file."
-        title = 'Error'
-        icon = wx.ICON_ERROR
-        try:
-            fname = self.editor.getStatus()[0]
-            name = os.path.basename(fname)
-            if name.split('.')[-1] != 'py':
-                wx.MessageBox(str(mssg), title, style=icon)
-                return False
-            msg = compile_file(fname)
-        except:
-            msg = None
-        if name == None:
-            wx.MessageBox(str(mssg), title, style=icon)
-            return False
-        mssg = "Compiling '%s'...\n" % name
-        if msg != None:
-            mssg += "Error occurred:\n"
-            mssg += str(msg) + "\n\n"
-            if text:
-                mssg += "Run-Test results:\n"
-                mssg += str(text)
-                title = 'Warning'
-                icon = wx.ICON_WARNING
-        else:
-            mssg += "Successful.\n\n"
-            if text:
-                if text.count('Failed') or text.count('Error:') > 0:
-                    mssg += "But Simple Test FAILED: Please check your code.\n"
-                mssg += "Run-Test results:\n"
-                mssg += str(text)
-            title = 'Info'
-            icon = wx.ICON_INFORMATION
-        dlg = wx.lib.dialogs.ScrolledMessageDialog(self, mssg, title,
-                                                   size=((550, 250)))
-        fnt = wx.Font(10, wx.TELETYPE, wx.NORMAL, wx.NORMAL)
-        dlg.GetChildren()[0].SetFont(fnt)
-        dlg.GetChildren()[0].SetInsertionPoint(0)
-        dlg.ShowModal()
-        dlg.Destroy()
+            return not cancel
         return True
 
@@ -286,5 +281,5 @@
         event.Enable(True)
         try:
-            if id == ID_COMPILE or id == ID_RUN:
+            if id == ID_CHECK_MODEL or id == ID_RUN:
                 menu_on = False
                 if self.buffer and self.buffer.doc.filepath:
