Update app.py
Browse files
app.py
CHANGED
@@ -200,7 +200,8 @@ async def load_votes(file):
|
|
200 |
if not os.path.exists(file):
|
201 |
await asyncio.to_thread(lambda: open(file, 'w').write("# Vote Tally\n\nNo votes yet - get clicking! 🖱️\n"))
|
202 |
with open(file, 'r') as f:
|
203 |
-
|
|
|
204 |
votes = {}
|
205 |
user_votes = set()
|
206 |
for line in lines:
|
|
|
200 |
if not os.path.exists(file):
|
201 |
await asyncio.to_thread(lambda: open(file, 'w').write("# Vote Tally\n\nNo votes yet - get clicking! 🖱️\n"))
|
202 |
with open(file, 'r') as f:
|
203 |
+
content = await asyncio.to_thread(f.read)
|
204 |
+
lines = content.strip().split('\n')[2:] # Process content after reading
|
205 |
votes = {}
|
206 |
user_votes = set()
|
207 |
for line in lines:
|