随笔分类 -  python

Python多线程
摘要:单线程 from time import ctime,sleepdef music(): for i in range(2): print "I was listening to music. %s" %ctime() sleep(1)def move(): ... 阅读全文

posted @ 2015-03-11 14:52 凉皮子 阅读(188) 评论(0) 推荐(0)

Python执行Linux系统命令的4种方法
摘要:(1) os.system仅仅在一个子终端运行系统命令,而不能获取命令执行后的返回信息代码如下:system(command) -> exit_statusExecute the command (a string) in a subshell.如果在命令行下执行,结果直接打印出来代码如下:>>> ... 阅读全文

posted @ 2015-01-25 21:03 凉皮子 阅读(8299) 评论(0) 推荐(0)

不能在注册表中识别出来python时的解决方法
摘要:新建一个register.py 文件,把以下代码贴进去,保存(G盘)## script to register Python 2.0 or later for use with win32all# and other extensions that require Python registry s... 阅读全文

posted @ 2014-12-01 16:54 凉皮子 阅读(472) 评论(0) 推荐(0)

Biopython - sequences and alphabets
摘要:The Sequence objectSome examples will also require a working internet connection in order to run.>>> from Bio.Seq import Seq>>> from Bio.Alphabet impo... 阅读全文

posted @ 2014-11-24 20:45 凉皮子 阅读(408) 评论(0) 推荐(0)

Biopython - basics
摘要:IntroductionFrom the biopython website their goal is to “make it as easy as possible to use Python for bioinformatics by creating high-quality, reusab... 阅读全文

posted @ 2014-11-24 20:42 凉皮子 阅读(234) 评论(0) 推荐(0)

class
摘要:http://blog.csdn.net/wklken/article/details/6313265http://www.cnblogs.com/longdouhzt/archive/2012/05/16/2505141.htmlhttp://www.jb51.net/article/51108.... 阅读全文

posted @ 2014-08-26 20:52 凉皮子 阅读(142) 评论(0) 推荐(0)

正则表达式
摘要:1.1简介1.2. 数量词的贪婪模式与非贪婪模式正则表达式通常用于在文本中查找匹配的字符串。Python里数量词默认是贪婪的(在少数语言里也可能是默认非贪婪),总是尝试匹配尽可能多的字符;非贪婪的则相反,总是尝试匹配尽可能少的字符。例如:正则表达式"ab*"如果用于查找"abbbc",将找到"abb... 阅读全文

posted @ 2014-08-25 11:15 凉皮子 阅读(132) 评论(0) 推荐(0)

module
摘要:定义:模块可把一个复杂的程序按功能分开,分别存放到不同的文件中,是程序更容易维护和管理。在python中的模块是一个以.py结尾的python代码文件。模块的使用:可通过import命令输入,import os或import os,sysimport会完成以下三个操作:创建新的名称空间,该名称空间中... 阅读全文

posted @ 2014-08-24 21:53 凉皮子 阅读(363) 评论(0) 推荐(0)

os.path模块
摘要:os.path.abspath(path) #返回绝对路径os.path.basename(path) #返回文件名os.path.commonprefix(list) #返回list(多个路径)中,所有path共有的最长的路径。os.path.dirname(path) #返回文件路径os.pat... 阅读全文

posted @ 2014-08-20 10:32 凉皮子 阅读(169) 评论(0) 推荐(0)

python对文件的处理
摘要:文件对象的访问模式:r 以读方式打开rU 以读方式打开,同时提供通用换行符支持w 以写方式打开a 以追加模式打开 (从 EOF 开始, 必要时创建新文件)r+ 以读写模式打开w+ 以读写模式打开 (参见 w )a+ 以读写模式打开 (参见 a )rb 以二进制读模式打开wb 以二进制写模式打开 (参... 阅读全文

posted @ 2014-08-19 16:30 凉皮子 阅读(433) 评论(0) 推荐(0)