from random import shuffle 
print('give me your password') 
password = input()
def generator():
    g = open('Desktop/COWRIE/passwords.txt', "r")
    passwords = g.read().split("\n")
    shuffle(passwords)
    g.close()
    txt = print ('YOUR HONEYPOT IS :','\n')
    for i in range(1,20):
        passwords[i]
        print(passwords[i])
        
        
if __name__ == "__main__":
    generator()
2

There are 2 best solutions below

1
On BEST ANSWER

Did you mean that you wanted to mix the user entered password with another 19 from a file?

from random import shuffle 

def generator():
    password = input('give me your password: ')
    with open('Desktop/COWRIE/passwords.txt', "r") as g:
        passwords = g.read().split("\n")

    shuffle(passwords)
    passwords = passwords[:19]
    passwords.append(password)
    shuffle(passwords)

    print ('YOUR HONEYPOT IS :\n')
    for pw in passwords:
        print(pw)
        
if __name__ == "__main__":
    generator()
1
On

you can have a set and random index between 0 to len-1 then you can add to set random password until length of the set is 19

from random import shuffle, randrange

def generator():
    g = open('passwords.txt', "r")
    passwords = g.read().split("\n")
    shuffle(passwords)
    g.close()
    l =len(passwords)-1
    txt = print('YOUR HONEYPOT IS :', '\n')
    s =set()
    while len(s)<19:
        i = randrange(l)
        s.add(passwords[i])

    for p in passwords:
        print(p)


if __name__ == "__main__":
    generator()