上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页
摘要: Vamie前辈的博客:http://www.cnblogs.com/vamei/archive/2012/07/08/2581264.html#!/usr/bin/pythondef f(a,b,c): #位置传递 return a+b+c #在调用f时,1,2,3根据位置分别传递给了a,b,... 阅读全文
posted @ 2015-09-22 00:51 笑面浮屠 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Vamie前辈博客地址:http://www.cnblogs.com/vamei/archive/2012/07/03/2574436.html#!/usr/bin/python'''我们之前看到了函数和对象。从本质上来说,它们都是为了更好的组织已经有的程序,以方便重复利用。模块(module)也是... 阅读全文
posted @ 2015-09-22 00:05 笑面浮屠 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Vamie前辈的博客:http://www.cnblogs.com/vamei/archive/2012/07/03/2574436.html#!/usr/bin/pythonf = open('Summary.csv', 'r+');#"r" 只读, "r+" 读写#"w" 写入, "w+" 写读... 阅读全文
posted @ 2015-09-21 23:36 笑面浮屠 阅读(182) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/perl -wuse strict;#use autodie;#use File::HomeDir; #第三方模块,不管在什么操作系统上都能进入指定用户的主目录my $parentDir = 'F:\web\perl\perl program\littleCamp';my $p... 阅读全文
posted @ 2015-09-21 02:35 笑面浮屠 阅读(258) 评论(0) 推荐(0) 编辑
摘要: =pod第十七章 高级perl技巧切片: my (undef, $card_num, undef, undef, undef, $count) = split /:/; 定义undef的话,会默认忽略匹配的变量 更好的方法: 列表切片 my $mtime = (stat $some_file)... 阅读全文
posted @ 2015-09-21 02:11 笑面浮屠 阅读(271) 评论(0) 推荐(0) 编辑
摘要: =pod第十六章 进程管理身为程序员最棒的一面,就是能运行别人的程序,不必自己动手去写。在perl里有一句话叫 “办法不止一种”system函数: 在perl中,启动子进程最简单的方法是用system函数,例如从perl调用Unix的date命令,需要告诉system要运行的外部程序的名字: ... 阅读全文
posted @ 2015-09-21 02:08 笑面浮屠 阅读(260) 评论(0) 推荐(0) 编辑
摘要: =pod第十五章 智能匹配与given-when结构智能匹配操作符:~~ use 5.010001; say "I found Fred in the same" if $name ~~ /Fred/; 找出哈希表中是否包含“Fred” use 5.010001; say "I found a ke... 阅读全文
posted @ 2015-09-21 02:06 笑面浮屠 阅读(284) 评论(0) 推荐(0) 编辑
摘要: =pod第十四章 字符串与排序用index查找子字符串: my $where = index($big, $small); eg:my $stuff = "Howdy world"; my $where = index($stuff, "wor"); #$where = 6 index函数还能... 阅读全文
posted @ 2015-09-21 02:04 笑面浮屠 阅读(241) 评论(0) 推荐(0) 编辑
摘要: =pod第十三章 目录操作 在目录树中移动: 程序运行时会以自己的工作目录作为相对路径的起点,也就是说,当我们提及fred这个文件时,其实指的是"当前工作目录下的fred" chdir '/etc' or die "Cannot chdir to /etc: $!"; 如果掉... 阅读全文
posted @ 2015-09-21 02:01 笑面浮屠 阅读(321) 评论(0) 推荐(0) 编辑
摘要: =pod第十二章 文件测试 文件测试操作符: -e:判断文件是否存在 在创建新文件程序之前,应先检查指定的文件是否已经存在,以免意外覆盖重要的电子表格或是宝贵的生日档案。要达到此目的,我们可以用-e文件测试操作符来测试文件是否存在: die "Oops ! A fil... 阅读全文
posted @ 2015-09-21 01:58 笑面浮屠 阅读(134) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页