在特定路径下更改文件的“用户”

时间:2019-06-26 14:14:44

标签: python shutil

import shutil

path = input("Absolute path of the file and folder  ")


shutil.chown(path, user="Dude")

上面的程序应该已经成功执行,而不是这个,它向我显示了此错误:

Absolute path of the file and folder  E:\SQL\Sqlemployee.py
Traceback (most recent call last):

  File "<ipython-input-2-b801c061f956>", line 4, in <module>
    shutil.chown(path, user="Dude")

  File "C:\Users\HP\Anaconda3\lib\shutil.py", line 1053, in chown
    raise LookupError("no such user: {!r}".format(user))

LookupError: no such user: 'Dude' 

已经有四个用户: 管理员,HP,访客,Dude

0 个答案:

没有答案