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
import pygame | |
import cStringIO | |
from PIL import Image, ImageGrab | |
w = 345 | |
h = 170 | |
x, x1 = 1575, 1920 | |
y, y1 = 910, 1080 |
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
import win32api | |
Traceback (most recent call last): | |
File "C:\Users\Andrew\Desktop\win32api-testing.py", line 2, in <module> | |
import win32api | |
ImportError: DLL load failed: %1 is not a valid Win32 application. |
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
def __init__(self, pygame): | |
self.pygame = pygame | |
self.border_width = win32api.GetSystemMetrics(32) | |
self.screen = None | |
self.aoe_window = None | |
self.map_bbox = None | |
self.map_w, self.map_h = 350, 175 | |
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
def screengrab(self): | |
# Change the line below depending on whether you want the whole window | |
# or just the client area. | |
#left, top, right, bot = win32gui.GetClientRect(hwnd) | |
hwnd = self.aoe_window | |
left, top, right, bot = win32gui.GetClientRect(hwnd) | |
w = right - left | |
h = bot - top | |
#returns the device context (DC) for the entire window, including title bar, menus, and scroll bars. | |
hwndDC = win32gui.GetWindowDC(hwnd) |
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
#Importing all the necessary modules so we can use them in this script. | |
from flask import Flask | |
import RPi.GPIO as GPIO | |
import Queue | |
import threading | |
import time | |
# Create the Flask object and assign it to the app variable. | |
app = Flask(__name__) |
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
from flask import Flask | |
import RPi.GPIO as GPIO | |
import Queue | |
import threading | |
import time | |
app = Flask(__name__) | |
@app.route("/") |
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
<html> | |
<head> | |
<body> | |
<a href="/red/1">Click me to turn red on</a> | |
<a href="/red/0">Click me to turn red off</a> | |
</body> | |
</head> | |
</html> |
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
<script> | |
$(button).on("click", function(e){ | |
e.preventDefault() | |
}) | |
</script> |
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
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.11.2.js"></script> | |
<script> | |
$("button").on("click", function(e){ | |
e.preventDefault() | |
}) | |
</script> | |
</head> | |
<body> |
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
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.11.2.js"></script> | |
<script> | |
$("button").on("click", function(e){ | |
e.preventDefault() | |
}) | |
</script> | |
</head> | |
<body> |