标签:android style blog http io ar color os 使用
其实也没有什么可以写的,或者说完全没有价值。因为你只要动一动手指就可以在Google上找到我要写的这些东西。只是我还不习惯好久没有碰我的blog,但是我又不想写没有价值的东西。或许有价值,只是在我一年两不编程的情况下,我会忘记那些我以前很熟悉的操作是怎么完成的,或许混到那个地步我的人生就开始悲剧了吧。总之,成长成我想要的样子我还是需要很长的路要走。
这一篇是会持续更新的,至少为了保证它看起来不那么水,也要让它持续更新
所有的进制转换为10进制都可以归结为下面这条语句:
int(‘需要转换的数字’,原先的进制)
e.g.
#2进制转换为10进制
>>> int(‘1001‘,2)
9
>>> int(‘1010‘,2)
10
#8进制转换为10进制
>>> int("12",8)
10
#16进制转换为10进制
>>> int("fa",16)
250
>>> int("0xab",16)
171
#10进制转换为2进制
>>> bin(10)
‘0b1010‘
#10进制转换为8进制
>>> oct(8)
‘010‘
#10进制转换为16进制
>>> hex(255)
‘0xff‘
#2进制到16进制之间的转换
>>> hex(0b1001)
‘0x9‘
使用os.getcwd()
>>> import os >>> path=os.getcwd() >>> path 'D:\\Python27'
使用os.chdir(‘需要跳转的路径‘)
import os os.chdir('F:/') os.getcwd() 'F:\\'
os.makedirs("path")
比如说在你的F:盘下面有一个python的文件夹,你在里面穿件一个test的文件夹可以如下编写:
>>> os.makedirs("test") >>> os.chdir("test") >>> os.getcwd() 'F:\\python\\test' >>> os.listdir(".") []
os.listdir("F:/") ['$RECYCLE.BIN', '360Downloads', '7\xd4\xc2\xbf\xce\xb3\xcc', 'Android', 'Androidtool', 'baidu download', 'baidu player', 'Cygwin64', 'Downloads', 'eclipse', 'eclipse-java-juno-SR2-win32-x86_64.zip', 'FFOutput', 'GouWoGames', 'kankan', 'KuGouCache', 'KwDownload', 'LatexWS', 'Media', 'ProgramData', 'python', 'QQMusicCache', 'readelf', 'root', 'System Volume Information', 'VSPath', 'WekaData', 'WOJ', 'workspace', 'YY', '\xbc\xd3\xb9\xcc\xd3\xa6\xd3\xc32', '\xd5\xd5\xc6\xac', '\xc8\xed\xbc\xfe\xb0\xb2\xd7\xb0\xb0\xfc', '\xd1\xb8\xc0\xd7\xcf\xc2\xd4\xd8', '\xcf\xe3\xb8\xdb\xc9\xea\xc7\xeb']
>>> os.getcwd() 'F:\\python' >>> os.listdir(".") ['.metadata', '.project', '.pydevproject', '123', '123.py', 'addfields.py', 'addfileds.py', 'addtest.py', 'databasekeywordsabstract', 'digits', 'digits.zip', 'ex1.py', 'ex2.py', 'ex3.py', 'ex4.py', 'ex5.py', 'ex6.py', 'ex7.py', 'ex7.pyc', 'ex8.py', 'ex9.py', 'ez_setup.py', 'getPath', 'getPath.py', 'keywords.py', 'KNN.py', 'KNN.pyc', 'kNNtest.py', 'new 1.py', 'new.py', 'privacyKeys.py', 'privacyKeys1.py', 'privacyPolicyKeywords1.py', 'PrivacyPolicyTest.py', 'text.txt']
#创建前 >>> os.getcwd() 'F:\\python\\test' >>> os.listdir(".") [] #创建后 >>> file1=open("test1.txt",'w+') >>> os.listdir(".") ['test1.txt']
>>> file1.write("abcdd") >>> file1.write("hello,world") >>> file1.close()
>>> a,b=os.path.split("F:\\python\\test\\test1.txt") >>> a 'F:\\python\\test' >>> b 'test1.txt' >>>
>>> portion=os.path.split("F:\\python\\test\\test1.txt") >>> portion[0] 'F:\\python\\test' >>> portion[1] 'test1.txt'
>>> portion=os.path.splitext("F:\\python\\test\\test1.txt") >>> portion[0] 'F:\\python\\test\\test1' >>> portion[1] '.txt'
import os files = os.listdir(".") for filename in files: portion = os.path.splitext(filename) if portion[1]==".apk": newname = portion[0] + ".zip" os.rename(filename,newname)
一写就是2个半小时,或许我真的该写点有价值的东西,时间该用来做更有价值的事情吧~我又不会睡觉了
hey,how is going?
winter is coming. you know what, I miss you.I really miss you, I really miss you so much
maybe this is the most warm winter I have experienced.
The temperature is really wonderful,not too cold, just like that night you said , "hey, let‘s go home"
I think my brain must be damage at that time. Why I responded, oh, I wanted to read some book ?
You know, the KW will be moved before the Christmas, I really miss there. Because of you.
Maybe you never how noisy you are. You always kick the keyboard loudly and quickly. Everytime it
just made me crazy, I always think why you always want to show off your excellent typing skill??
It‘s really very noisy!!haha~ hope every is ok in the other side of the huge earth. maybe you holiday is coming,enjoy it
I miss you, byebye 2014
标签:android style blog http io ar color os 使用
原文地址:http://blog.csdn.net/chichoxian/article/details/41922075