V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
flyingkid
V2EX  ›  Python

python学习 遇到一个问题

  •  
  •   flyingkid ·
    kennx · 2011-10-21 18:37:13 +08:00 · 4790 次点击
    这是一个创建于 4564 天前的主题,其中的信息可能已经有所发展或是发生改变。



    在win下用IDLE python GUI,不能运行。老是缩进错误,不知道怎么缩进= =

    然后我用aptana把缩进格式改了能运行,但是一直输出loop #0 不停的循环。
    5 条回复    1970-01-01 08:00:00 +08:00
    lanisle
        1
    lanisle  
       2011-10-21 18:42:12 +08:00
    我在win下用IDLE运行表示正常。
    关于你的死循环问题,可能是counter += 1前的缩进格式有问题。以至于不在while循环体内。
    flyingkid
        2
    flyingkid  
    OP
       2011-10-21 18:45:27 +08:00
    @lanisle 3Q。我知道了。我真是粗心。v2ex真好。
    lyydev
        3
    lyydev  
       2011-10-21 23:44:42 +08:00
    开发Python程序要注意缩进,很多问题都是出现在代码的缩进上,特别是经常使用不同的编辑器
    renyuan1985
        4
    renyuan1985  
       2011-10-22 01:26:31 +08:00
    Python确实需要注意缩进,我一般的做法就是用VIM,家里Mac和公司win基本一样!
    alsotang
        5
    alsotang  
       2011-10-25 08:24:36 +08:00
    @renyuan1985 我觉得编码没有vim给我用的话,我还不如干点别的,等回到有vim的环境再编...
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1462 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 17:18 · PVG 01:18 · LAX 10:18 · JFK 13:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.