这篇文章将指导您利用 Python 的 pyautogui
库创建一个自动化的脚本,帮助您使用 ChatGPT 生成公司智能管理平台的 PPT 大纲。该脚本将打开 Chrome 浏览器,访问 ChatGPT 并输入相应的提示词,让 ChatGPT 为您创建 PPT 大纲。
C:\pythoncode\new\pyautoguiChatgpt.py
全部代码:
import pyautogui
import time
# Open Chrome
pyautogui.hotkey('win', 'r')
pyautogui.write('chrome')
pyautogui.press('enter')
# Go to ChatGPT
time.sleep(5)
pyautogui.hotkey('ctrl', 'l')
pyautogui.write('https://chat.openai.com/')
pyautogui.press('enter')
pyautogui.press('enter')
# Switch to English input mode (adjust shortcuts as needed)
# pyautogui.hotkey('ctrl', 'shift') # Common shortcut for language switching
# pyautogui.hotkey('alt', 'e') # Specific shortcut for English (may vary)
# Focus on the chat input area
time.sleep(10)
pyautogui.click(x=500, y=600) # Adjust coordinates if needed
# Enter prompt and press Enter
pyautogui.hotkey('ctrl','v')
pyautogui.press('enter')
导入必要的库:
代码首先