From bd0168b88eb08f11a6184f7e847583e1f9b69d9f Mon Sep 17 00:00:00 2001 From: mara004 <65915611+mara004@users.noreply.github.com> Date: Thu, 29 Apr 2021 12:04:01 +0200 Subject: [PATCH 1/2] Use proper path separators This makes the script runnable under Linux/macOS, preventing an OSError --- example_math_nodes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example_math_nodes.py b/example_math_nodes.py index e384d47a..de1e96b5 100644 --- a/example_math_nodes.py +++ b/example_math_nodes.py @@ -8,6 +8,7 @@ update_nodes_by_down, setup_context_menu) from example_nodes import Nodes +from os.path import sep if __name__ == '__main__': QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) @@ -46,7 +47,7 @@ def show_nodes_list(node): [graph.register_node(n) for n in Nodes] # load preset session - graph.load_session(r'example_nodes\networks\example.nodes') + graph.load_session('example_nodes'+sep+'networks'+sep+'example.nodes') # update nodes update_nodes_by_down(graph.all_nodes()) From 6d428d460b2cf801c1ab0e4081e56663312ca781 Mon Sep 17 00:00:00 2001 From: mara004 <65915611+mara004@users.noreply.github.com> Date: Thu, 29 Apr 2021 12:06:01 +0200 Subject: [PATCH 2/2] Use os.path.join shorter --- example_math_nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example_math_nodes.py b/example_math_nodes.py index de1e96b5..c25b09fd 100644 --- a/example_math_nodes.py +++ b/example_math_nodes.py @@ -8,7 +8,7 @@ update_nodes_by_down, setup_context_menu) from example_nodes import Nodes -from os.path import sep +from os.path import join if __name__ == '__main__': QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) @@ -47,7 +47,7 @@ def show_nodes_list(node): [graph.register_node(n) for n in Nodes] # load preset session - graph.load_session('example_nodes'+sep+'networks'+sep+'example.nodes') + graph.load_session(join('example_nodes', 'networks', 'example.nodes')) # update nodes update_nodes_by_down(graph.all_nodes())