Found there is something even better a few weeks ago ... https://docs.python.org/3/library/pathlib.html On my own code I have switched to pathlib, but on such a big code base as FEM it would be quit some work and for sure some problems will come up. Thus I leave it for now with os.path even if we have in FEM on windows some paths with mixed slash and backslash. I works without problems but I do not like it ...vocx wrote: ↑Mon Oct 07, 2019 5:40 pmBy the way, when you are building paths, it's best to use Python's os.path functions. I would also avoid variables with double underscores as these are typically reserved for special internal properties.
Code: Select all
__dir__ + "/MBDyn/MBDynCase.mbd" os.path.join(__dir__, "MBDyn/MBDynCase.mbd")
If I would do something new I would take pathlib right from the beginning.