摘要:
(参考python CookBook)直接上代码:#-*-coding:utf-8-*-'''简短地生成随机密码,包括大小写字母、数字,可以指定密码长度'''#生成随机密码fromrandomimportchoiceimportstring#python3中为string.ascii_letters,而python2下则可以使用string.letters和string.ascii_lettersdefGenPassword(length=8,chars=string.ascii_letters+string.digits):return' 阅读全文
posted @ 2012-12-03 19:57
garfieldtom
阅读(9971)
评论(0)
推荐(0)
摘要:
简单记录一下,git讲解很多,这里记录一下大体步骤。 1.首先在github.com上申请一个空间,然后在本机建立一个目录:mkdir gittest2.在该目录中建立一个文件:touch README.md3.初始化版本库 git init 4.增加文件到版本库 git add README.md 5.提交更改 git commit -m "first commit" 6.增加远程库 git remote add origin https://github.com/garfieldtom/python.git 7.提交到远程库 (增加到远程库完毕后以后有更改直接执行提交到 阅读全文
posted @ 2012-12-03 19:30
garfieldtom
阅读(332)
评论(1)
推荐(0)
摘要:
如果想查看某个模块提供了哪些函数等,我们可以进入python控制台,然后导入模块,再使用help(模块名)来查看这个模块的功能有哪些。以string模块为例:>>>importstring>>>help(string)Helponmodulestring:NAMEstring-Acollectionofstringoperations(mostarenolongerused).FILE/usr/lib/python2.7/string.pyMODULEDOCShttp://docs.python.org/library/stringDESCRIPTIONWa 阅读全文
posted @ 2012-12-03 17:01
garfieldtom
阅读(59346)
评论(2)
推荐(3)
浙公网安备 33010602011771号