python 学习_第四模块 并发编程(多线程) 1 开启线程方式 from threading import Thread import time def say(name): time.sleep(2) print("%s hello"%name) if __name__ =="__main__ ...
分类:
编程语言 时间:
2019-06-18 12:24:22
阅读次数:
135
# -*- coding: utf-8 -*- from socket import * server = socket(AF_INET, SOCK_DGRAM) # udp以数据报的形式传输数据 ip_port = ("127.0.0.1", 8001) # 服务端的IP和端口 server.bi... ...
分类:
编程语言 时间:
2019-06-17 17:09:27
阅读次数:
152
# -*- coding: utf-8 -*- from threading import Timer def talk(name): print("%s is talking." % name) if __name__ == '__main__': '''Timer(等待多少秒, 执行的函数, a... ...
分类:
编程语言 时间:
2019-06-16 20:23:36
阅读次数:
132
# -*- coding: utf-8 -*- import time import threading from threading import Thread, Event def conn_mysql(): '''连接数据库''' print("(%s) start to conn_mysql... ...
分类:
编程语言 时间:
2019-06-16 20:12:39
阅读次数:
146
# -*- coding: utf-8 -*- from threading import Thread talk_l = [] format_l = [] def talk(): '''用户输入''' while 1: inp = input(">>: ").strip() if not inp:... ...
分类:
编程语言 时间:
2019-06-14 23:59:31
阅读次数:
245
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 闰年{ class Program { static vo ...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; /* //由框架提供的委托类型 //无返的 Action act0 ... ...
分类:
其他好文 时间:
2019-06-11 15:02:38
阅读次数:
101
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 多线程 { class Program { st... ...
分类:
其他好文 时间:
2019-06-11 14:57:49
阅读次数:
90
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Lambda //匿名方法,用来实现委托 { c... ...
分类:
其他好文 时间:
2019-06-11 14:56:01
阅读次数:
109
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net; using System.Dia... ...
分类:
其他好文 时间:
2019-06-11 12:57:43
阅读次数:
102