码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
python检测文件是否更新
import osimport timefilename = "test.txt"info = os.stat(filename)if time.time()-info.st_mtime > 600:#10分钟 print "done"else: print "modify"
分类:编程语言   时间:2015-04-14 17:59:57    阅读次数:203
PHP匿名函数
1、匿名函数就是临时创建的没有名称的函数。 2、PHP从PHP5.3.0版本开始支持匿名函数。 3、PHP的匿名函数通过closures实现,常用于回调函数。 下面看一例子: $my_array = array(1,2,3,4,5,6,7,8,9);     print_r($my_array);     echo "";     $new_array = array...
分类:Web程序   时间:2015-04-14 14:43:33    阅读次数:125
cpu、内存、磁盘
例一:内存使用率#!/bin/bashtotal=$(free -m|grep Mem|awk '{print $2}')used=$(free -m|grep Mem|awk '{print $3}')echo "$used/$total"|bc -l >> /home/shell/cun.txt...
分类:其他好文   时间:2015-04-14 14:34:31    阅读次数:115
Python 2.x 与 Python3.x 主要区别对照表
Python2.4+ 与 Python3.0+ 主要变化或新增内容 Python2?? ??? ??? ????? Python3 print是内置命令 ?? ?????? print变为函数 print >> f,x,y????????? print(x,y,file=f) print x,...
分类:编程语言   时间:2015-04-14 13:06:17    阅读次数:136
c++中 extern
用例子给你示范 // 1.cpp int x = 10; // 2.cpp 注意没有包含1.cpp #include using namespace std; extern int x;int main () { cout void print() { std::cout using name...
分类:编程语言   时间:2015-04-14 12:32:06    阅读次数:149
【ThinkingInJava】6、测试自己的输出类库
/** * 书本:《Thinking In Java》 * 功能:定制工具库,用于System.out.println的简化 * 文件:Print.java * 时间:2014年10月7日19:45:31 * 作者:cutter_point */ package net.mindview.util; import java.io.*; import javax.print.attribute....
分类:编程语言   时间:2015-04-14 11:15:13    阅读次数:131
Linux下查看Nginx Apache MySQL的并发连接数和连接状态
1、查看Web服务器(Nginx?Apache)的并发请求数及其TCP连接状态: netstat -n | awk ‘/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}‘ 或者: netstat -n | awk ‘/^tcp/ {++state[$NF]} END {for(key in st...
分类:数据库   时间:2015-04-13 19:12:16    阅读次数:165
写个简单的螺旋打印矩阵程序-C
#include#define PRINT(x) printf("%03d ",(x))void spiral_matrix_print(const int matrix[][4],int rows,int columns){ int top,left,i; int bottom = rows-1;...
分类:其他好文   时间:2015-04-13 18:40:20    阅读次数:185
Python @staticmethod, @classmethod, @property
@staticmethod, @classmethod, @property 用法及作用class Foo(object) : def __init__(self) : self._name = "property test" print "init" de...
分类:编程语言   时间:2015-04-13 18:21:34    阅读次数:145
Python入门案例之Hello
from Tkinter import * class Application(Frame): def say_hi(self): print 'hello' def createWiegets(self): self.QUIT = Button(self) self.QUIT["text"] = "QUIT" self....
分类:编程语言   时间:2015-04-13 16:44:08    阅读次数:168
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!