Answer the question
In order to leave comments, you need to log in
How to hide a folder using Python in Windows family OS?
How to hide a folder using Python in Windows family OS?
Answer the question
In order to leave comments, you need to log in
import win32con, win32api,os
file='test'
f=open('test','w')
f.close()
#make the file hidden
win32api.SetFileAttributes(file,win32con.FILE_ATTRIBUTE_HIDDEN)
#make the file read only
win32api.SetFileAttributes(file,win32con.FILE_ATTRIBUTE_READONLY)
#to force deletion of a file set it to normal
win32api.SetFileAttributes(file, win32con.FILE_ATTRIBUTE_NORMAL)
os.remove(file)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question