title: python delayed execution of print command?
body: <p>In some part of my python program , I need to do this -</p>
  
  <ol>
  <li>print a message on the terminal (using the print command)</li>
  <li>make some directories (using os.mkdirs)</li>
  <li>copy a file (using shutil.copy2)</li>
  <li>Again display a message on terminal (using the print command)</li>
  </ol>
  
  <p>(All this is in a loop)</p>
  
  <p>Now the problem is, although command '1.' is executed before '2.' , '3.' and '4.', it actually displays the message of command '1.' on the screen after all 4 commands have been executed, (along with the message of command '4.'). What I want is that it should display the message of command '1.' first, then start with the remaining piece of code... How can I make this happen? (Is there something like flushing for the print command as well?)</p>