推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
input2output
V2EX  ›  Python

关于 CS50 Lecture 6 Python 演示时出现错误的原因

  •  
  •   input2output · Aug 10, 2022 · 2430 views
    This topic created in 1506 days ago, the information mentioned may be changed or developed.

    视频地址(含出错时刻定位):CS50 2021 - Lecture 6 - Python (SDR)

    stdio 输出 Found 是前一个演示代码 name.py 的结果,
    但在这个演示代码 phonebook.py 中,python 却输出了上一个演示代码的结果,
    就算是缓存的话,文件名也不一样啊,所以不太能理解为什么会出现这个错误

    查找了几个地方,没找到后续跟踪的调查,所以还请 V 友帮忙看看是哪里的问题

    2 replies  •  2022-08-10 23:05:15 +08:00
    bhy
        1
    bhy  
       Aug 10, 2022
    一般是因为什么地方有 `import names`, 所以 `names.py` 就被执行了。
    caqiko
        2
    caqiko  
       Aug 10, 2022
    可能是 cs50 引入了与当前目录下文件同名的包,看到有个 numbers 文件,有可能是这个锅。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1119 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 23:38 · PVG 07:38 · LAX 16:38 · JFK 19:38
    ♥ Do have faith in what you're doing.