Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import threading
- import time
- from random import choice
- from string import ascii_letters
- def Sort():
- while True:
- time.sleep(5)
- file = open('Laba7.txt','w')
- list.sort(key=str.upper)
- file.write(str(list))
- file.close()
- def Print():
- while True:
- print(list)
- time.sleep(1)
- list = []
- T1 = threading.Thread(target=Sort)
- T2 = threading.Thread(target=Print)
- T1.start()
- T2.start()
- while True:
- list.append(''.join(choice(ascii_letters) for i in range(6)))
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement