09 2015 档案
摘要:直接上代码:#encode:u8import res1 = 'adkkdk'#判断s1字符串是否负责都为小写的正则an = re.search('^[a-z]+$', s1)if an: print 'yes'else: print 'no'
阅读全文
摘要:直接上代码:colours = ["red","green","blue"]for colour in colours: print colour# red# green# blue第二种方法colours = ["red","green","blue"]for i in range(0, l...
阅读全文
摘要:直接上代码my @array = ( 'a', 'b', 'c', 'a', 'd', 1, 2, 5, 1, 5 ); my %count; my @uniq_times = grep { ++$count{ $_ } < 2; } @array;
阅读全文
摘要:直接看代码吧#获取文件path路径中文件名(去掉目录路径)sub get_file_basename{ my ($file_path) = @_; my @tmp_arr = split(/[\\|\/]+/,$file_path); my $len = @tmp_arr; if ($len >=2...
阅读全文