If you have verified your credentials work by logging into ePO through the console that will indicate you have correct credentials to log into the UI. The remote client, however, uses BASIC auth, so to verfiy you can login using basic auth try the following:
Try hitting this url (where myeposerver is your server and 8443 is the port)
Enter your credentials when prompted.
If it takes your credentials and shows you command names and help for each then you know your credentials are valid. And there must be a problem with the values you provided when you created a connection/client to the epo server in your script:
client = mcafee.client(server, port, user, pwd)
Verify that the server, port, user and pwd match the ones you tried when hitting the epo URL directly.
If it doesn't take your credentials, I believe you'll continually be asked for your credentials repeatedly by the same dialog.
I would verify you can successful authenticate this way. Let me know what you find.