【问题标题】:Trying to make a list of paths TypeError: unicode string or integer address expected instead of bytes instance试图列出路径类型错误:unicode string or integer address expected instead of bytes instance
【发布时间】:2020-01-23 06:16:11
【问题描述】:

我对 python 还很陌生,正在尝试编写可以通过计算机上的图像发送图像的代码,但我只能拥有一个,并且无法列出它们。

ExampleList = random.choice(['C:\\Example\\image.jpg', 'C:\\Example\\image.jpg'])

然后我用了autoit

autoit.control_send("Open", "Edit1", examplelist)

然后得到错误:

TypeError: 需要 unicode 字符串或整数地址而不是字节实例

【问题讨论】:

    标签: python autoit


    【解决方案1】:

    我试过你的代码,它对我有用。没有看到您的错误代码。

    但是,python 区分大小写,因此“ExampleList”中的小写和大写应该一致。

    control_send 的第一个元素是“要访问的窗口的标题/hWnd/类”。您将图像位置发送到哪里?

    【讨论】:

    • 我正在使用它来自动化 Instagram,并且我尝试仅使用一条路径并运行良好,但添加多个它会给我错误代码。编辑:你对它现在工作的区分大小写的部分是正确的!谢谢你的信息
    猜你喜欢
    • 1970-01-01
    • 2020-04-14
    • 2022-06-24
    • 2011-11-06
    • 1970-01-01
    • 2019-11-11
    • 2021-11-23
    • 2016-10-27
    相关资源
    最近更新 更多