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
# -*- coding:utf-8 -*- | |
from mako.template import Template | |
from mako.lookup import TemplateLookup | |
def generate_source_mako(): | |
with open("source.mako", "w") as w: | |
w.write(""" | |
<div id="header"> | |
<%block name="header"> |
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 A(object): | |
fmt = "tweets %s" | |
def hello(self): | |
return "hello " + self.name | |
@classmethod | |
def tweets(cls, mes): | |
return cls.fmt % mes | |
def __init__(self, name): | |
self.name = name |
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
#!/usr/bin/env python | |
from __future__ import print_function | |
from flask import Flask, render_template, Response | |
import socket | |
from contextlib import closing | |
from threading import Thread | |
from time import sleep | |
import logging | |
logger = 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
package main | |
import ( | |
"fmt" | |
"sort" | |
) | |
func formatIntPtr(fmtstr, nilstr string, p *int) string { | |
if p == nil { | |
return nilstr |