./test.py ./static/index.html ./static/client.js
python ./test.py
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import time | |
import poplib | |
import email | |
def get_subject(msg): |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
''' | |
複数プロセスから複数スレッドを起動して、Ctrl-Cで停止する例 | |
''' | |
import time | |
import threading | |
import multiprocessing |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import json | |
import tornado | |
from tornado import websocket, web, ioloop, gen, httpclient | |
ws_client = [] |
# tokengenerator (node#,num of node) | |
python -c 'print (lambda node,nodes: [ 2**127/nodes*x for x in xrange(nodes)][node-1])(1,5)' |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.1/angular.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.1/angular-resource.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.1/angular-cookies.min.js"></script> | |
<script language="javascript"> | |
function pausecomp(ms) { | |
ms += new Date().getTime(); | |
while (new Date() < ms){} |
class FileHandler(tornado.web.RequestHandler): | |
def get(self): | |
self.set_header('Content-Type', "text/csv") | |
self.set_header('Content-Disposition', | |
"attachment; filename=\"{}\"".format(filename)) | |
self.set_header('Content-Length', os.path.getsize(filename)) | |
with open(filename, 'rb') as fp: | |
self.write(fp.read()) |
import datetime | |
for obj in a: | |
datetime.datetime.fromtimestamp(float(id(obj))/pow(10,5)).strftime( '%Y-%m-%d %H:%M:%S' ) |