Skip to content

Instantly share code, notes, and snippets.

View driscollis's full-sized avatar

Mike Driscoll driscollis

View GitHub Profile
import wx
import keyword
import string
class TreeFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title='TreeCtrl example')
@driscollis
driscollis / gist:a42aecb379742d3cd150
Created June 13, 2014 13:36
wxPython ScrolledPanel Example
import wx
import wx.lib.scrolledpanel as scrolled
########################################################################
class MyForm(wx.Frame):
#----------------------------------------------------------------------
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "Tutorial", size=(200,500))
import wx
import wx.animate
import os
import os
GIFNames = [
#os.path.join(os.path.dirname(__file__),'bitmaps', 'AG00178_.gif'),
import peewee
database = peewee.SqliteDatabase("wee.db")
########################################################################
class Artist(peewee.Model):
"""
ORM model of the Artist table
"""
name = peewee.CharField()
import datetime
import peewee
from models import Album, Artist
new_artist = Artist.create(name="Newsboys")
new_artist.save()
album_one = Album(artist=new_artist,
title="Read All About It",
@driscollis
driscollis / gist:69b83f6b1a53f533eeb6
Created August 26, 2014 18:06
wxPython multiple events on the same handler
import wx
class MyForm(wx.Frame):
#----------------------------------------------------------------------
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "Tutorial", size=(500,500))
# Add a panel so it looks the correct on all platforms
panel = wx.Panel(self, wx.ID_ANY)
@driscollis
driscollis / wxredir
Created September 5, 2014 21:03
wxPython redirect text to file
import wx
import sys
########################################################################
class redirect(object):
""""""
#----------------------------------------------------------------------
def __init__(self, obj):
"""Constructor"""
@driscollis
driscollis / kv_login
Last active June 6, 2021 18:49
Kv Login example
<LoginScreen@GridLayout>:
my_username: username
my_password: password
rows: 2
cols: 2
padding: 5
spacing: 5
Label:
text: 'User Name:'
@driscollis
driscollis / kv_py_login
Last active August 29, 2015 14:06
kv_login with just python
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
class TutorialApp(App):
def build(self):
main_layout = BoxLayout(orientation="vertical")
user_layout = BoxLayout(orientation="horizontal",
@driscollis
driscollis / login.kv
Created September 18, 2014 13:20
kv_login take two
<UsernameWidget>:
BoxLayout:
size: root.size
pos: root.pos
orientation: "horizontal"
Label:
text: "Username:"
TextInput: