You can use os and os.path library easily as follows
import os
os.chdir(os.path.dirname(os.getcwd()))
os.path.dirname returns upper directory from current one.
It lets us change to an upper level without passing any file argument and without knowing absolute path.