How to use command line arguments in Python using idle editor

To use command line arguments inside idle we can use below code to auto-detect the command line arguments. This will help us run the program without closing the idle by using Run command or F5 from idle.

if 'idlelib' in sys.modules: sys.argv.extend(input("Args: ").split())

Below is a video showing the same