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
Updated on 26-Sep-2019 19:04:57