码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
Python进程间通信之匿名管道
匿名管道管道是一个单向通道,有点类似共享内存缓存.管道有两端,包括输入端和输出端.对于一个进程的而言,它只能看到管道一端,即要么是输入端要么是输出端.os.pipe()返回2个文件描述符(r, w),表示可读的和可写的.示例代码如下:#!/usr/bin/python import time import osdef child(wpipe): print('hello from child...
分类:编程语言   时间:2015-04-09 12:02:47    阅读次数:191
顺序表的实现(C语言)
#include #include #define MAXSIZE 100 struct List { int element[MAXSIZE]; //链表中最大节点数 int len; //当前链表的长度 }*t; void print(List *t); int Isemtty(List *t) //判断链表是否为空 { if(t->len==...
分类:编程语言   时间:2015-04-09 08:49:42    阅读次数:161
python 学习笔记
>>> help(print)Help on built-in function print in module builtins:print(...) print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) ...
分类:编程语言   时间:2015-04-09 00:56:37    阅读次数:250
SocketServer简单实现实时查看网站pv,uv
代码:#!/usr/bin/envpython #__*__coding:utf8__*__ importSocketServer importos classMyServer(SocketServer.BaseRequestHandler): logname="/opt/nginx/logs/www.xxx.com_access.log" defhandle(self): self.pv=os.popen("awk‘{print$1}‘%s|wc-l"%self.logname).read() se..
分类:Web程序   时间:2015-04-08 19:58:20    阅读次数:165
【陌陌】Python 快排
import randomdef qsort2(array): if len(array) =array[0]])def qsort(array, left, right): if left >= right: pass else: print array,left,...
分类:编程语言   时间:2015-04-08 19:30:25    阅读次数:172
创建顺序表并实现各种操作(C语言)
#nclude #include #define MAXSIZE 100 struct List { int element[MAXSIZE]; //链表中最大节点数 int len; //当前链表的长度 }*t; void print(List *t); int Isemtty(List *t) //判断链表是否为空 {...
分类:编程语言   时间:2015-04-08 18:17:42    阅读次数:180
python 计算出 素数 奇数 和偶数脚本
#!/usr/bin/envpython#-*-coding:utf8-*-#这是一个python写的素数脚本,只是计算100以内的素数file=open(‘test.txt‘,‘w+‘)forninrange(100):ifn%2==1:print>>file,nfile.close()#!/usr/bin/envpython#-*-coding:utf8-*-#这是偶数python脚本,100以内的forxinrange(101):if..
分类:编程语言   时间:2015-04-08 16:48:36    阅读次数:241
curl 模拟表单提交
//GET方式$url="/Api/Raiders/doEditRaiders?content=123";$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$url);curl_setopt($ch,CURLOPT_HEADER,0);curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);$return=curl_exec($ch);curl_close($ch);print_r($return);//POST方式$url="/Api..
分类:Web程序   时间:2015-04-08 16:41:20    阅读次数:125
awk命令详解
简介awk逐行读入文本,以空格为默认分隔符切片,对各部分分析处理使用方法awk 'pattern {action}' filenameawk 'pattern {action} pattern {action}...' filenameawk -F ":" 'BEGIN {print "name,....
分类:其他好文   时间:2015-04-08 14:41:13    阅读次数:112
Python学习笔记 (第9课)
本节将学习一些循环序列的方法已经序列的大小比较规则1.循环序列的方法如果我们想同时循环打印一个列表的index和value,我们可以用enumerate(list) 函数>>> L=['a','b','c','d']>>> for i,k in enumerate(L): print i,':...
分类:编程语言   时间:2015-04-08 13:04:20    阅读次数:194
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!