01 2018 档案
python 协程
摘要:协程之yield#coding=utf-8import timedef A(): while True: print('---A---') yield ... 阅读全文
posted @ 2018-01-26 00:11 fonyer 阅读(110) 评论(0) 推荐(0)
php
摘要:header设置: header("Pragma:no-cache");//不缓存页面 header( 'Content-type: text/html;charset=utf-8' );//设置页面编码 header('Content-type: application/json');//json 阅读全文
posted @ 2018-01-22 12:45 fonyer 阅读(129) 评论(0) 推荐(0)
python socket编程
摘要:UDP协议:#coding=utf-8from threading import Threadfrom socket import *#收数据def receiveData(udpSocket,destIp,destPort): whil... 阅读全文
posted @ 2018-01-20 03:35 fonyer 阅读(202) 评论(0) 推荐(0)
linux
摘要:基础ctrl+a 光标移到行首ctrl+e 光标移到行尾find ./* -name 20171118* #查看当前目录下名称为20171118开头的文件grep -r 66072 ./* #查看当前目录下文件中包含66072字串的文件ls file_* #显示当前目录下file开头的文件 cont 阅读全文
posted @ 2018-01-17 22:28 fonyer 阅读(139) 评论(0) 推荐(0)
python 线程
摘要:1、线程类import threading import time class MyThread(threading.Thread): """docstring for MyThread""" def run(self): for x in range(2): ... 阅读全文
posted @ 2018-01-11 23:15 fonyer 阅读(120) 评论(0) 推荐(0)
多进程copy文件
摘要:from multiprocessing import Pool,Manager import os,time def copyFileTask(fileName,oldFolderName,newFolderName,queue): fr = open(old... 阅读全文
posted @ 2018-01-10 02:27 fonyer 阅读(240) 评论(0) 推荐(0)
Mac下安装社区版MongoDB
摘要:MongoDB下载地址:https://www.mongodb.com/download-center?_ga=2.98072543.1777419256.1515472368-391344272.1515472368#community1、解压tar -zxvf m... 阅读全文
posted @ 2018-01-10 02:24 fonyer 阅读(261) 评论(0) 推荐(0)
python消息队列Queue
摘要:实例1:消息队列Queue,不要将文件命名为“queue.py”,否则会报异常“ImportError: cannot import name 'Queue'”#coding=utf-8from multiprocessing import Queue q = Qu... 阅读全文
posted @ 2018-01-10 02:22 fonyer 阅读(1056) 评论(0) 推荐(0)
python 进程
摘要:#fork在window下不支持import osimport timeimport sys pid = os.fork()if pid == 0:#子进程 time.sleep(5) print('After 5 seconds') ... 阅读全文
posted @ 2018-01-10 02:17 fonyer 阅读(160) 评论(0) 推荐(0)