Skip to content
Advertisement

How to detect folder path i ran script for?

the below script is to unzip zip file and rename extaracted subtitles names according to tv show episodes names. and then convert them to utf-8.

here is the problem:

I want to run this script in a linux os and inside any tv show folder i want.
but I want the path in fixing function to be detected from the folder itselt i run the python script for because it is not a constant path, there are many tv show folders.

sorry for my english

JavaScript

Advertisement

Answer

function to get the current working directory

JavaScript

to call this function you need to import os module

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement