Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python remove read only file


    import os
    import stat
    def rmv_rof(file_name):
        '''Remov Read Only Files'''
        if os.path.exists(file_name):
            os.chmod(file_name, stat.S_IWRITE)
            os.remove(file_name)
        else:
            print('The file does not exist.')
    rmv_rof('file_name_here')
Comment

PREVIOUS NEXT
Code Example
Python :: print specific part in bold or colours and end. 
Python :: pandas to_csv append 
Python :: how to make a discord bot dm someone python 
Python :: nltk stop words 
Python :: install python 3.6 mac brew 
Python :: datetime 30 days ago python 
Python :: python r squared 
Python :: django import model from another app 
Python :: install gtts 
Python :: import excel file to python 
Python :: size table python 
Python :: decode url python 
Python :: text adventure in python 
Python :: trigonometry in python 
Python :: save image python 
Python :: how to get all the files in a directory in python 
Python :: remove rows if not matching with value in df 
Python :: how to unzip files using zipfile module python 
Python :: python generate rsa key pair 
Python :: zeller year 
Python :: get all classes from css file using python 
Python :: img read 
Python :: remove grid in plt 
Python :: pandas read csv parse_dates 
Python :: how to change opencv capture resolution 
Python :: add rows to dataframe pandas 
Python :: the day before today python datetime 
Python :: matplotlib set size 
Python :: pandas split column into multiple columns by delimiter 
Python :: change column name df 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =