how to pause a screen in a python programme in terminal via input()

 cross-platform way; works everywhere

import os, sys

if sys.platform == 'win32':
    os.system('pause')
else:
    input('Press any key to continue...')

Post a Comment

1 Comments

  1. Very well logic.
    I was finding a way to pause screen in Linux.
    This is the best way. I can also change pause message.
    Keep posting Such Blogs. I will support you.

    ReplyDelete