Made picked lines unique

This commit is contained in:
gpkvt 2023-06-04 09:31:29 +02:00
parent 187dcf81ca
commit 3d032ef2dd
1 changed files with 2 additions and 1 deletions

View File

@ -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