Skip to content

Commit c91f57f

Browse files
committed
Fix built-in list class issues
1 parent 8bd73d6 commit c91f57f

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
## 使用方法
1616

17+
### <请先确保python版本为最新版>
18+
1719
在终端中执行:
1820

1921
```bash

auto_comment_plus.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232
}
3333
# 评价生成
3434
def generation(pname, _class=0, _type=1):
35-
list = ['商品名']
36-
list.clear()
37-
list.append(pname)
38-
for item in list:
35+
items = ['商品名']
36+
items.clear()
37+
items.append(pname)
38+
for item in items:
3939
spider = jdspider.JDSpider(item)
4040
#增加对增值服务的评价鉴别
4141
if "赠品" in pname or "非实物" in pname or "增值服务" in pname :
4242
result = ["赠品挺好的。",
43-
"很贴心,能有这样免费赠送的赠品",
43+
"很贴心,能有这样免费赠送的赠品!",
4444
"正好想着要不要多买一份增值服务,没想到还有这样的赠品。",
4545
"赠品正合我意。",
4646
"赠品很好,挺不错的。"

jdspider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def solvedata(self, remarks):
178178

179179
# 测试用例
180180
if __name__ == "__main__":
181-
list = ['商品名']
182-
for item in list:
181+
jdlist = ['商品名']
182+
for item in jdlist:
183183
spider = JDSpider(item)
184184
spider.getData(2, 3)

0 commit comments

Comments
 (0)