推荐学习书目
› 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
diver02
V2EX  ›  Python

Python _file_ 参数飘红,无解

  •  
  •   diver02 · Sep 14, 2019 · 4485 views
    This topic created in 2606 days ago, the information mentioned may be changed or developed.

    8 replies  •  2019-09-15 16:17:55 +08:00
    BingoXuan
    BingoXuan
    Sep 14, 2019❤️3
    1
    你应该是想用__file__吧,而不是_file_

    吟唱 python 魔法都要用双下划线开头双下划线结束的,不然施法失败炸了自己
    unixeno
    unixeno
    Sep 14, 2019 via Android
    2
    所以_file_是啥
    diver02
    diver02
    OP
    Sep 14, 2019
    3
    @unixeno 才入门,我太蔡了
    fakepoet
    fakepoet
    Sep 14, 2019
    4
    看得脑袋疼,尽量 PEP8 一点吧
    diver02
    diver02
    OP
    Sep 14, 2019
    5
    GTX765
    GTX765
    Sep 15, 2019 via iPhone
    6
    个人建议 os 和 os.path 熟悉了之后就不要用了 是不是 pathlib
    GTX765
    GTX765
    Sep 15, 2019 via iPhone
    7
    @GTX765 试一试*
    diver02
    diver02
    OP
    Sep 15, 2019
    8
    @GTX765 我了解下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1274 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 21:43 · PVG 05:43 · LAX 13:43 · JFK 16:43
    ♥ Do have faith in what you're doing.