This repository has been archived by the owner on Jun 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add text-to-sound script * fix failed check is about blank * add screenshot script * fix failed issues from screenshot.py * fix again sorry
- Loading branch information
1 parent
d0bf552
commit f1f2179
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Screenshot | ||
|
||
Screenshot is a Python script for taking a screenshot. | ||
|
||
## Library used | ||
- tkinter | ||
- PyAutoGUI | ||
|
||
## Setup | ||
|
||
Install the packages listed in `requirements.txt` using `pip` | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
## Usage | ||
|
||
```bash | ||
cd screenshot | ||
python screenshot.py | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PyAutoGUI==0.9.50 | ||
tk==0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import tkinter as tk | ||
from tkinter import messagebox | ||
import pyautogui | ||
import os | ||
|
||
|
||
root = tk.Tk() | ||
time = tk.IntVar() | ||
time.set(3) | ||
|
||
|
||
def take_shot(): | ||
timeleft = time.get() | ||
if timeleft > 0: | ||
timeleft -= 1 | ||
time.set(timeleft) | ||
root.after(1000, take_shot) | ||
else : | ||
s = pyautogui.screenshot() | ||
# Save a screenshot on current working directory | ||
s.save(os.getcwd() + "shot.png") | ||
messagebox.showinfo("Screenshot", "Screenshot saved!") | ||
time.set(3) | ||
|
||
|
||
L = tk.Label(root, textvariable=time, fg="blue") | ||
L.pack() | ||
|
||
b = tk.Button(root, text="Take Screenshot 3 secs", command=take_shot) | ||
b.pack() | ||
|
||
root.mainloop() |