Debug School

rakesh kumar
rakesh kumar

Posted on

How to find the location (file path) of a Jupyter Notebook file

To find the location (file path) of a Jupyter Notebook file (in this case, "webscrapping.ipynb") on your laptop, you can follow these steps:

Open Jupyter Notebook:

Open your Jupyter Notebook environment. If you haven't installed Jupyter Notebook, you can install it using pip if it's not already

pip install notebook
Enter fullscreen mode Exit fullscreen mode

Start Jupyter Notebook by running the following command in your terminal:

Navigate to the Notebook:

Once Jupyter Notebook is running, it should open in your default web browser.
You'll see a file browser interface where you can navigate to your notebook files.
Locate the Notebook:

Use the file browser to navigate to the location where you saved your "webscrapping.ipynb" file.
View the File Path:

In the Jupyter Notebook interface, you'll see the file path at the top of the browser, showing your current directory.
The "webscrapping.ipynb" file should be listed there, along with its full file path on your laptop.
Alternatively, if you want to find the file path using Python code, you can do the following:

import os

# Get the current working directory
current_directory = os.getcwd()

# Combine it with the notebook filename
notebook_filename = "webscrapping.ipynb"
notebook_path = os.path.join(current_directory, notebook_filename)

print("Notebook File Path:", notebook_path)
Enter fullscreen mode Exit fullscreen mode

Running this code in a Jupyter Notebook cell will print the file path of your "webscrapping.ipynb" file.

Top comments (0)