I have a python script which is using htpasswd authentication. I wish to modify the script depending on the user who has logged in currently. This application is web-enabled. eg.
if current_username = 'ABC':
m = 2
elif current_username = 'PQE':
m = 4
else:
m = 6
Any of the user can log in any time / simultaneously. Want the simplest and most efficient solution. Can anybody help? How do I know which of the user has logged in at any point of time? import getpass getpass.getuser() in the script ?