Commit 7f65fceb authored by lixiaofang's avatar lixiaofang

add

parent c46254ac
...@@ -41,7 +41,7 @@ def get_data(numtime): ...@@ -41,7 +41,7 @@ def get_data(numtime):
def write_id_file(id): def write_id_file(id):
try: try:
data = open("save_topic_id.txt", "w") data = open("save_topic_id.txt", "a")
data.write(str(id)) data.write(str(id))
data.write("/n") data.write("/n")
......
...@@ -14,7 +14,7 @@ def write_id_file(): ...@@ -14,7 +14,7 @@ def write_id_file():
data = open("save_topic_id.txt", "r") data = open("save_topic_id.txt", "r")
data2 = open("save_topic_id_three.txt", "w") data2 = open("save_topic_id_three.txt", "w")
for i in data.readlines(): for i in data.readlines():
data2.write(str(i)) data2.write(str(i.strip()))
data2.write("\n") data2.write("\n")
user_ids.append(int(i)) user_ids.append(int(i))
data.truncate() data.truncate()
......
...@@ -13,7 +13,7 @@ def write_id_file(): ...@@ -13,7 +13,7 @@ def write_id_file():
user_ids = [] user_ids = []
data = open("save_topic_id_three.txt", "r") data = open("save_topic_id_three.txt", "r")
for i in data.readlines(): for i in data.readlines():
user_ids.append(int(i)) user_ids.append(int(i.strip()))
data.truncate() data.truncate()
return user_ids return user_ids
except: except:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment