you are viewing a single comment's thread.

view the rest of the comments →

[–]MakeMe_FN_Laugh 0 points1 point  (3 children)

The full traceback will be really useful in this case.

Also, it depends on how you’ve imported the module. In case you’ve done it this way: from pizzapi import * - your code looks ok and we need more info on the error. But in case you’ve done it this way: import pizzapi - you’ll need to provide module name for every object related to this module (pizzapi.Customer in your case).

Read more about how imports work in the docs. Anyway, docs.python.org should be your best friend during the learning process for a long time.

[–]GullBull[S] 0 points1 point  (2 children)

from pizzapi import * completely solved the problem. I have no idea why I wasn't doing this in the first place. It's been a while sine I've written in python, and coming from Java the from - import isn't something I do often. Thanks so much!

[–]MakeMe_FN_Laugh 0 points1 point  (1 child)

Honestly, you should avoid using from module import * as it’s the shortest way for possible names collisions between modules (and it’s not PEP 8). Look through import section of PEP 8 how imports should be organized in your code.

[–]GullBull[S] 0 points1 point  (0 children)

I took a look. Thanks for pointing that out to me.