2018年2月1日
摘要: 写操作:#安装PyMySQL:pip3 install PyMySQL#!/usr/bin/python3#coding=utf-8 import pymysql # 打开数据库连接db = pymysql.connect("localhost","r... 阅读全文
posted @ 2018-02-01 00:52 fonyer 阅读(118) 评论(0) 推荐(0) 编辑
  2018年1月26日
摘要: 协程之yield#coding=utf-8import timedef A(): while True: print('---A---') yield ... 阅读全文
posted @ 2018-01-26 00:11 fonyer 阅读(109) 评论(0) 推荐(0) 编辑
  2018年1月22日
摘要: 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) 编辑
  2018年1月20日
摘要: UDP协议:#coding=utf-8from threading import Threadfrom socket import *#收数据def receiveData(udpSocket,destIp,destPort): whil... 阅读全文
posted @ 2018-01-20 03:35 fonyer 阅读(189) 评论(0) 推荐(0) 编辑
  2018年1月17日
摘要: 基础ctrl+a 光标移到行首ctrl+e 光标移到行尾find ./* -name 20171118* #查看当前目录下名称为20171118开头的文件grep -r 66072 ./* #查看当前目录下文件中包含66072字串的文件ls file_* #显示当前目录下file开头的文件 cont 阅读全文
posted @ 2018-01-17 22:28 fonyer 阅读(136) 评论(0) 推荐(0) 编辑
  2018年1月11日
摘要: 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 阅读(118) 评论(0) 推荐(0) 编辑
  2018年1月10日
摘要: from multiprocessing import Pool,Manager import os,time def copyFileTask(fileName,oldFolderName,newFolderName,queue): fr = open(old... 阅读全文
posted @ 2018-01-10 02:27 fonyer 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 实例1:消息队列Queue,不要将文件命名为“queue.py”,否则会报异常“ImportError: cannot import name 'Queue'”#coding=utf-8from multiprocessing import Queue q = Qu... 阅读全文
posted @ 2018-01-10 02:22 fonyer 阅读(1037) 评论(0) 推荐(0) 编辑
摘要: #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 阅读(158) 评论(0) 推荐(0) 编辑