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

请问一下 scrapy 想让框架默认 python3 是这样写吗?

  •  
  •   Ewig · 2018-10-08 12:01:09 +08:00 · 1489 次点击
    这是一个创建于 2020 天前的主题,其中的信息可能已经有所发展或是发生改变。

    就是写一个 main.py 然后 python3 执行,但是这样的问题如果很多爬虫,是不是对应很多 main 呢? from scrapy.cmdline import execute

    if name == 'main':

    execute("scrapy crawl xiaomiquan".split())
    
    2 条回复    2018-10-09 15:02:56 +08:00
    wlsnx
        1
    wlsnx  
       2018-10-08 14:36:33 +08:00
    virtualenv/venv/pyenv 考虑一下?
    Ewig
        2
    Ewig  
    OP
       2018-10-09 15:02:56 +08:00
    @wlsnx 这个我用过的,挺麻烦的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1003 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 19:32 · PVG 03:32 · LAX 12:32 · JFK 15:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.