编程
使用 Python 每 5 分钟自动输入文本
Automated Text Typing Every 5 Minutes with Python
生成一个可持续运行的 Python 脚本,使用可自定义的时间间隔将指定文本自动输入到任何可写界面。还会提供使用 PyInstaller 将脚本转换为 .exe 文件的步骤。
- 测试模型:
- GPT-4o
- 有效性评分:
- 95/100
- 提示词归档
中文版本
Act as a Python Automation Engineer. You are skilled in creating scripts that automate repetitive tasks. Your task is to develop a Python script that types a specified text automatically every ${interval:5} minutes on any writable interface. The timer should be customizable.
You will:
- Use the `pyautogui` library to simulate keyboard input
- Implement a customizable timer using the `time` library
- Ensure the script runs continuously and types the text on any writable interface
Example Script:
```python
import pyautogui
import time
def auto_typing(text, interval):
while True:
pyautogui.typewrite(text)
time.sleep(interval)
if __name__ == "__main__":
# Customize your text and interval here
text_to_type = "Your text here"
time_interval = 300 # every 5 minutes
auto_typing(text_to_type, time_interval)
```
To convert the Python script to an executable (.exe) file, follow these steps:
1. **Install PyInstaller**: Open your terminal or command prompt and run:
```
pip install pyinstaller
```
2. **Create Executable**: Navigate to the directory containing your Python script and execute:
```
pyinstaller --onefile your_script_name.py
```
3. **Find the .exe File**: After running PyInstaller, the executable will be located in the `dist` folder.
Rules:
- The script must run without manual keyboard interaction
- Ensure the interval and text are easy to update
- The script should be efficient and lightweight填入内容并运行
这条提示词有 1 处待填。填好后我们会为你拼出完整提示词。
还有 1 处未填
完整提示词
Act as a Python Automation Engineer. You are skilled in creating scripts that automate repetitive tasks. Your task is to develop a Python script that types a specified text automatically every ${interval:5} minutes on any writable interface. The timer should be customizable.
You will:
- Use the `pyautogui` library to simulate keyboard input
- Implement a customizable timer using the `time` library
- Ensure the script runs continuously and types the text on any writable interface
Example Script:
```python
import pyautogui
import time
def auto_typing(text, interval):
while True:
pyautogui.typewrite(text)
time.sleep(interval)
if __name__ == "__main__":
# Customize your text and interval here
text_to_type = "Your text here"
time_interval = 300 # every 5 minutes
auto_typing(text_to_type, time_interval)
```
To convert the Python script to an executable (.exe) file, follow these steps:
1. **Install PyInstaller**: Open your terminal or command prompt and run:
```
pip install pyinstaller
```
2. **Create Executable**: Navigate to the directory containing your Python script and execute:
```
pyinstaller --onefile your_script_name.py
```
3. **Find the .exe File**: After running PyInstaller, the executable will be located in the `dist` folder.
Rules:
- The script must run without manual keyboard interaction
- Ensure the interval and text are easy to update
- The script should be efficient and lightweight- 在 ChatGPT 中打开 (在新标签页中打开)
- 在 Claude 中打开 (在新标签页中打开)
- 在 Gemini 中打开 (在新标签页中打开)
Gemini 无法通过链接接收提示词,请先复制。
- 在 Perplexity 中打开 (在新标签页中打开)
将在新标签页打开并已填入提示词。可能需要先登录该服务。
如何使用此提示词
- 发送前,请将方括号中的内容替换为你自己的信息。
- 不同模型的结果会有差异。若输出不理想,可换一个模型或补充一个具体示例。
- 请将提示词放在一条消息中发送。分多次发送会削弱指令效果。