Skip to content

NameError: name 'print_models' is not defined #3

Description

@OctopusLian

运行8-16print_models.py程序

import printing_functions

unprinted_designs = ['iphone case', 'robot pendant', 'dodecahedron']
completed_models = []

print_models(unprinted_designs, completed_models)
show_completed_models(completed_models)

报错信息

Traceback (most recent call last):
  File "/home/zoctopus/code/github_organization/programming-book-practice/Python-Crash-Course-Homework/chapter08/print_models.py", line 6, in <module>
    print_models(unprinted_designs, completed_models)
NameError: name 'print_models' is not defined

思考

按照书上讲解,import文件名后,这个被引入文件里的所有定义的函数都是通用的。
为什么报not defined的错误呢?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions