I am able to get inside a docker container using below command
os.system('docker exec -ti $(docker ps -q -a --filter "name=XXXXX") /bin/bash')
and then i need to change to the following directory in the container.
/u01/oracle/weblogic/*****
when i use os.chdir("/u01/oracle/weblogic/*****"), i am getting No such Directory error.
I could see that os.getcwd() is still printing the previous directory where the python script is running instead of docker directory.
Could someone let me know what i am missing ?

/u01/oracle/weblogicsubprocessmodule instead ofos.system()and pipe the command you want to use in. But in general: You should not do automated tasks from outside the docker container, that breaks the concept of docker.