In some part of my python program, I need to do this -
- print a message on the terminal (using the print command)
- create multiple directories (using os.mkdirs)
- copy file (using shutil.copy2)
- Display the message on the terminal again (using the print command)
(All this in a loop)
Now the problem is that the command '1.' runs to "2.", '3.' and "4.", the message of the command "1" is actually displayed. on the screen after completing all 4 commands (together with the message "4."). I want it to display the command message "1". first, then start with the rest of the code ... How can I do this? (Is there something like flushing for the print command?)
source share