Ctype在代码中没有发现属性错误。

问题描述 投票:0回答:1

在下面这段代码中

ctypes.windll.kernel32.SetConsoleTitleW(f"Void - Session: {username})"

我得到的是ctype has no attribute错误,在下面这段代码中,ctypes.windll.kernel32.SetConsoleTitleW(f "Void - Session: {username}" 我得到的是ctype has no attribute错误。

python compiler-errors ctypes
1个回答
0
投票

这意味着该模块 ctypes 的变量、方法或对象。windll. 从变量的名称来看,我假设这段代码是为Windows设计的。检查一下你是否在运行Windows或MacOS。同样,这也可能是一个简单的拼写错误或印刷错误。试试运行 dir(ctypes) 查看Python控制台中的 windll 是真的在那里。

© www.soinside.com 2019 - 2024. All rights reserved.