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
superbai
V2EX  ›  Python

请教下, Python2.7 如何去除特殊的空白字符?例如<0x05>、<0x10>、<0x03>、<0x02>

  •  
  •   superbai · 2018-09-02 18:33:55 +08:00 · 1509 次点击
    这是一个创建于 2073 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Python2.7,AES 解密,解密出来的值后面总是有空白字符,使用 strip 的话,不加参数没有用,如果加参数的话,上网搜索了下,这种特殊的空白字符有几十种,一个一个过滤也不太现实,大家有遇到类似的问题么,求教如何解决
    2 条回复    2018-09-02 18:46:30 +08:00
    skinny
        1
    skinny  
       2018-09-02 18:42:20 +08:00   ❤️ 1
    CBC ?你没去除 Padding 吧?
    superbai
        2
    superbai  
    OP
       2018-09-02 18:46:30 +08:00
    @skinny 看了下,果然是的...加上之后就一切正常了~非常感谢!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3262 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 12:14 · PVG 20:14 · LAX 05:14 · JFK 08:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.