Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 99283958e02e707947696333c8b94bf19a5fbefe)
+++ src/Makefile.am	(revision 7e3f11ae21f8142c4998712a6634b9468483553b)
@@ -27,4 +27,8 @@
 include Fragmentation/Automation/Makefile.am
 include Jobs/Makefile.am
+endif
+
+if CONDPYTHON
+include Python/Makefile.am
 endif
 
@@ -319,4 +323,5 @@
 
 
+
 molecuilder_CPPFLAGS  = $(AM_CPPFLAGS)
 #molecuilder_CPPFLAGS += -DNO_CACHING
@@ -331,6 +336,5 @@
 	builder.cpp \
 	builder_init.cpp \
-	builder_init.hpp \
-	PythonScripting.hpp
+	builder_init.hpp
 molecuilder_LDADD = \
 	libMolecuilderUI.la
@@ -363,5 +367,5 @@
 	builder_init.cpp \
 	builder_init.hpp \
-	PythonScripting.hpp
+	Python/PythonScripting.hpp
 molecuildergui_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_GUI_QT
 molecuildergui_LDFLAGS = \
Index: src/Python/Makefile.am
===================================================================
--- src/Python/Makefile.am	(revision 7e3f11ae21f8142c4998712a6634b9468483553b)
+++ src/Python/Makefile.am	(revision 7e3f11ae21f8142c4998712a6634b9468483553b)
@@ -0,0 +1,57 @@
+# PLEASE adhere to the alphabetical ordering in this Makefile!
+# Also indentation by a single tab
+
+PYTHONSOURCE = \
+	Python/PythonScripting.cpp
+				  
+PYTHONHEADER = \
+	Python/PythonScripting_impl.hpp \
+	Python/PythonScripting.hpp
+
+
+noinst_LTLIBRARIES += libMolecuilderPython.la
+libMolecuilderPython_la_includedir = $(includedir)/MoleCuilder/
+libMolecuilderPython_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(PYTHON_INCLUDE_DIR)
+libMolecuilderPython_la_LDFLAGS = $(AM_LDFLAGS) $(BOOST_PYTHON_LDFLAGS) 
+libMolecuilderPython_la_LIBADD = \
+	$(BOOST_PYTHON_LIBS) \
+	${CodePatterns_LIBS} \
+	-l$(PYTHON_LIB)
+
+nobase_libMolecuilderPython_la_include_HEADERS = ${PYTHONHEADER}
+
+## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la"
+## target.  Note that @MOLECUILDER_API_VERSION@ is not interpreted by Automake and
+## will therefore be treated as if it were literally part of the target name,
+## and the variable name derived from that.
+## The file extension .cc is recognized by Automake, and makes it produce
+## rules which invoke the C++ compiler to produce a libtool object file (.lo)
+## from each source file.  Note that it is not necessary to list header files
+## which are already listed elsewhere in a _HEADERS variable assignment.
+libMolecuilderPython_la_SOURCES = ${PYTHONSOURCE}
+
+## Instruct libtool to include ABI version information in the generated shared
+## library file (.so).  The library ABI version is defined in configure.ac, so
+## that all version information is kept in one place.
+#libMolecuilderPython_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION)
+
+## The generated configuration header is installed in its own subdirectory of
+## $(libdir).  The reason for this is that the configuration information put
+## into this header file describes the target platform the installed library
+## has been built for.  Thus the file must not be installed into a location
+## intended for architecture-independent files, as defined by the Filesystem
+## Hierarchy Standard (FHS).
+## The nodist_ prefix instructs Automake to not generate rules for including
+## the listed files in the distribution on 'make dist'.  Files that are listed
+## in _HEADERS variables are normally included in the distribution, but the
+## configuration header file is generated at configure time and should not be
+## shipped with the source tarball.
+#libMolecuilderPython_libincludedir = $(libdir)/MoleCuilder/include
+#nodist_libMolecuilderPython_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
+
+## Install the generated pkg-config file (.pc) into the expected location for
+## architecture-dependent package configuration information.  Occasionally,
+## pkg-config files are also used for architecture-independent data packages,
+## in which case the correct install location would be $(datadir)/pkgconfig.
+#pkgconfigdir = $(libdir)/pkgconfig
+#pkgconfig_DATA = $(top_builddir)/MoleCuilder.pc
Index: src/Python/PythonScripting.cpp
===================================================================
--- src/Python/PythonScripting.cpp	(revision 7e3f11ae21f8142c4998712a6634b9468483553b)
+++ src/Python/PythonScripting.cpp	(revision 7e3f11ae21f8142c4998712a6634b9468483553b)
@@ -0,0 +1,76 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2013 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * PythonScripting.cpp
+ *
+ *  Created on: Aug 26, 2013
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// boost::python uses placement new which is incompatible with MemDebug.
+#include "PythonScripting_impl.hpp"
+#include "PythonScripting.hpp"
+
+#include "CodePatterns/MemDebug.hpp"
+
+bool executePythonScript(const std::string &pythonfilename_string)
+{
+  boost::filesystem::path pythonfilename(pythonfilename_string);
+  if (exists(pythonfilename)) {
+    // parse in and execute the local and global config.py
+    try {
+      PyImport_AppendInittab( "pyMoleCuilder", &initpyMoleCuilder );
+
+      Py_Initialize();
+
+      boost::python::object main_module((
+          boost::python::handle<>(boost::python::borrowed(PyImport_AddModule("__main__")))));
+
+      boost::python::object main_namespace = main_module.attr("__dict__");
+
+      boost::python::object molecuilder_module( (boost::python::handle<>(PyImport_ImportModule("pyMoleCuilder"))) );
+      main_namespace["pyMoleCuilder"] = molecuilder_module;
+
+      // parse file into a string
+      std::ifstream pythonfile(pythonfilename.string().c_str());
+      std::string pythonscript( std::istreambuf_iterator<char>(pythonfile),
+          (std::istreambuf_iterator<char>()) );
+      std::string enveloped_script("print \"BEGIN of "+pythonfilename_string+":\"\n");
+      enveloped_script += pythonscript;
+      enveloped_script += std::string("print \"END of "+pythonfilename_string+":\"\n");
+
+      boost::python::handle<> ignored(( PyRun_String( enveloped_script.c_str(),
+          Py_file_input,
+          main_namespace.ptr(),
+          main_namespace.ptr() ) ));
+
+    } catch( boost::python::error_already_set ) {
+      PyErr_Print();
+    }
+  }
+}
Index: src/Python/PythonScripting.hpp
===================================================================
--- src/Python/PythonScripting.hpp	(revision 7e3f11ae21f8142c4998712a6634b9468483553b)
+++ src/Python/PythonScripting.hpp	(revision 7e3f11ae21f8142c4998712a6634b9468483553b)
@@ -0,0 +1,20 @@
+/*
+ * PythonScripting.hpp
+ *
+ *  Created on: Aug 26, 2013
+ *      Author: heber
+ */
+
+#ifndef PYTHONSCRIPTING_HPP_
+#define PYTHONSCRIPTING_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string>
+
+bool executePythonScript(const std::string &pythonfilename_string);
+
+#endif /* PYTHONSCRIPTING_HPP_ */
Index: src/Python/PythonScripting_impl.hpp
===================================================================
--- src/Python/PythonScripting_impl.hpp	(revision 7e3f11ae21f8142c4998712a6634b9468483553b)
+++ src/Python/PythonScripting_impl.hpp	(revision 7e3f11ae21f8142c4998712a6634b9468483553b)
@@ -0,0 +1,98 @@
+/*
+ * PythonScripting.hpp
+ *
+ *  Created on: Apr 13, 2012
+ *      Author: heber
+ */
+
+#ifndef PYTHONSCRIPTING_HPP_
+#define PYTHONSCRIPTING_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <boost/python.hpp>
+#include <boost/python/module.hpp>
+#include <boost/python/args.hpp>
+
+#include "CodePatterns/toString.hpp"
+
+//!> define all present actions
+#include "GlobalListOfActions.hpp"
+
+//!> python wrapping for all of these actions
+#include "AllActionPython.hpp"
+
+namespace MoleCuilder {
+
+namespace PythonTypes {
+
+inline void IndexError(){
+    PyErr_SetString(PyExc_IndexError, "Index out of range");
+    boost::python::throw_error_already_set();
+}
+
+template<class T>
+struct vec_item{
+    typedef typename T::value_type V;
+    static V& get(T& x, int i){
+        static V nothing;
+        if(i < 0) i += x.size();
+        if(i >= 0 && i < int(x.size())) return x[i];
+        IndexError();
+        return nothing;
+    }
+    static void set(T& x, int i, V const& v){
+        if(i < 0) i += x.size();
+        if(i >= 0 && i < int(x.size())) x[i] = v;
+        else IndexError();
+    }
+    static void del(T& x, int i){
+        if(i < 0) i += x.size();
+        if(i >= 0 && i < int(x.size())) x.erase(x.begin() + i);
+        else IndexError();
+    }
+    static void add(T& x, V const& v){
+        x.push_back(v);
+    }
+};
+
+
+} /* namespace PythonTypes */
+} /* namespace MoleCuilder */
+
+BOOST_PYTHON_MODULE(pyMoleCuilder)
+{
+  // set the docstring of the current module scope
+  boost::python::scope().attr("__doc__") = "pyMolecuilder are the python bindings to all Actions of the program suite MoleCuilder.\n\nMoleCuilder is a program to build molecular (dynamics) worlds, allowing you indefinite manipulation, control and analysis over the atoms and molecules within a simulation domain.";
+
+  // STL Vectors:
+  // doubleVec
+  boost::python::class_< std::vector< double > >("PythonType_doubleVec")
+      .def("__len__", &std::vector< double >::size)
+      .def("clear", &std::vector< double >::clear)
+      .def("append", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::add,
+            boost::python::with_custodian_and_ward<1, 2>()) // let container keep value
+      .def("__getitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::get,
+           boost::python::return_value_policy<boost::python::copy_non_const_reference>())
+      .def("__setitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::set,
+           boost::python::with_custodian_and_ward<1,2>()) // to let container keep value
+      .def("__delitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::del)
+      .def("__iter__", boost::python::iterator< std::vector< double > >())
+  ;
+
+
+#define export_print(z,n,list) \
+  BOOST_PP_CAT(export_, BOOST_PP_SEQ_ELEM(n, list))();
+#define BOOST_PP_LOCAL_MACRO(n) export_print(~, n, GLOBALLISTOFACTIONS)
+#define BOOST_PP_LOCAL_LIMITS  (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(GLOBALLISTOFACTIONS)))
+#include BOOST_PP_LOCAL_ITERATE()
+#undef instance_print
+}
+
+
+#endif /* PYTHONSCRIPTING_HPP_ */
Index: src/PythonScripting.hpp
===================================================================
--- src/PythonScripting.hpp	(revision 99283958e02e707947696333c8b94bf19a5fbefe)
+++ 	(revision )
@@ -1,134 +1,0 @@
-/*
- * PythonScripting.hpp
- *
- *  Created on: Apr 13, 2012
- *      Author: heber
- */
-
-#ifndef PYTHONSCRIPTING_HPP_
-#define PYTHONSCRIPTING_HPP_
-
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include <boost/python.hpp>
-#include <boost/python/module.hpp>
-#include <boost/python/args.hpp>
-
-#include "CodePatterns/toString.hpp"
-
-//!> define all present actions
-#include "GlobalListOfActions.hpp"
-
-//!> python wrapping for all of these actions
-#include "AllActionPython.hpp"
-
-namespace MoleCuilder {
-
-namespace PythonTypes {
-
-inline void IndexError(){
-    PyErr_SetString(PyExc_IndexError, "Index out of range");
-    boost::python::throw_error_already_set();
-}
-
-template<class T>
-struct vec_item{
-    typedef typename T::value_type V;
-    static V& get(T& x, int i){
-        static V nothing;
-        if(i < 0) i += x.size();
-        if(i >= 0 && i < int(x.size())) return x[i];
-        IndexError();
-        return nothing;
-    }
-    static void set(T& x, int i, V const& v){
-        if(i < 0) i += x.size();
-        if(i >= 0 && i < int(x.size())) x[i] = v;
-        else IndexError();
-    }
-    static void del(T& x, int i){
-        if(i < 0) i += x.size();
-        if(i >= 0 && i < int(x.size())) x.erase(x.begin() + i);
-        else IndexError();
-    }
-    static void add(T& x, V const& v){
-        x.push_back(v);
-    }
-};
-
-
-} /* namespace PythonTypes */
-} /* namespace MoleCuilder */
-
-BOOST_PYTHON_MODULE(pyMoleCuilder)
-{
-  // set the docstring of the current module scope
-  boost::python::scope().attr("__doc__") = "pyMolecuilder are the python bindings to all Actions of the program suite MoleCuilder.\n\nMoleCuilder is a program to build molecular (dynamics) worlds, allowing you indefinite manipulation, control and analysis over the atoms and molecules within a simulation domain.";
-
-  // STL Vectors:
-  // doubleVec
-  boost::python::class_< std::vector< double > >("PythonType_doubleVec")
-      .def("__len__", &std::vector< double >::size)
-      .def("clear", &std::vector< double >::clear)
-      .def("append", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::add,
-            boost::python::with_custodian_and_ward<1, 2>()) // let container keep value
-      .def("__getitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::get,
-           boost::python::return_value_policy<boost::python::copy_non_const_reference>())
-      .def("__setitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::set,
-           boost::python::with_custodian_and_ward<1,2>()) // to let container keep value
-      .def("__delitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::del)
-      .def("__iter__", boost::python::iterator< std::vector< double > >())
-  ;
-
-
-#define export_print(z,n,list) \
-  BOOST_PP_CAT(export_, BOOST_PP_SEQ_ELEM(n, list))();
-#define BOOST_PP_LOCAL_MACRO(n) export_print(~, n, GLOBALLISTOFACTIONS)
-#define BOOST_PP_LOCAL_LIMITS  (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(GLOBALLISTOFACTIONS)))
-#include BOOST_PP_LOCAL_ITERATE()
-#undef instance_print
-}
-
-bool executePythonScript(const std::string &pythonfilename_string)
-{
-  boost::filesystem::path pythonfilename(pythonfilename_string);
-  if (exists(pythonfilename)) {
-    // parse in and execute the local and global config.py
-    try {
-      PyImport_AppendInittab( "pyMoleCuilder", &initpyMoleCuilder );
-
-      Py_Initialize();
-
-      boost::python::object main_module((
-          boost::python::handle<>(boost::python::borrowed(PyImport_AddModule("__main__")))));
-
-      boost::python::object main_namespace = main_module.attr("__dict__");
-
-      boost::python::object molecuilder_module( (boost::python::handle<>(PyImport_ImportModule("pyMoleCuilder"))) );
-      main_namespace["pyMoleCuilder"] = molecuilder_module;
-
-      // parse file into a string
-      std::ifstream pythonfile(pythonfilename.string().c_str());
-      std::string pythonscript( std::istreambuf_iterator<char>(pythonfile),
-          (std::istreambuf_iterator<char>()) );
-      std::string enveloped_script("print \"BEGIN of "+pythonfilename_string+":\"\n");
-      enveloped_script += pythonscript;
-      enveloped_script += std::string("print \"END of "+pythonfilename_string+":\"\n");
-
-      boost::python::handle<> ignored(( PyRun_String( enveloped_script.c_str(),
-          Py_file_input,
-          main_namespace.ptr(),
-          main_namespace.ptr() ) ));
-
-    } catch( boost::python::error_already_set ) {
-      PyErr_Print();
-    }
-  }
-}
-
-#endif /* PYTHONSCRIPTING_HPP_ */
Index: src/UIElements/Makefile.am
===================================================================
--- src/UIElements/Makefile.am	(revision 99283958e02e707947696333c8b94bf19a5fbefe)
+++ src/UIElements/Makefile.am	(revision 7e3f11ae21f8142c4998712a6634b9468483553b)
@@ -268,5 +268,12 @@
 	libMolecuilderRandomNumbers.la \
 	libMolecuilderPotentials.la \
-	libMolecuilderFunctionApproximation.la \
+	libMolecuilderFunctionApproximation.la
+
+if CONDPYTHON
+libMolecuilderUI_la_LIBADD += \
+	libMolecuilderPython.la
+endif
+
+libMolecuilderUI_la_LIBADD += \
 	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
 	${CodePatterns_LIBS} \
@@ -276,4 +283,5 @@
 	$(BOOST_SYSTEM_LIBS) \
 	$(BOOST_THREAD_LIBS)
+
 
 if CONDLEVMAR
Index: src/builder_init.cpp
===================================================================
--- src/builder_init.cpp	(revision 99283958e02e707947696333c8b94bf19a5fbefe)
+++ src/builder_init.cpp	(revision 7e3f11ae21f8142c4998712a6634b9468483553b)
@@ -35,5 +35,5 @@
 // boost::python uses placement new which is incompatible with MemDebug.
 #ifdef HAVE_PYTHON
-#include "PythonScripting.hpp"
+#include "Python/PythonScripting.hpp"
 #endif
 
