摘要:
写操作:#安装PyMySQL:pip3 install PyMySQL#!/usr/bin/python3#coding=utf-8 import pymysql # 打开数据库连接db = pymysql.connect("localhost","r... 阅读全文
摘要:
协程之yield#coding=utf-8import timedef A(): while True: print('---A---') yield ... 阅读全文
摘要:
header设置: header("Pragma:no-cache");//不缓存页面 header( 'Content-type: text/html;charset=utf-8' );//设置页面编码 header('Content-type: application/json');//json 阅读全文
摘要:
UDP协议:#coding=utf-8from threading import Threadfrom socket import *#收数据def receiveData(udpSocket,destIp,destPort): whil... 阅读全文
摘要:
基础ctrl+a 光标移到行首ctrl+e 光标移到行尾find ./* -name 20171118* #查看当前目录下名称为20171118开头的文件grep -r 66072 ./* #查看当前目录下文件中包含66072字串的文件ls file_* #显示当前目录下file开头的文件 cont 阅读全文
摘要:
1、线程类import threading import time class MyThread(threading.Thread): """docstring for MyThread""" def run(self): for x in range(2): ... 阅读全文
摘要:
from multiprocessing import Pool,Manager import os,time def copyFileTask(fileName,oldFolderName,newFolderName,queue): fr = open(old... 阅读全文
摘要:
MongoDB下载地址:https://www.mongodb.com/download-center?_ga=2.98072543.1777419256.1515472368-391344272.1515472368#community1、解压tar -zxvf m... 阅读全文
摘要:
实例1:消息队列Queue,不要将文件命名为“queue.py”,否则会报异常“ImportError: cannot import name 'Queue'”#coding=utf-8from multiprocessing import Queue q = Qu... 阅读全文
摘要:
#fork在window下不支持import osimport timeimport sys pid = os.fork()if pid == 0:#子进程 time.sleep(5) print('After 5 seconds') ... 阅读全文