.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples\gallery_examples\00-setup\setup.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_gallery_examples_00-setup_setup.py: .. _ref_setup: ===== Setup ===== This prepares the environment for running the examples. Description ----------- Perform the following steps to set up the environment: - Launch Sherlock. - Store the Sherlock tutorial path. .. GENERATED FROM PYTHON SOURCE LINES 34-45 .. code-block:: Python import os import sys # Add the 'examples' directory to the Python path to allow importing files in that directory. sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd())))) from examples.examples_globals import store_sherlock_tutorial_path from ansys.sherlock.core import launcher .. GENERATED FROM PYTHON SOURCE LINES 46-49 Launch Sherlock =============== Launch the Sherlock service and ensure proper initialization. .. GENERATED FROM PYTHON SOURCE LINES 49-56 .. code-block:: Python sherlock, ansys_install_path = launcher.launch_and_connect( port=9092, # sherlock_command_args="-noGUI", ) store_sherlock_tutorial_path(ansys_install_path) .. _sphx_glr_download_examples_gallery_examples_00-setup_setup.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: setup.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: setup.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: setup.zip `