首页
注册
登录
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
V2EX
›
Python
Python如何实现控制台样式的原地输出
caizixian
·
caizixian
·
2013 年 12 月 8 日
via Android · 9852 次点击
这是一个创建于 4433 天前的主题,其中的信息可能已经有所发展或是发生改变。
就是清除当前行 在当前行上继续输出而不是清屏
输出
行上
Python
6 条回复
•
1970-01-01 08:00:00 +08:00
1
dndx
2013 年 12 月 8 日
http://docs.python.org/2/howto/curses.html
2
TankyWoo
2013 年 12 月 8 日
http://www.zhihu.com/question/21100416
3
VYSE
2013 年 12 月 8 日
sys.stdout.write不回车就是刷新当前行
4
caizixian
OP
2013 年 12 月 10 日 via Android
@
VYSE
不是太懂 能不能说详细些
5
VYSE
2013 年 12 月 11 日
@
caizixian
from time import sleep
import sys
for i in range(1000):
sys.stdout.write(str(i)+'\r')
sleep(0.1)
6
VYSE
2013 年 12 月 11 日
@
caizixian
好吧说错了,\r是回车,只要别\n就不会到新一行了,\r回车就是回到行首的意思
关于
·
帮助文档
·
自助推广系统
·
博客
·
API
·
FAQ
·
Solana
·
3773 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 25ms ·
UTC 10:21
·
PVG 18:21
·
LAX 02:21
·
JFK 05:21
♥ Do have faith in what you're doing.
❯