Made picked lines unique
This commit is contained in:
parent
187dcf81ca
commit
3d032ef2dd
3
game.py
3
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue