From: azv Date: Fri, 6 May 2016 09:56:13 +0000 (+0300) Subject: Update Platine.py to create directory to store if it is not exists X-Git-Tag: V_2.3.0~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e8623c61ab61abec73f0c2055bc72914d3aba5c3;p=modules%2Fshaper.git Update Platine.py to create directory to store if it is not exists --- diff --git a/src/PythonAPI/examples/Platine.py b/src/PythonAPI/examples/Platine.py index e5b3cb50d..9ff45cca5 100644 --- a/src/PythonAPI/examples/Platine.py +++ b/src/PythonAPI/examples/Platine.py @@ -4,7 +4,12 @@ import geom import model + +# START DEBUG PURPOSES +# Should be removed +import os import ModelAPI +# END DEBUG PURPOSES # Initialisation model.begin() @@ -202,8 +207,12 @@ model.do() # START DEBUG PURPOSES # prepare a study without last operation to trap floating problem with degenerated line +aPathToStore = os.path.join(os.getcwd(), "Data") +print aPathToStore +if not os.path.exists(aPathToStore): + os.mkdir(aPathToStore) results = ModelAPI.StringList() -ModelAPI.ModelAPI_Session.get().save("Data", results) +ModelAPI.ModelAPI_Session.get().save(aPathToStore, results) # END DEBUG PURPOSES b4 = body_4()