-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
53 lines (42 loc) · 1.34 KB
/
Copy pathapp.py
File metadata and controls
53 lines (42 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Hello world Programmer
# Harsh Kale!
from flask import Flask, render_template
from pyvirtualdisplay import Display
import pyautogui
app = Flask(__name__, template_folder='templates', static_folder='static')
# Create a virtual display
display = Display(visible=0, size=(800, 600))
display.start()
@app.route('/')
def index():
return render_template('index.html')
@app.route('/change_slide_next', methods=['POST'])
def change_slide_next():
try:
pyautogui.press('right')
# pyautogui.press('left')
# pyautogui.hotkey('winleft', 'r')
return 'Slide changed successfully!'
except Exception as e:
return f'Error changing slide: {str(e)}'
@app.route('/change_slide_previous', methods=['POST'])
def change_slide_previous():
try:
pyautogui.press('left')
# pyautogui.press('left')
# pyautogui.hotkey('winleft', 'r')
return 'Slide changed successfully!'
except Exception as e:
return f'Error changing slide: {str(e)}'
@app.route('/start', methods=['POST'])
def start():
try:
pyautogui.press('f5')
# Simulate Alt + V
# pyautogui.press('left')
# pyautogui.hotkey('winleft', 'r')
return 'Slide changed successfully!'
except Exception as e:
return f'Error changing slide: {str(e)}'
if __name__ == '__main__':
app.run()