This file contains 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 web | |
from gothonweb import map | |
urls = ( | |
'/game', 'GameEngine', | |
'/', 'Index', | |
) | |
app = web.application(urls, globals()) |
This file contains 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 web | |
urls = ( | |
'/hello', 'Index' | |
) | |
app = web.application(urls, globals()) | |
render = web.template.render('templates/', base="layout") |
This file contains 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
#This app.py handles POST data from the hello_form | |
import web | |
urls = ( | |
'/hello', 'Index' | |
) | |
app = web.application(urls, globals()) |
This file contains 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 web | |
urls = ( | |
'/hello', 'Index' | |
) | |
app = web.application(urls, globals()) | |
render = web.template.render('templates/') |
This file contains 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 web | |
urls = ( | |
'/', 'index' | |
) | |
app = web.application(urls, globals()) | |
render = web.template.render('templates') | |
class index: |
This file contains 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
class LexiconC(object): | |
def __init__(self): | |
#constants | |
# TODO: Can we make these as constants so they can be accessed from out side the class with just the class name ? | |
self.C_DIRECTION_WORDS = "direction" | |
self.C_VERBS = "verb" | |
self.C_STOP_WORDS = "stop" | |
self.C_NOUNS = "noun" | |
self.C_NUMBER = "number" |
This file contains 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
class LexiconC(object): | |
def __init__(self): | |
#constants | |
# TODO: Can we make these as constants so they can be accessed from out side the class with just the class name ? | |
self.C_DIRECTION_WORDS = "direction" | |
self.C_VERBS = "verb" | |
self.C_STOP_WORDS = "stop" | |
self.C_NOUNS = "noun" | |
self.C_NUMBER = "number" | |
self.C_ERROR = "error" |
This file contains 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
class Room(object): | |
def __init__(self, name, description): | |
self.name = name | |
self.description = description | |
self.paths = {} | |
def go(self, direction): | |
return self.paths.get(direction, None) |
This file contains 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
#! python | |
from pypomodoro import pomodoro | |
from sys import argv | |
script, task, time_period = argv | |
pomodoro.start(task, time_period) |
This file contains 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
## Animal is-a object (yes, sort of confusing) look at the extra credit | |
class Animal(object): | |
pass | |
## is-a Animal | |
class Dog(Animal): | |
def __init__(self, name): | |
## has-a name | |
self.name = name |
NewerOlder