Skip to content

Instantly share code, notes, and snippets.

View LennyPhoenix's full-sized avatar

Lenny Critchley LennyPhoenix

View GitHub Profile
@LennyPhoenix
LennyPhoenix / pyglet-application.py
Last active June 1, 2020 19:52
Basic application template in python with pyglet.
import pyglet
# Define the application
class Application:
# Define what should be created on initialisation
def __init__(self):
# Create a window
self.window = pyglet.window.Window()

Examples

Examples Status

NOTE: I have not tested the subfolder examples. This includes 3dmodel, astraea, game (the example game), noisy, programming_guide and soundspace.

  • apple_remote.py [Unknown]
    • Unable to test as I do not own an apple IR remote.
  • Missing license comment.
@LennyPhoenix
LennyPhoenix / DiscordPy Tutorial.md
Last active August 11, 2020 10:46 — forked from 4Kaylum/DiscordPy Tutorial.md
A simple bot tutorial for Discord.py

Writing a Discord bot with Discord.py

Hey one, hey all, and welcome to a basic Discord bot writing tutorial. This is a basic tutorial that doesn't cover coding in general, but rather how to work with the Discord.py (v1.0.0a) library and how to write a simple bot with it. General help can be found on the Discord API guild and in the documentation.

This tutorial assumes some prior knowledge of programming, and assumes you already have Python3.5 (and Pip) or later installed and added to your PATH.

With that, let's get to it.

Installation

@LennyPhoenix
LennyPhoenix / help.py
Created January 20, 2021 12:10
Help Command for Discord.py Cogs-Based Bot
@commands.command()
async def help(self, ctx, *, category=None):
"""This command!"""
if category is None:
embed = discord.Embed(
title="Category Listing and Uncatergorized Commands",
description="""Use `help *category*` to find out more about them!""",
colour=self.bot.main_colour
)
@LennyPhoenix
LennyPhoenix / obsidian flashcards.md
Created April 9, 2022 13:46
Setting up Obsidian for flashcards.

Setting up Flashcards

Start by downloading the Obsidian app (it's just on the Google play store), then open it up.

Select "Create" and choose a location to put it (you will probably want to note down where you choose because you'll need the location to be able to sync with your PC) then you'll have a blank new obsidian vault to work with.

Plugins and settings

In order to set up flashcards there are a few things you'll want to do, start by going to the settings menu (bottom of the left sidebar). Go to "Community Plugins", disable Safe mode, then click "Browse".

@LennyPhoenix
LennyPhoenix / alternative_method.py
Last active September 1, 2022 01:57
Using Tkinter and Pyglet in the same program
"""
This version uses `Window.set_visible` instead of deleting the window,
so the default event loop can be used and the `on_close` event does not
need to be overridden.
"""
import threading
import pyglet
import tkinter