NameError: name 'BillPayer' is not defined
Question: I am getting the above error when trying to run my code. I believe it suffers
from being a broad error, as all my googling has not brought me to anything
that relates to my actual situation. I have organized the directory like this:

    
    
    Project (BillPay)
        bill.py (contains Class Bill())
        billPayer.py (contains Class BillPayer())
        main.py
        __init__.py
    

I have left my `__init__.py` empty, which I understand to be ok.

In main.py, I have:

    
    
    #!/usr/bin/python
    
    import sys
    sys.path.insert(0, "/home/matt/Documents/Code/BillPay")
    import bill
    import billPayer
    
    bill_machine = BillPayer()
    bill_machine.addBill(Google, 12345, 100.00, www.google.com)
    bill_machine.printBills()
    

If I have imported the module billPayer (which contains the BillPayer class),
then I should be able create an instance of that class, right? What am I
missing?


Answer: Two ways to go about it either

`billPayer.BillPayer()`

or

`from billPayer import BillPayer`

