zoukankan      html  css  js  c++  java
  • Python学习【三】

    #coding=utf-8
    #import linecache;
    #data_keys = ('bid', 'uid', 'username', 'v_class', 'content', 'img', 'created_at', 'source', 'rt_num', 'cm_num', 'rt_uid', 'rt_username', 'rt_v_class', 'rt_content', 'rt_img', 'src_rt_num', 'src_cm_num', 'gender', 'rt_bid', 'location', 'rt_mid', 'mid', 'lat', 'lon', 'lbs_type', 'lbs_title', 'poiid', 'links', 'hashtags', 'ats', 'rt_links', 'rt_hashtags', 'rt_ats', 'v_url', 'rt_v_url')
    #keys = {data_keys[k]:k for k in xrange(0,len(data_keys))}
    # keys={};
    # for k in xrange(0,len(data_keys)):
    # 	keys[data_keys[k]]=k;
    # f=linecache.getlines("t.txt");
    
    # data_lists=[];
    # for item in f:
    # 	lines = item.split(",");
    # 	tmp={"bid":lines[keys['bid']],
    # 		 "uid":lines[keys['uid']],
    # 		 "username":lines[keys['username']],
    # 		 "created_at": lines[keys['created_at']]
    # 		 };
    # 	data_lists.append(tmp);
    #print data_lists;
    
    #输出有多少个用户
    # num=set( item["username"] for item in data_lists);
    #print len(num);
    #用户名list
    # name_lists=[];
    # for item in data_lists:
    # 	name_lists.append(item['username']);
    #================================================================
    #取出是2012-11的时间有多少
    # data_lists=[];
    # keys = {data_keys[k]:k for k in xrange(0,len(data_keys))}
    # f = linecache.getlines("./t.txt");
    
    # for lines in f:
    # 	line = lines.split(",")[6].replace('"','');
    # 	if len(line) > 0 :
    # 		bol = line.startswith("2012-11");
    # 		if bol == True:
    # 			data_lists.append(line);
    # print data_lists;
    # #================================================================
    # keys = {data_keys[k]:k for k in xrange(0,len(data_keys))}
    # f = linecache.getlines("./t.txt");
    # times=[];
    # for lines in f:
    # 	line = lines.split(",")[6].replace('"','');
    # 	if len(line) >0 and line.startswith("2012"):
    # 		times.append(line.split(" ")[0]);
    
    # news_list = list(set(times));
    # print len(news_list);
    # #================================================================
    

      

  • 相关阅读:
    How to extract msu/msp/msi/exe files from the command line
    Windbg and resources leaks in .NET applications 资源汇总
    [c# 20问] 3.String和string的区别
    [c# 20问] 2.如何转换XML文件
    [c# 20问] 1. 何时使用class与struct
    安装配置BITS上传服务
    The J-Link hardware debugging Eclipse plug-in
    swift material
    SCLButton
    ChatCell
  • 原文地址:https://www.cnblogs.com/zh718594493/p/12153627.html
Copyright © 2011-2022 走看看