python_bot/dicktxt/ForReadDict.py

13 lines
238 B
Python
Raw Normal View History

import random
def RandomDick():
with open('tests\diction.txt', 'r', encoding='utf-8') as file:
words = file.readlines()
random_line = random.choice(words).strip()
return random_line
random_line = RandomDick()