python change cwd to script directory

os.chdir(os.path.dirname(os.path.abspath(__file__)))

Here is what the above code is Doing:
1. Importing the os module.
2. Changing the working directory to the directory where the script is located.
3. Creating a list of files in the current directory.
4. Creating a list of directories in the current directory.
5. Creating a list of all files in the current directory and all its subdirectories.
6. Creating a list of all directories in the current directory and all its subdirectories.
7. Creating a list of all files in the current directory and all its subdirectories, recursively.
8. Creating a list of all directories in the current directory and all its subdirectories, recursively.