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
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
例一:内存使用率#!/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
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
用例子给你示范 // 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
/**
* 书本:《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
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
#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
@staticmethod, @classmethod, @property 用法及作用class Foo(object) : def __init__(self) : self._name = "property test" print "init" de...
分类:
编程语言 时间:
2015-04-13 18:21:34
阅读次数:
145
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