2013年9月7日

文件处理

摘要: open('filename')file('filename','mode')mode:a,w,r,a+,w+,r+methods:readline(),readlines()write('')seek(n)truncate(n) 阅读全文

posted @ 2013-09-07 18:00 ukouryou 阅读(67) 评论(0) 推荐(0) 编辑

Python 数据结构

摘要: split(),join()函数Listcount(''),index('')append(''),insert(index,item),extend('')remove(''),pop(index),pop()sort()if item in List: print itemtuplecount(''),index('')del tupleDictionaryPhone = {'alex':'135','ch':'136 阅读全文

posted @ 2013-09-07 17:19 ukouryou 阅读(151) 评论(0) 推荐(0) 编辑

python 控制语句

摘要: 1 for i in range(1,10,2): 2 print 'my number is ', i 3 if i == 5: 4 print 'got it!' 5 break 6 else: 7 print 'class is dismiss' 8 9 10 while True:11 input = int(raw_input('input code:'))12 if input == 5:13 print 'success'14 elif input == 0:15 ... 阅读全文

posted @ 2013-09-07 10:18 ukouryou 阅读(110) 评论(0) 推荐(0) 编辑

导航