How does Linux Shell switch the current work environment?

the "working environment" here refers to, for example, different namespaces or even interactive environments for different programs.
for example, after 1:Docker creates a container a, you can enter the interactive environment of a to perform the configuration of the container (such as configuring a virtual Nic), and then press ctrl+p+q to return to the previous work environment for other work. Can this type of task be completed automatically through the shell script?
example 2: run mininet, using shell and want the shell script to include mininet commands such as H1 ping H2.
if feasible, hope to get tutorials (or tutorial portals)
if not, hope to have an alternative, thank you.

Mar.18,2021

it is recommended to use the os in front of python3
clipboard.png
to execute the task in the host computer, and enter the bash, of docker through the subprocess sp pipe to execute the task in bash. This is the effect you want, isn't it? full automation

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3cb64-431b3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3cb64-431b3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?