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 tkinter import * | |
import pygame.mixer | |
class SoundPanel(Frame): | |
def track_toggle(self): | |
if self.track_playing.get() == 1: | |
self.track.play(loops = -1) | |
else: | |
self.track.stop() | |
def change_volume(self, v): |
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 tkinter import * | |
from sound_panel import * | |
import pygame.mixer | |
import os | |
app=Tk() | |
app.title('Head First Mix') | |
mixer = pygame.mixer | |
mixer.pre_init(buffer = 300) | |
mixer.init() |
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 requests | |
import json | |
AFTER = 1353233754 | |
TOKEN = ' <insert token here> ' | |
#by Akshit Khurana | |
def get_posts(): | |
"""Returns dictionary of id, first names of people who posted on my wall | |
between start and end time""" | |
query = ("SELECT post_id, actor_id, message FROM stream WHERE " |
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
g = {} | |
g[1] = [2, 3, 5] | |
g[2] = [1, 6, 4] | |
g[3] = [1, 4, 7] | |
g[4] = [2, 3, 8] | |
g[5] = [1, 6, 7] | |
g[6] = [2, 5, 8] | |
g[7] = [3, 5, 8] | |
g[8] = [4, 6, 7] | |
removidos = [True] + 8 * [False] |
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 random | |
girls = '''Júlia Sophia Isabella Manuela Giovanna Alice Laura | |
Luiza Beatriz Mariana Yasmin Gabriela Rafaela Isabelle Lara | |
Letícia Valentina Nicole Sarah Vitória Isadora Lívia Helena | |
Lorena Clara Larissa Emanuelly Heloisa Marina Melissa Gabrielly | |
Eduarda Rebeca Amanda Alícia Bianca Lavínia Fernanda Ester | |
Carolina Emily Cecília Pietra Milena Marcela Laís Natália | |
Maria Bruna Camila Luana Catarina Olivia Agatha Mirella | |
Sophie Stella Stefany Isabel Kamilly Elisa Luna Eloá Joana | |
Mariane Bárbara Juliana Rayssa Alana Caroline Brenda Evelyn |
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
class int42(int): | |
def __init__(self, n): | |
int.__init__(n) | |
def __add__(a, b): | |
return 42 | |
def __str__(n): | |
return '42' |
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 requests | |
jogos = requests.get('http://worldcup.sfg.io/matches').json() | |
for jogo in jogos: | |
if jogo['status'] in ('completed', 'in progress'): | |
print (jogo['home_team']['country'], jogo['home_team']['goals'], 'x', | |
jogo['away_team']['country'], jogo['away_team']['goals']) |
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
#@gwidion code | |
print"".join(u"\x1b[%dm%c%s"%((42+y%2^y>>3&1),((1,3,2,-1,0,2,3,1)+(4,)*8+32*(-9781,)+8*(10,)+(7,9,8,5,6,8,9,7))[y]+9813,(y+1)%8and" "or" \x1b[48m\n")for y in range(64)) |
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
def dec2bin(n): | |
b = '' | |
while n != 0: | |
b = b + str(n % 2) | |
n = int(n / 2) | |
return b[::-1] | |
def d2b(n): | |
if n == 0: | |
return '' |
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
def merge(e, d): | |
r = [] | |
i, j = 0, 0 | |
while i < len(e) and j < len(d): | |
if e[i] <= d[j]: | |
r.append(e[i]) | |
i += 1 | |
else: | |
r.append(d[j]) | |
j += 1 |