参考:http://flask.pocoo.org/docs/0.12/patterns/streaming/#streaming-from-templates
目录结构:
.
├── app.py
└── templates
└── the_template.html
参考:http://flask.pocoo.org/docs/0.12/patterns/streaming/#streaming-from-templates
目录结构:
.
├── app.py
└── templates
└── the_template.html
import time | |
import uuid | |
def ksuid(): | |
return hex(int(time.time()))[2:] + uuid.uuid4().hex |
import socket | |
def get_local_ip(): | |
''' | |
获得本机可联网的IP | |
''' | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock.connect(("baidu.com", 80)) | |
ip = sock.getsockname()[0] | |
sock.close() |
# 1. Download and install the latest Anaconda distribution from https://www.continuum.io/downloads#macos | |
# 2. Create a new Python environment. Make sure you choose python 3.5 as your python version for the virtual environment: | |
conda create -n myenv python=3.5 | |
# 3. Activate the new environment using: | |
source activate myenv |
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
# created: Mon Sep 15 13:27:15 2014 | |
# filename: mkpasswd.py | |
# author: juntao liu | |
# email: [email protected] | |
# descritpion: | |
import datetime | |
import random |
redis 命令参数数量不能超过 1024*1024 个,包含命令哦。 比如:
SADD key 1 2 3 4...n (n <= 1024*1024 - 2)