-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmain.py
37 lines (33 loc) · 796 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
# -*- coding:utf-8 -*-
__Author__ = "HackFun"
from scrapy.cmdline import execute
import sys
import os
# print(os.path.dirname(os.path.abspath(__file__)))
# G:\MyProgramFiles\Py3Code\ArticleSpider
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
execute(["scrapy", "crawl", "jobbole"]) # execute("scrapy crawl jobbole".split())
# execute(["scrapy", "crawl", "zhihu"]) # execute("scrapy crawl jobbole".split())
# # test
# def a(max):
# n, a, b = 0, 0, 1
# while n < max:
# yield b
# # print b
# a, b = b, a + b
# n = n + 1
#
# def b(max):
# while max > 0:
# yield max
# max = max - 1
#
#
# f = a(5)
# f = b(5)
#
# print(f.__next__())
# print(f.__next__())
# print(f.__next__())
# print(f.__next__())