Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Author: outer_spec
- # Creation Date: March 18, 2023
- # Filename: drilrandom.py
- # Purpose: This program reads a file containing every dril tweet and outputs a random tweet from the file.
- import random
- f = open("dril10000random.txt") #open the file
- lines = f.readlines() #read the file into a list
- a = random.randint(1,len(lines))
- randline = a-1 #create a random number
- print(lines[randline])
- # https://dril.gumroad.com/l/dril10000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement