Skip to content

Instantly share code, notes, and snippets.

@only-entertainment
only-entertainment / vin_validation.py
Created March 24, 2012 00:42
Validate a VIN using Python
class VINLookupForm(Form):
"""
Lookup a VIN form
"""
vin = TextField(u'Enter VIN',
validators=[validators.Required(u'VIN is required for lookup.')])
def validate_vin(self, field):
"""
Validate a VIN against the 9th position checksum
@only-entertainment
only-entertainment / server.py
Created February 17, 2012 22:32
Async Game Server
import asyncore
import socket
import json
state = {}
class UpdateMsg(object):
def __init__(self, data):
sdata = data.strip().split(' ')
self.player = sdata[0]