简体   繁体   中英

Change the Windows folder permissions to Read only from Python

I have a test case to automate, where in I need to change the folder's permission to read only from Python script. I am using Test Complete tool with python scripting for automating the manual tests.

I am not able to accomplish the tasks, I tried Googling but no luck.

you can try this line of code.

import os, stat

os.chmod(ur"file_path_name", stat.S_IREAD)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM