1 Star 0 Fork 0

月夜归醉o/python学习笔记

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Fun.py 466 Bytes
一键复制 编辑 原始数据 按行查看 历史
月夜归醉o 提交于 2023-01-11 21:51 +08:00 . 多进程、线程TCP服务器通信
import time
from multiprocessing import Process
from threading import Thread
from time import sleep
# 计算密集型
def count(x, y):
c = 0
while c < 7000000:
c += 1
x += 1
y += 1
# IO密集函数
def io():
write()
read()
def write():
f = open('test.txt', 'w')
for i in range(1500000):
f.write("hello world\n")
f.close()
def read():
f = open('test.txt')
lines = f.readlines()
f.close()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/brozer/python-learning-notes.git
git@gitee.com:brozer/python-learning-notes.git
brozer
python-learning-notes
python学习笔记
master

搜索帮助