上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 36 下一页
摘要: https://wenku.baidu.com/view/6d7c7b6e5ef7ba0d4b733b75.html 阅读全文
posted @ 2017-07-04 20:23 banlucainiao 阅读(7) 评论(0) 推荐(0)
摘要: Linux下time命令可以获取到一个程序的执行时间,包括程序的实际运行时间(real time),以及程序运行在用户态的时间(user time)和内核态的时间(sys time)。 它的使用方法和前面讲过的strace类似,在待执行的命令前加上tim... 阅读全文
posted @ 2017-07-03 18:43 banlucainiao 阅读(72) 评论(0) 推荐(0)
摘要: import timedef calculate_time(total_time): ''' total_time: total seconds ''' spend_seconds = total_time % 60 totalm... 阅读全文
posted @ 2017-07-03 17:15 banlucainiao 阅读(29) 评论(0) 推荐(0)
摘要: import osimport shutil#get names of files in the directorydef get_filename(filepath,filetype): import os filename = [] fo... 阅读全文
posted @ 2017-07-03 17:11 banlucainiao 阅读(44) 评论(0) 推荐(0)
摘要: 在用Python对某一目录下的多个文件进行一一处理,会产生相应的多个结果。比如,在目录'/home/jkx/Anaconda_workspace/task_2017_6_6/ 下有100个.txt 文件,现在,用python对这100个文件进行处理,会得到10... 阅读全文
posted @ 2017-07-03 16:54 banlucainiao 阅读(31) 评论(0) 推荐(0)
摘要: 创建目录 在Python中可以使用os.mkdir()函数创建目录(创建一级目录)。 其原型如下所示: os.mkdir(path) 其参数path 为要创建目录的路径。 例如要在D盘下创建hello的目录 >>... 阅读全文
posted @ 2017-07-03 15:47 banlucainiao 阅读(27) 评论(0) 推荐(0)
摘要: def get_filename(filepath,filetype): import os filename = [] for root,dirs,files in os.walk(filepath): for i in fi... 阅读全文
posted @ 2017-07-03 15:39 banlucainiao 阅读(28) 评论(0) 推荐(0)
摘要: 1. 取长度 代码如下:str="abcd"expr length $str # 4echo ${#str} # 4expr "$str" : ".*" # 4 好像一般使用第二种 2. 查找子串的位置 代码如下:str="abc"exp... 阅读全文
posted @ 2017-07-03 15:33 banlucainiao 阅读(32) 评论(0) 推荐(0)
摘要: 命令: str3=”$str1 $str2″ 上面的例子命令将连接str1和str2的值,并将其存储在第三个变量str3中。在赋值(=)运算符前后不应该有任何空格。 例1: 这里只是写两个或多个字符串变量联接在一起。 $ str1="Hello"$ s... 阅读全文
posted @ 2017-07-03 15:18 banlucainiao 阅读(43) 评论(0) 推荐(0)
摘要: 最近需要从多个excel表里面用各种方式整理一些数据,虽然说原来用过java做这类事情,但是由于最近在学python,所以当然就决定用python尝试一下了。发现python果然简洁很多。这里简单记录一下。(由于是用到什么学什么,所以不算太深入,高手勿喷,欢... 阅读全文
posted @ 2017-07-01 17:04 banlucainiao 阅读(29) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 36 下一页