摘要: import requestsfrom html.parser import HTMLParserclass MyHtmlParser(HTMLParser): srclist = {} count = 0 def handle_starttag(self, tag, attrs)... 阅读全文
posted @ 2015-02-13 15:10 yumuxu 阅读(997) 评论(0) 推荐(0) 编辑
摘要: gethash key table &optional default [Function] 这个函数的作用是在 table 中查找 key ,然后返回关联的 value,如果没有找到对应的key就返回默认值 remhash key table [Function] 删除table中有关联... 阅读全文
posted @ 2015-01-26 16:12 yumuxu 阅读(336) 评论(0) 推荐(0) 编辑
摘要: //type:interface value:sturctfunc PrintStruct(t reflect.Type, v reflect.Value, pc int) { fmt.Println("") for i := 0; i < t.NumField(); i++ { ... 阅读全文
posted @ 2015-01-24 17:31 yumuxu 阅读(3271) 评论(0) 推荐(0) 编辑
摘要: 1 package main 2 3 import ( 4 "fmt" 5 "reflect" 6 ) 7 8 const ( 9 cmask = 12710 )11 12 func main() {13 var u uint814 u = 2215 ... 阅读全文
posted @ 2015-01-08 15:16 yumuxu 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1 // golang 查看变量的类型 2 // 1.switch 中使用i.(type) 3 // 2.使用反射 reflect.TypeOf(i) 4 package main 5 6 import ( 7 "fmt" 8 "reflect" 9 )10 11 func Us... 阅读全文
posted @ 2015-01-07 14:26 yumuxu 阅读(444) 评论(0) 推荐(0) 编辑
摘要: os.uname()Returns information identifying the current operating system. The return value is an object with five attributes:sysname- operating system n... 阅读全文
posted @ 2015-01-02 18:46 yumuxu 阅读(1182) 评论(0) 推荐(0) 编辑
摘要: strconv 包括 四 类函数1.Append 类,例如 AppendBool(dst []byte, b bool)[]byte,将值转化后添加到[]byte的末尾2.Format 类,例如FormatBool(b bool) string,将bool float int uint 类型的转换为... 阅读全文
posted @ 2014-11-07 17:46 yumuxu 阅读(1402) 评论(0) 推荐(0) 编辑
摘要: 1 package main 2 3 import ( 4 "fmt" 5 "strconv" 6 "time" 7 ) 8 9 const LOOP = 10000010 11 var num int64 = 1012 13 func main() {14 s... 阅读全文
posted @ 2014-11-05 20:15 yumuxu 阅读(1848) 评论(0) 推荐(0) 编辑
摘要: 1 //autoInc.go 2 3 package autoInc 4 5 type AutoInc struct { 6 start, step int 7 queue chan int 8 running bool 9 }10 11 func ... 阅读全文
posted @ 2014-10-31 10:32 yumuxu 阅读(688) 评论(0) 推荐(0) 编辑
摘要: package mainimport ( "fmt" "io/ioutil" "os" "reflect" "time")func main() { dir, _ := os.Getwd() fmt.Println("dir:", dir) err :... 阅读全文
posted @ 2014-10-30 15:15 yumuxu 阅读(1182) 评论(0) 推荐(0) 编辑