Answers for "python give permission to file"

0

python3 change file permissions

#import os
os.chmod('yourfiletochange.csv', 0o777)
Posted by: Guest on February-17-2021
0

python write data to file with permissions

#!/usr/bin/env python3
import stat
import os
path = 'outfile.txt'
with open(path, 'w') as fh:
    fh.write('blablan')
st = os.stat(path)
os.chmod(path, st.st_mode | stat.S_IWOTH)
Posted by: Guest on August-11-2020

Code answers related to "python give permission to file"

Python Answers by Framework

Browse Popular Code Answers by Language