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

.py文件无法直接执行

  •  
  •   vicence · Sep 8, 2013 · 4781 views
    This topic created in 4805 days ago, the information mentioned may be changed or developed.


    权限也加了,就是无法执行
    10 replies  •  1970-01-01 08:00:00 +08:00
    ipconfiger
    ipconfiger
    Sep 8, 2013
    1
    whereis python 看看你的解释器地址是不是 /usr/bin/python
    lennyh
    lennyh
    Sep 8, 2013
    2
    shbang line有问题,貌似是文件格式的原因,试试dos2unix...
    hadoop
    hadoop
    Sep 8, 2013
    3
    输入命令 which python 看看你的python的路径是哪个
    vicence
    vicence
    OP
    Sep 8, 2013
    4
    @hadoop
    @ipconfiger

    都没问题
    skydiver
    skydiver
    Sep 8, 2013
    5
    @vicence 脚本第一行写的什么?
    vicence
    vicence
    OP
    Sep 8, 2013
    6
    @skydiver
    @ipconfiger
    @lennyh
    @hadoop
    是文件格式问题,谢谢你们
    013231
    013231
    Sep 8, 2013
    7
    換行符的問題, 注意那個^M.
    Mutoo
    Mutoo
    Sep 8, 2013
    8
    看到状态栏 a.py[+][python,,dos]
    果断 :set ff=unix
    vicence
    vicence
    OP
    Sep 9, 2013
    9
    在window下,无论是dos,还是unix,都没问题,在太坑爹了
    TankyWoo
    TankyWoo
    Sep 9, 2013
    10
    EOL的问题, 以前我也遇到过, 记录了下:

    http://www.wutianqi.com/?p=3392
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1483 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 18:17 · PVG 02:17 · LAX 10:17 · JFK 13:17
    ♥ Do have faith in what you're doing.