From 3d032ef2ddbe31f1e43a4d3cc4b7bfd1e1f29df8 Mon Sep 17 00:00:00 2001 From: gpkvt Date: Sun, 4 Jun 2023 09:31:29 +0200 Subject: [PATCH] Made picked lines unique --- game.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/game.py b/game.py index ed62bf3..85a757e 100755 --- a/game.py +++ b/game.py @@ -4,6 +4,7 @@ from random import choice from flask import Flask, render_template, request from configparser import ConfigParser from datetime import datetime +import random import logging import pytz @@ -98,7 +99,7 @@ def hello(): def getContent(): lines = [a.strip() for a in open("ab.txt", "r").readlines()] - result = [choice(lines) for a in range(5)] + result = random.sample(lines, 5) return result