프롬프트 도감 › No.2414
5분마다 자동 입력 코드
Python Auto Typer
정해 둔 글을 몇 분마다 자동으로 입력해 주는 파이썬 프로그램을 만들어 줘요. 시간 간격을 바꿀 수 있고 exe 파일로 만드는 방법도 알려 줘요.
이럴 때 반복 입력 자동화 공부, 간단한 파이썬 연습, 업무 자동화 실험
도구 ChatGPT · Claude · Gemini
프롬프트
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팁
- 입력할 글과 간격(분)을 먼저 정해요
- 다른 사람에게 보내는 용도로는 쓰지 마세요
출처
권리: CC0 (f/prompts.chat). 자유 사용. 기여자: IcyMost.