Thanks to both Fernando and Daniel for your suggestions. However, I probably didn't explain myself very clearly. My aim is not only to provide display only, debug mode for external commands, but also for possibly disrupting Python statements. One example could be: import shutil shutil.copyfile(src,dest) Thanks for your help. Nicola Musatti