How do you obtain a value of search path in Python?

Experience Level: Junior
Tags: Python

Answer

The search path can be obtained using the path variable from the sys module.

Example:

import sys

print(sys.path)

Python for beginners
Python for beginners

Are you learning Python ? Try our test we designed to help you progress faster.

Test yourself