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

如何过滤特殊文件名

  •  
  •   domino · Jul 29, 2017 · 3162 views
    This topic created in 3238 days ago, the information mentioned may be changed or developed.
    请问如何过滤爬虫爬回来,有特殊符号的标题的数据呢,
    想用标题建立文件夹,
    但有时候会遇特特殊字元无法建立.
    除了用 replace , 还有什么方法呢?
    7 replies    2017-07-31 00:30:38 +08:00
    ysc3839
        1
    ysc3839  
       Jul 29, 2017
    CRC32 Hash 后作为文件夹名
    yangff
        2
    yangff  
       Jul 29, 2017
    base64 一下非扩展名部分?
    j137tt736CExzlfM
        3
    j137tt736CExzlfM  
       Jul 29, 2017
    额,没有`fnameescape() ` 么?
    techmoe
        4
    techmoe  
       Jul 30, 2017 via Android
    特殊符号转译呗。。还能有啥办法
    domino
        5
    domino  
    OP
       Jul 30, 2017
    如果用 md5 还是 crc 当为文件夹名,这样资料多很难识别.
    不知是否可以用排除特殊服号的方式来做?
    刚学 python,不是很熟.
    AnyOfYou
        6
    AnyOfYou  
       Jul 31, 2017
    domino
        7
    domino  
    OP
       Jul 31, 2017
    @AnyOfYou
    这篇文章我看过,
    不过这样的做法似乎无法保存中文,日文等文件名
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5448 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 08:37 · PVG 16:37 · LAX 01:37 · JFK 04:37
    ♥ Do have faith in what you're doing.