I'm trying to leave a hidden .txt file. How can I do this using python command line?
I'm trying to leave a hidden .txt file. How can I do this using python command line?
In windows you can do this:
import ctypes
FILE_ATTRIBUTE_HIDDEN = 0x02
ret = ctypes.windll.kernel32.SetFileAttributesW('CAMINHO/PARA/FICHEIRO.txt',
FILE_ATTRIBUTE_HIDDEN)
if ret:
print 'Ficheiro definido para oculto'
else: # se retornar algum erro
raise ctypes.WinError()
Response removed from here .
I did not test because I do not have windows, so I'm not sure if it will work, if it does not work, it says I'll take the answer from here