一、eclipse的使用可能是全宇宙最好用的IDEdebug查看执行过程查看源码二、模块的常用方法__name____file____doc__三、函数参数参数默认值可变参数返回值''' def Foo(): print 'Foo' ...
分类:
其他好文 时间:
2015-11-18 14:15:03
阅读次数:
198
1 #第一个python实例:监控cpu 2 #/bin/bash/env Python 3 from __future__ import print_function 4 from collections import OrderedDict 5 import pprint 6 7 def C.....
分类:
编程语言 时间:
2015-11-18 12:43:34
阅读次数:
323
1.1、基本定义: www.2cto.com grep(global search regular RE ) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它只能使用基本的正则表达式来搜索文本,并把匹配的行打印出来。 grep是很常见也很常...
分类:
系统相关 时间:
2015-11-18 12:14:46
阅读次数:
244
#!/bin/bash
[$1=‘http_server‘]&&WEBGROUP=$1,FRONTEND||WEBGROUP=$1,BACKEND
case"$2"in
"comp")
IN=`/bin/echo"showstat"|/usr/sbin/socat/var/run/haproxy.sockstdio|awk-vn=$WEBGROUP-F,‘$0~n{print$52}‘`
OUT=`/bin/echo"showstat"|/usr/sbin/socat/var/run/ha..
分类:
其他好文 时间:
2015-11-18 02:11:30
阅读次数:
290
# -*- coding:utf-8 -*-__author__ = 'hunterhug'print("你好")#打印hello = "This 'is' \"a rather long string containing\n\ several lines of text just as y...
分类:
编程语言 时间:
2015-11-17 23:24:01
阅读次数:
222
用起来方便的,参考URL:http://lzw.me/a/shellinabox.html安装之后的启停两命令:shellinaboxd -b -c /tmp -p 8000ps -ef| grep shellinaboxd|grep -v grep|awk '{print $2}'|xargs k...
分类:
Web程序 时间:
2015-11-17 23:23:17
阅读次数:
199
#_metaclass_=type # 确定使用新式类class Animal: address="acccd"; def __init__(self): #构造方法 一个对象创建后会立即调用此方法 self.Name="Doraemon" print(self.Name); def access....
分类:
编程语言 时间:
2015-11-17 01:41:10
阅读次数:
242
override func viewDidLoad() { super.viewDidLoad() // 1. print(sumof(1,2,3,4,5,6,7,8,9,10)) // 2.show it showLabel.text = String(s...
分类:
编程语言 时间:
2015-11-17 00:20:37
阅读次数:
188
首先呢,我们先声明一个类class Parent { //声明一个属性 var p1: String = "abc" //声明一个方法 func m() { print("parent m") } //声明一个静态的方法 final fu...
分类:
编程语言 时间:
2015-11-16 22:28:15
阅读次数:
244
这一章来看看swift的函数声明与调用函数声明 func 函数名(参数)->返回类型{函数代码块}我们来声明一下//无参无反func test(){ print("asdfa");}//有参有反func test1(a:Int)->Int{ return ++a}//有参无反func te...
分类:
编程语言 时间:
2015-11-16 21:00:57
阅读次数:
162