This file contains hidden or 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 sense_hat import SenseHat | |
import time | |
sense = SenseHat() | |
sense.rotation = 90 | |
L = [0,0,200] #Blue | |
D = [0,0,100] #Dark Blue | |
W = [100, 100, 100] # White | |
B = [0,0,0] #Black |
This file contains hidden or 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 selenium import webdriver | |
from selenium.common.exceptions import TimeoutException | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.chrome.options import Options | |
def translate(word, codes): | |
#Choose phrase to translate and enter the array of language codes you would like the phrase to be translated to | |
text= word |
This file contains hidden or 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
#Open string resource file, remove last line, add new translated line, for all language codes provided | |
from TranslationsFunctionReturnDictionary import translate | |
print ("starting!") | |
###UPDATE words_to_translate, codes, and myBasePath if necessary### | |
#word : resource name | |
words_to_translate = { | |
"Change Calculator":"app_name" | |
} |
This file contains hidden or 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
#n is generations, m is pairs of rabbits born per litter | |
#b is pairs of baby bunnies, B is pairs of adult bunnies | |
def get_rabbits(n, m): | |
b, B = 1, 0 | |
for i in range(1, n): | |
b, B = B * m, B + b | |
return B + b |
This file contains hidden or 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
#n is generations, m is pairs of rabbits born per litter | |
#b is pairs of baby bunnies, B is pairs of adult bunnies | |
def get_rabbits(n,m): | |
if n == 1: | |
return 1, 0 | |
else: | |
b, B = get_rabbits(n-1, m) | |
return(B*m, B + b) |
This file contains hidden or 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
"""Implement quick sort in Python. | |
Input a list. | |
Output a sorted list.""" | |
def quicksort(array): | |
low = 0 | |
high = len(array)-1 | |
partition(array, low, high) | |
return array | |
def partition(array, low, high): |
This file contains hidden or 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
"""Implement quick sort in Python. | |
Input a list. | |
Output a sorted list.""" | |
def quicksort(array): | |
low = 0 | |
high = len(array)-1 | |
partition(array, low, high) | |
return array | |
def partition(array, testIndex, pivotIndex): |
This file contains hidden or 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 turtle | |
import tkinter as tk | |
from tkinter import ttk | |
window = turtle.Screen() | |
def runTurtles(): | |
window = turtle.Screen() | |
t1 = turtle.Turtle() | |
t2 = turtle.Turtle() |
This file contains hidden or 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 turtle | |
import time | |
speed = 20 | |
width = 5 | |
t1 = turtle.Turtle() | |
t1.shape("turtle") | |
t1.color("#63A618") | |
t1.speed(speed) |
This file contains hidden or 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 turtle | |
import time | |
##tom | |
##ang |
NewerOlder