import os
cdir = os.getcwd() # it will return current working directory
print("Previous_dir",cdir)
# Previous_dir C:Users..Desktoppython
os.chdir('C:/Users/../Desktop/desire_folder') #chdir used for change direcotry
print("Current_dir",cdir)
# Current_dir C:Users..Desktoppython eamspirit
import os
os.chdir(os.path.dirname(os.path.abspath(__file__)))
import os
os.chdir(new_working_directory)
# Import the os module
import os
# Print the current working directory
print("Current working directory: {0}".format(os.getcwd()))
# Change the current working directory
os.chdir('/tmp')
# Print the current working directory
print("Current working directory: {0}".format(os.getcwd()))
import inspect
import os
module_path = inspect.getfile(inspect.currentframe())
module_dir = os.path.realpath(os.path.dirname(module_path))
os.chdir(module_dir)