I have a python script that does a zipping of a few files. For zipping the files with a password I use os.system() function and pass my zipping command ie. zip -j -re <file_path> <to_path>. This command asks for a password on the terminal which I have to put manually on the terminal like this.
Enter password:
Verify password:
I want to hardcode my password and pass it when the terminal asks for a password.
I tried to send the passwords using os.system(password) twice thinking that it will take it but it did not work.
cmd = "zip -j -re {} {}".format(DUMPSPATH,TEMPPATH)
passwrd = 'hello123'
os.system(cmd)
os.system(passwrd)
os.system(passwrd)
How do I send arguments using python to fill passwords automatically?