Skip to content

Instantly share code, notes, and snippets.

@adamantonio
adamantonio / todo.py
Last active January 4, 2023 12:28
Todo app with Python and GooeyPie - https://www.gooeypie.dev/resources
import gooeypie as gp
def add_new_task(event):
"""Adds a new task from when the Enter/Return key is pressed"""
if event.key['name'] == 'Return' and new_task_inp.text != "":
todo_lst.add_item(new_task_inp.text)
new_task_inp.clear()
new_task_inp.focus()
@adamantonio
adamantonio / chbs.py
Last active December 18, 2022 22:21
Correct Horse Battery Staple Password Generator - https://www.youtube.com/watch?v=7rT_kqxOCXw
import gooeypie as gp
from random import choice
nouns = open('words-nouns.txt').read().splitlines()
adjectives = open('words-adjectives.txt').read().splitlines()
def generate_password(event):
"""Generates and displays a new random password"""
word1 = choice(adjectives)
word2 = choice(nouns + adjectives)
import string
from random import choice
import gooeypie as gp
default_password_length = 8
app = gp.GooeyPieApp('Password Generator')
app.resizable_vertical = False
def generate_password(length, letters, digits, symbols):
@adamantonio
adamantonio / todo-text.py
Created February 4, 2023 02:09
Todo app with saving and loading tasks using a text file
import gooeypie as gp
import os
def add_new_task(event):
"""Adds a new task from when the Enter/Return key is pressed"""
if event.key['name'] == 'Return' and new_task_inp.text != "":
todo_lst.add_item(new_task_inp.text)
new_task_inp.clear()
new_task_inp.focus()
@adamantonio
adamantonio / todo-json.py
Created February 4, 2023 02:10
Todo app with saving and loading tasks using json
import gooeypie as gp
import os
import json
def add_new_task(event):
"""Adds a new task from when the Enter/Return key is pressed"""
if event.key['name'] == 'Return' and new_task_inp.text != "":
todo_lst.add_item(new_task_inp.text)
new_task_inp.clear()
new_task_inp.focus()
@adamantonio
adamantonio / todo-pickle.py
Created February 4, 2023 02:11
Todo app with saving and loading tasks using pickle
import gooeypie as gp
import os
import pickle
def add_new_task(event):
"""Adds a new task from when the Enter/Return key is pressed"""
if event.key['name'] == 'Return' and new_task_inp.text != "":
todo_lst.add_item(new_task_inp.text)
new_task_inp.clear()
new_task_inp.focus()