Mac 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 ユーザー権限が必要だと思います。現在、管理者アカウントにいます。