V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
ciba1990
V2EX  ›  Python

python 截取字符串固定长度怎么实现

  •  
  •   ciba1990 · Jul 31, 2015 · 4792 views
    This topic created in 3933 days ago, the information mentioned may be changed or developed.

    例如截取字符串的前20个字节

    2a
        1
    2a  
       Jul 31, 2015   ❤️ 1
    scream7
        2
    scream7  
    PRO
       Jul 31, 2015   ❤️ 1
    s[:20] ???
    xbonline
        3
    xbonline  
       Jul 31, 2015   ❤️ 1
    这类问题为啥不RTFM?
    tinyproxy
        4
    tinyproxy  
       Aug 1, 2015   ❤️ 1
    连教程都不看完我也是醉了。。。
    leavic
        5
    leavic  
       Aug 1, 2015 via iPhone   ❤️ 1
    你真的学过python吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3422 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 12:14 · PVG 20:14 · LAX 05:14 · JFK 08:14
    ♥ Do have faith in what you're doing.