chunjie
2018-08-05 08:46:56 +08:00
我改成以下后可以了:
# -*- coding: utf-8 -*-
import os
import multiprocessing
import time
import sys
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach())
print('中文')
def start_spider_collect():
while True:
print('sleep 10s')
time.sleep(10)
os.system('scrapy crawl spider_collect_fengsheji')
if __name__ == '__main__':
multiprocessing.Process(target=start_spider_collect, name='process: start_spider_collect').start()
但是妈呀,我发现执行这个文件 scrapy 启动后,好像杀掉进程也无法停下了。。。杀掉后过一阵子又会自动重启。。怎么回事?