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

and run it  at the command prompt like this:

~$ python
Published on 07-Dec-2017 15:11:41