I have a python script like this
def fubar(): #do something useful
How do I use this script as a python module from command line?
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
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more