I am trying to create a script that installs and configures multiple programs such as phpmyadmin using a password determined by the user. To ensure the password of the user is safe, I intend to generate the shell script below using a password entered by the user, pass it to the script for output, and destroy the script once it is done running to ensure the integrity of the password. The problem is, I'm not sure how to create shell scripts within a python code.
Script:
echo phpmyadmin phpmyadmin/dbconfig-install boolean true | debconf-set-selections
echo phpmyadmin phpmyadmin/app-password-confirm password pwd | debconf-set-selections
echo phpmyadmin phpmyadmin/mysql/admin-pass password pwd| debconf-set-selections
echo phpmyadmin phpmyadmin/mysql/app-pass password pwd| debconf-set-selections
echo phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2 | debconf-set-selections
echo phpmyadmin phpmyadmin/upgrade-backup boolean true | debconf-set-selections