Thank you. That worked perfectly, I understand why it was not working before because the variables were assigned within the function definition only. And replying to John Machin, admin is the name of the account I created on windows. The default administrator account in XP is called simply 'administrator' which is the account one would use in safe mode.
-- http://mail.python.org/mailman/listinfo/python-list