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 threading | |
| def thread_create_meme(): | |
| awesome_thread = threading.Thread(target=create_meme) | |
| awesome_thread.start() | |
| threaded = PushButton(app, text="Create With THREAD", command=thread_create_meme, grid=[1, 7]) |
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 credentials import USERNAME, PASSWORD | |
| import requests | |
| from pprint import pprint | |
| from typing import NamedTuple | |
| r = requests.get("https://api.imgflip.com/get_memes") | |
| resp = r.json() | |
| templates = resp["data"]["memes"] |
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 guizero import App, Picture, Text | |
| from PIL import Image | |
| app = App() | |
| Picture(app, image="card_image/club/2.png", align="left") | |
| Picture(app, image="card_image/club/3.png", align="left") | |
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
| card_ranks = { 1: "Ace", | |
| 2: "Two", | |
| 3: "Three", | |
| 4: "Four", | |
| 5: "Five", | |
| 6: "Six", | |
| 7: "Seven", | |
| 8: "Eight", | |
| 9: "Nine", |
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 | |
| pen = turtle.Turtle() | |
| # Head (Comment) | |
| pen.penup() | |
| pen.goto(0, -100) | |
| pen.color("#f2d73f") | |
| pen.begin_fill() | |
| pen.circle(100) |
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
| # Reading a CSV and creating a chart | |
| import pandas as pd | |
| import matplotlib.pyplot as plt # Provides us functions to create the visuals | |
| # EOD Pricing for 12 instruments | |
| data = pd.read_csv('/content/tr_eikon_eod_data.csv', #File location | |
| index_col=0, # First column treated as an index | |
| parse_dates=True) # Indicies are Dates | |
| plt.plot(data['AAPL.O']) |
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 os | |
| from google.cloud import texttospeech | |
| from google.oauth2 import service_account | |
| credentials = service_account.Credentials.from_service_account_file('ga-service-key.json') | |
| def synthesize_text(text): | |
| """Synthesizes speech from the input string of text.""" | |
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 guizero import App, PushButton | |
| app = App("File Picker") | |
| def pick(): | |
| app.select_file() | |
| button = PushButton(app, text="Get File", command=pick) | |
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
| # Imports --------------- | |
| from guizero import App, Box, PushButton, Text | |
| # Functions ------------- | |
| def clear_board(): | |
| new_board = [ [None, None, None], | |
| [None, None, None], | |
| [None, None, None] ] | |
| for numberX in range(3): |
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 check_win(): | |
| winner = None | |
| # Vertical lines | |
| if (board_squares[0][0].text == board_squares[0][1].text == board_squares[0][2].text) and board_squares[0][2].text in ["X", "O"]: | |
| winner = board_squares[0][0] | |
| # Horizontal lines | |
| elif (board_squares[0][0].text == board_squares[1][0].text == board_squares[2][0].text) and board_squares[2][0].text in ["X", "O"]: | |
| winner = board_squares[0][0] | |
| # Diagonals | |
| elif (board_squares[0][0].text == board_squares[1][1].text == |
NewerOlder