随笔分类 -  python

上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 48 下一页
摘要:##Using Queue with multiprocessing – Chapter 3: Process Based Parallelism import multiprocessing import random import time class producer(multiprocessing.Process): def __init__(self, queue): ... 阅读全文
posted @ 2018-12-29 01:23 anobscureretreat 阅读(174) 评论(0) 推荐(0)
摘要:双击文件运行 阅读全文
posted @ 2018-12-29 01:02 anobscureretreat 阅读(184) 评论(0) 推荐(0)
摘要:#!/usr/bin/python3 def KelvinToFahrenheit(Temperature): assert (Temperature >= 0),"Colder than absolute zero!" return ((Temperature-273)*1.8)+32 print (KelvinToFahrenheit(273)) print (int(Ke... 阅读全文
posted @ 2018-12-28 18:14 anobscureretreat 阅读(200) 评论(0) 推荐(0)
摘要:输出 阅读全文
posted @ 2018-12-28 01:16 anobscureretreat 阅读(1613) 评论(0) 推荐(0)
摘要:输出 阅读全文
posted @ 2018-12-28 01:13 anobscureretreat 阅读(259) 评论(0) 推荐(0)
摘要:输出 阅读全文
posted @ 2018-12-28 01:09 anobscureretreat 阅读(847) 评论(0) 推荐(0)
摘要:例1 输出 例2 输出 例3 输出 例4 输出 例5 阅读全文
posted @ 2018-12-28 01:04 anobscureretreat 阅读(1809) 评论(0) 推荐(0)
摘要:例1 输出 例2 输出 阅读全文
posted @ 2018-12-28 00:49 anobscureretreat 阅读(584) 评论(0) 推荐(0)
摘要:def interpolation_search(data,val): low=0 high=len(data)-1 print('查找过程中......') while low data[mid]: print('%d 介于中间值位置 %d[%3d] 和 %d[%3d] 之间,找右半边' \ %(v... 阅读全文
posted @ 2018-12-27 23:52 anobscureretreat 阅读(637) 评论(0) 推荐(0)
摘要:def bin_search(data,val): low=0 high=len(data)-1 while low data[mid]: print('%d 介于中间值位置 %d[%3d] 和 %d[%3d] 之间,找右半边' \ %(val,mid+1,data[mid],high+1,data[high... 阅读全文
posted @ 2018-12-27 23:35 anobscureretreat 阅读(231) 评论(0) 推荐(0)
摘要:import random val=0 data=[5,6,7,8,9] while val!=-1: find=0 val=int(input('请输入查找键值(1-9),输入-1离开:')) for i in data: if i==val: print('在第 %3d个位置找到键值 [%3d]' %(i+1,i)) ... 阅读全文
posted @ 2018-12-27 22:55 anobscureretreat 阅读(463) 评论(0) 推荐(0)
摘要:assert语句 输出 阅读全文
posted @ 2018-12-26 21:27 anobscureretreat 阅读(212) 评论(0) 推荐(0)
摘要:match函数 输出 search函数 输出 匹配与搜索 输出 搜索和替换 输出 阅读全文
posted @ 2018-12-26 20:31 anobscureretreat 阅读(198) 评论(0) 推荐(0)
摘要:一个简单的服务器 一个简单的客户端 阅读全文
posted @ 2018-12-26 19:06 anobscureretreat 阅读(246) 评论(0) 推荐(0)
摘要:thread模块 输出 threading模块 输出 同步线程 输出 多线程优先级队列 输出 阅读全文
posted @ 2018-12-26 14:59 anobscureretreat 阅读(208) 评论(0) 推荐(0)
摘要:movies.xml 使用SAX API解析XML 输出 使用DOM API解析XML 输出 阅读全文
posted @ 2018-12-26 14:33 anobscureretreat 阅读(217) 评论(0) 推荐(0)
摘要:例子一 例子二 的实现为 例子三 for i in PowTwo(5): print(i) 输出 执行 例子四 返回所有奇数 执行 阅读全文
posted @ 2018-12-26 13:51 anobscureretreat 阅读(138) 评论(0) 推荐(0)
摘要:例子一 执行 例子二 输出 例子三 输出 上面的 相当于 阅读全文
posted @ 2018-12-26 13:16 anobscureretreat 阅读(159) 评论(0) 推荐(0)
摘要:一 二 例子1 输出 例子2 输出 例子3 反转字符串的生成器 输出 阅读全文
posted @ 2018-12-26 11:45 anobscureretreat 阅读(193) 评论(0) 推荐(0)
摘要:def make_multiplier_of(n): def multiplier(x): return x * n return multiplier # Multiplier of 3 times3 = make_multiplier_of(3) # Multiplier of 5 times5 = make_multiplier_of(5) # O... 阅读全文
posted @ 2018-12-26 11:27 anobscureretreat 阅读(179) 评论(0) 推荐(0)

上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 48 下一页