Nov-15-2022, 12:22 AM
Hi Team,
how to create separate function for validating command line arguments in another module
and import the same in main module
how to create separate function for validating command line arguments in another module
and import the same in main module
def main(): print("Directory watcher application") if (len(argv) < 2): print("Insufficient arguments") exit() if (argv[1] == "-h"): print("This script will travel the directory and display the names of all entries") exit() if (argv[1] == "-u"): print("Usage : Application_name Direcory_Name") exit() Directory_Watcher(argv[1]) if (__name__ == "__main__"): main()