Skip to content

Instantly share code, notes, and snippets.

View Andygmb's full-sized avatar

Andy Andygmb

  • Amsterdam, Netherlands
View GitHub Profile
import pygame
import cStringIO
from PIL import Image, ImageGrab
w = 345
h = 170
x, x1 = 1575, 1920
y, y1 = 910, 1080
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.
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
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)
#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__)
from flask import Flask
import RPi.GPIO as GPIO
import Queue
import threading
import time
app = Flask(__name__)
@app.route("/")
<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>
<script>
$(button).on("click", function(e){
e.preventDefault()
})
</script>
<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>
<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>