는 여기에 내가 맥 OS X에서 실행하기 위해 노력하고있어 내 코드입니다 :'IO 오류 : 13'권한이 맥 OS X에 '거부
import getpass #Needed for fetching username
import shutil #Needed for moving Files
import os
var_username = getpass.getuser() #gets username and returns as variable
source_file = r"/Users/%s//Downloads/LogNLock/com.lognlock.loginhook.plist" %(var_username) #the destination of the source file
destination = r"/Library/LaunchAgents" #the target destination for the file to go
shutil.copy(source_file, destination) #moves the source file to the destination folder
와 나는했습니다 주위에 인터넷 검색 및 작동하지 않을 이유를 알아낼 수 없습니다. 배경 정보 : 데스크탑에서 문서로 파일을 옮길 때 작동하지만, 어떻게해야 root 사용자 권한이 필요한지 생각합니다. 메신저 지금 관리자 계정에.
source_file = R "/ 사용자/%의 // ..."<-이 //의 또한 문자열 보간 그냥 %의 var_username 또는 % (var_username) –