【问题标题】:python pyautogui module are not support bangla textpython pyautogui 模块不支持孟加拉语文本
【发布时间】:2021-03-21 18:20:59
【问题描述】:

这是我的 Python 代码。我正在尝试使用 pyautoGUI 在孟加拉语文本中写一些东西,但不幸的是,它不起作用。


    import time
    import pyautogui
    
    time.sleep(2)
    text = "হ্যালো,"
    
    pyautogui.typewrite(text)

【问题讨论】:

  • 能否提供错误信息?

标签: python-3.x pyautogui


【解决方案1】:

Pyautogui 似乎不允许在不提供 Unicode 十六进制字符串的情况下使用某些字符,但我找到了一种更简单的方法,将其放入剪贴板。

import pyautogui
import pyperclip
import time

time.sleep(5)

# Store our string to the clipboard
pyperclip.copy("হ্যালো")
# Hotkey the paste command
pyautogui.hotkey("ctrl", "v")

这与打字几乎相同,只是使用粘贴命令而不是像键盘一样发送它(一次一个字符)

# Output to typed
হ্যালো

【讨论】:

    猜你喜欢
    • 2021-11-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-14
    • 1970-01-01
    • 2019-02-27
    • 1970-01-01
    相关资源
    最近更新 更多