python - 更改特定路径中文件的“用户”
问题描述
import shutil
path = input("Absolute path of the file and folder ")
shutil.chown(path, user="Dude")
上面的程序应该已经成功执行而不是 this ,它向我显示了这个错误:
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'
已经有四个用户:Administrator、HP、Guest、Dude
解决方案
推荐阅读
- lambda - 如何从 Kotlin 中的函数外部获取 lambda 表达式中的变量值
- symfony - 树枝自定义错误消息中的 app.user 变量为空(或不可用?)
- scala - 如何使辅助类型编译?
- python - 如何通过鼠标单击更改 tkinter 中的图像?
- postgresql-9.3 - 关于错误信息PostgreSQL 9.3的问题
- primes - 在 Coq 中证明素数
- flutter - 无法显示 SnackBar
- javascript - Typescript 3 Angular 7 StopPropagation 和 PreventDefault 不起作用
- node.js - 我如何解析我在 nodejs 应用程序中收到的错误消息
- reactjs - 如何通过graphql查询访问获取的数据?