LoginSignup
1
0

More than 1 year has passed since last update.

pyautoguiで全角入力されて困った経験

Posted at

概要

pyautoguiで入力自動化をしようとしていたところ、半角情報が全角入力されて困った

import pyautogui
import time

pyautogui.click(228, 50)
pyautogui.write('https:/')  #URL指定  全角入力になる

に解決方法があった。

  1. 無変換キーにIMEオフの設定をつける

2.

pg.press("nonconvert")

を実行し、プログラム動作時はIMEオフにする

無変換キーにIMEオフの設定をつける方法

  1. キーボード入力の"A"または"あ"に右クリック
    1.png

  2. ”プロパティ"を選択
    2.png

  3. 詳細設定を選択
    3.png

  4. 変更を選択
    4.png

5. 無変換をIME-オフ に変更
5.png

"OK"で完了です

実際に、日本語入力後、無変換を押して半角になったら成功です!

テストプログラム

Chromeのweb検索を自動入力するものです

import pyautogui
import time

pyautogui.click(228, 50)
print(pyautogui.position())
pyautogui.press("nonconvert")
pyautogui.write('https://')  #URL指定
pyautogui.press('enter')
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0