diff -rupN ParaView-3.12.0.orig/Qt/Python/pqPythonManager.cxx ParaView-3.12.0/Qt/Python/pqPythonManager.cxx
--- ParaView-3.12.0.orig/Qt/Python/pqPythonManager.cxx	2012-08-14 07:01:07.101463241 +0200
+++ ParaView-3.12.0/Qt/Python/pqPythonManager.cxx	2012-08-14 07:11:00.149444673 +0200
@@ -30,6 +30,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 
 =========================================================================*/
 #include <vtkPython.h> // Python first
+
+#ifdef FRED
+#include "vtkProcessModule.h"
+#include "vtkPVOptions.h"
+#include "vtkPVPythonInteractiveInterpretor.h"
+#endif
+
 #include "pqPythonManager.h"
 #include "pqApplicationCore.h"
 #include "pqCoreUtilities.h"
@@ -211,6 +218,68 @@ void pqPythonManager::executeScript(cons
   dialog->runScript(QStringList(filename));
 }
 
+void pqPythonManager::executeRawScript(const QString& script)
+{
+#ifndef FRED
+  // Method 1 - use the manager's built in interpreter
+  pqPythonShell* shell(this->pythonShellDialog()->shell());
+  if (!shell)
+  {
+    return;
+  }
+  shell->executeScript(script);
+#else
+  // Method 2 - use our own interpreter
+  vtkPVPythonInteractiveInterpretor* interpreter(vtkPVPythonInteractiveInterpretor::New());
+  if (!interpreter)
+  {
+    return;
+  }
+
+  interpreter->SetCaptureStreams(true);
+  char* argv0(const_cast<char*>(vtkProcessModule::GetProcessModule()->GetOptions()->GetArgv0()));
+  interpreter->InitializeSubInterpretor(1,&argv0);
+  interpreter->MakeCurrent();
+    
+  // Setup Python's interactive prompts
+  PyObject* ps1 = PySys_GetObject(const_cast<char*>("ps1"));
+  if (!ps1)
+  {
+    PySys_SetObject(const_cast<char*>("ps1"),
+                    ps1 = PyString_FromString(">>> "));
+    Py_XDECREF(ps1);
+  }
+
+  PyObject* ps2 = PySys_GetObject(const_cast<char*>("ps2"));
+  if(!ps2)
+  {
+    PySys_SetObject(const_cast<char*>("ps2"),
+                    ps2 = PyString_FromString("... "));
+    Py_XDECREF(ps2);
+  }
+  interpreter->ReleaseControl();
+
+  // Execute script
+  interpreter->RunSimpleString(script.toAscii().data());
+
+  if (interpreter)
+  {
+    interpreter->MakeCurrent();
+
+    // Restore Python's original stdout and stderr
+    PySys_SetObject(const_cast<char*>("stdout"),
+                    PySys_GetObject(const_cast<char*>("__stdout__")));
+    PySys_SetObject(const_cast<char*>("stderr"),
+                    PySys_GetObject(const_cast<char*>("__stderr__")));
+    interpreter->ReleaseControl();
+    interpreter->Delete();
+  }
+  interpreter = NULL;
+#endif
+
+  return;
+}
+
 //-----------------------------------------------------------------------------
 void pqPythonManager::onRemovingServer(pqServer* /*server*/)
 {
@@ -231,7 +300,7 @@ void pqPythonManager::onRemovingServer(p
 void pqPythonManager::onServerCreationFinished(pqServer* server)
 {
   this->Internal->ActiveServer = server;
-  // Initialize interpretor using the new server connection.
+  // Initialize interpreter using the new server connection.
   if (this->interpreterIsInitialized())
     {
     this->initializeParaviewPythonModules();
diff -rupN ParaView-3.12.0.orig/Qt/Python/pqPythonManager.h ParaView-3.12.0/Qt/Python/pqPythonManager.h
--- ParaView-3.12.0.orig/Qt/Python/pqPythonManager.h	2012-08-14 07:00:43.597463977 +0200
+++ ParaView-3.12.0/Qt/Python/pqPythonManager.h	2012-08-13 13:57:34.751386041 +0200
@@ -126,10 +126,14 @@ signals:
 
 public slots:
   // Description:
-  // Executes the given script.  If the python interpreter hasn't been initialized
+  // Executes the given script from a file.  If the python interpreter hasn't been initialized
   // yet it will be initialized.
   void executeScript(const QString& filename);
 
+  // Executes the given script in the string.  If the python interpreter hasn't been initialized
+  // yet it will be initialized.
+  void executeRawScript(const QString& script);
+
   // Description:
   // Launch python editor to edit the macro
   void editMacro(const QString& fileName);
