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
print 'Hello World!' |
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 sys | |
from PyQt5 import QtWidgets, QtGui | |
class SystemTrayIcon(QtWidgets.QSystemTrayIcon): | |
def __init__(self, icon, parent=None): | |
QtWidgets.QSystemTrayIcon.__init__(self, icon, parent) | |
menu = QtWidgets.QMenu(parent) | |
exitAction = menu.addAction("Exit") | |
self.setContextMenu(menu) |
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 sys | |
from PyQt5 import QtWidgets, QtGui | |
class SystemTrayIcon(QtWidgets.QSystemTrayIcon): | |
def __init__(self, icon, parent=None): | |
QtWidgets.QSystemTrayIcon.__init__(self, icon, parent) | |
menu = QtWidgets.QMenu(parent) | |
exitAction = menu.addAction("Exit") | |
self.setContextMenu(menu) |
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 PIL import Image, ImageGrab | |
import time | |
import datetime | |
prev = datetime.datetime.now() | |
while True: | |
#im.show() | |
im = ImageGrab.grab() | |
colors = im.getcolors(95570)#16777216) #max number of colors in 24bit color depth |
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 serial | |
import threading | |
port = serial.Serial( | |
port='COM14', | |
baudrate=9600, | |
timeout=10 | |
) | |
def write_power(p): |
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 printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█'): | |
""" | |
Source: https://stackoverflow.com/a/34325723/4017197 | |
Call in a loop to create terminal progress bar | |
@params: | |
iteration - Required : current iteration (Int) | |
total - Required : total iterations (Int) | |
prefix - Optional : prefix string (Str) | |
suffix - Optional : suffix string (Str) | |
decimals - Optional : positive number of decimals in percent complete (Int) |
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 matplotlib import pyplot as plt | |
import numpy as np | |
from scipy.interpolate import interp1d | |
t = np.linspace(0, 10, 5) | |
x = np.array([0, 2, 3, 10, 15]) | |
y = np.array([0, 1, 2, 8, 15]) | |
f = interp1d(x,y, kind='cubic') |
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
Used for gist name. |