如何使用 Pyautogui 按 Alt + num x(任何数字键盘键)



我正在尝试使用python打印一些符号。 我可以通过单击 Alt+numx(符号的 x=数字(用键盘打印它。 我正在尝试使用 Pyautogui 执行此操作,但它不起作用。


*import pyautogui*
pyautogui.keyDown('alt')
pyautogui.press('num 1')
pyautogui.keyUp('alt') ```

if there other library to do this help me.
**this following text is not related to the question so do not read it.**
Edit: following is the official solution from Google (link)
Summary
Google Maps SDK thread crashes App (ArrayIndexOutOfBoundsException) - Solution Offered
Description
On April 23 2020 starting at 11:30 PDT, Google served for 4 hours an update to the configuration of a Maps mobile component, triggering crashes in Maps SDKs for Android and iOS. Applications on devices that downloaded this version of the configuration (during the outage period) were vulnerable to the crash. Workaround solutions are offered for Maps SDKs for Android and iOS.
Maps SDK for Android                            

嗨,请参阅它简要提到的文档。

https://pyautogui.readthedocs.io/en/latest/keyboard.html

如果适合您,请尝试以下操作

import pyautogui
pyautogui.hotkey('alt', 'num 1')

另一个想法(如果你只需要一个字符(是复制它并执行以下操作:

with pyautogui.hold('ctrl'):
pyautogui.press(['v'])

最新更新