diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp
index 03d243f9220e2eec5dc7516198e6b4fa14b58dcb..431ed9ff488af92816b8f0f892429f0a44e2e89d 100644
--- a/Common/OpenFile.cpp
+++ b/Common/OpenFile.cpp
@@ -400,6 +400,11 @@ int MergeFile(const std::string &fileName, bool warnIfMissing)
     // FIXME: this is a hack -- think about a better way
     status = metamodel_cb(fileName);
   }
+  else if(ext == ".py"){
+    FlGui::instance()->onelab->addSolver("python", fileName, "", 1);
+    onelab_cb(0, (void*)"check");
+    status = 1;
+  }
 #endif
   else {
     CTX::instance()->geom.draw = 1;
diff --git a/contrib/onelab/python/OnelabClient.py b/contrib/onelab/python/OnelabClient.py
index 584c5f6dc4480a4daded0bc2991dd8004301bbcf..bcc4b236cba6dacfdbdfcf28f5e1f1f187a49414 100755
--- a/contrib/onelab/python/OnelabClient.py
+++ b/contrib/onelab/python/OnelabClient.py
@@ -62,6 +62,8 @@ class client :
   _GMSH_START = 1
   _GMSH_STOP = 2
   _GMSH_INFO = 10
+  _GMSH_MERGE_FILE = 20
+  _GMSH_PARSE_STRING = 21
   _GMSH_PARAMETER = 23
   _GMSH_PARAMETER_QUERY = 24
 
@@ -108,6 +110,13 @@ class client :
     self._get_parameter(p)
     return p.value
 
+  def merge_file(self, filename) :
+    if not self.socket :
+      return
+    if filename and filename[0] != '/' :
+      filename = os.getcwd() + "/" + filename;
+    self._send(self._GMSH_PARSE_STRING, 'Merge "'+filename+'";')
+
   def __init__(self):
     self.socket = None
     self.name = ""