代码拉取完成,页面将自动刷新
# -*- coding: utf-8 -*-
import json
class obj11:
pass
fileName = "state.txt"
fileName1 = "url/pageUrl.txt"
def set_state(count,pagination):
file = open(fileName,"w")
txt = "count=" + str(count) + "," + 'pagination=' + str(pagination)
file.write(txt)
file.close()
def get_state():
file1 = open(fileName,"r")
txt = file1.read()
arr = txt.split(',')
obj = obj11()
for item in arr:
setattr(obj,item.split('=')[0],item.split('=')[1])
file1.close()
return obj
# set_state(12,222)
# aa = get_state()
# print(aa.count)
def set_url_list(txt):
file = open(fileName1,"w")
file.write(json.dumps(txt))
file.close()
def get_url_list():
file1 = open(fileName1,"r")
txt = file1.read()
return json.loads(txt)
li = get_url_list()
print(li)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。