Skip to content

Lab Exercise 1 Python

bjjwwang edited this page May 15, 2025 · 2 revisions

Configuration && debugging

To open and run the GraphTraversal.ipynb notebook, follow these steps:

  1. Launch Jupyter Notebook
    Open a terminal and navigate to the Lab-Exercise-1/Python directory. Then run:

    jupyter notebook

    If you are running in Docker, use this command instead:

    jupyter notebook --allow-root --ip=0.0.0.0

    This will launch Jupyter in your default web browser.

    You should see output similar to the image below in your terminal:

    Click on one of the provided URLs or files to access the Jupyter interface.

  2. Open the Notebook
    After clicking the URL, you will see an interface similar to the one shown below:

    Navigate to and click on GraphTraversal.ipynb to open the notebook.

  3. Run Cells
    After opening GraphTraversal.ipynb, scroll down to find the code cells. You should see something similar to the image below:
    To execute a code cell, either click on it and press Shift + Enter, or click the "Run" button in the toolbar at the top.

  4. Edit & Experiment
    You can freely modify the code cells to experiment with different inputs or graph structures.

If Jupyter is not installed, you can install it via pip:

pip install notebook

More information about Python