How to call Python module from command line?

PythonServer Side ProgrammingProgramming

If we are writing a Python script that is to be used as a module, we can test this module by adding this call of the function to the bottom:

def fubar():
    #does something useful
fubar()

and run it  at the command prompt like this:

~$ python fubar.py
raja
Published on 07-Dec-2017 10:41:41
Advertisements