Code snippet below:

import os
tmp = os.path.abspath(__file__)
tmp = os.path.dirname(tmp)
os.chdir(tmp)

I work as a freelancer, so if you don’t want to do that kind of things yourself or don’t have the time, just drop me a line to hire me.