winIDEA SDK
test_find_or_start_instance.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6
7
8def test_find_or_start_instance():
9 print("Finding existing instance by ID, or starting new...")
10 cfg = ic.CConnectionConfig()
11 cfg.instanceId("sdk_example2")
12 cfg.start_if_required()
13 conn_mgr = ic.ConnectionMgr()
14 conn_mgr.connect(cfg)
15
16 # alternatively, user can find/start instance by specifying workspace file path
17 # cfg.workspace("C:/Desktop/myWorkspace/Sample.xjrf")
18
19
20if __name__ == "__main__":
21 test_find_or_start_instance()