Ask for admin access for a Python function in Windows
问题 I want to copy a list of files to the Windows system directory (C:\Windows) using a Python function. I have a function: import shutil def copy_list(src_list, dst): for file in src_list: shutil.copy(file, dst) And I want to call it like this: def copy_as_admin(): #... some code to obtain user elevation ... copy_list(files_list, "C:\\Windows\") How can I achieve this? PS: I'm using Python3, I tried solutions in this thread, How to run python script with elevated privilege on windows but those