for running ros 1: first terminal:

roscore 

command to start the port

second Terminal:

catkin_make
source path/devel/setup.bash
python3 mainwindow.py

Ros 2:

terminal command:

colcon build
source install/setup.bash
python3 mainwindow.py

Colcon build, catkin_make and catkin build are ros debugger

they will detect any errors indicating in the table below.

In Summary ros 1 noetic in docker is required to run 2 terminal while ros 2 humble is required to run 1 terminals for the setup since i am using subprocess from python library , the subprocess library are considered a command line for running an extra terminal for rosrun.

This algorithm subprocess.Popen([”rosrun/ros2run” , “package_name” , “listener_node.py”],) will reduce one terminal process.

the requirement to run this code is to source your ros after catkin_make and colon build . make sure you source the right file directory after catkin_make and colon build. Double check ros2 pkg list or rospack list if there is a talkerlistener in the list.