源文件:
股票代码,股票名称,当前价,涨跌额,涨跌幅,年初至今,成交量,成交额,换手率,市盈率(TTM),股息率,市值
SH601778,N晶科,6.29,+1.92,+43.94%,+43.94%,259.66万,1625.52万,0.44%,22.32,-,173.95亿
SH688566,吉贝尔,52.66,+6.96,+15.23%,+122.29%,1626.58万,8.09亿,42.29%,89.34,-,98.44亿
SH688268,华特气体,88.80,+11.72,+15.20%,+102.51%,622.60万,5.13亿,22.87%,150.47,-,106.56亿
SH600734,实达集团,2.60,+0.24,+10.17%,-61.71%,1340.27万,3391.14万,2.58%,亏损,0.00%,16.18亿
SH900957,凌云B股,0.36,+0.033,+10.09%,-35.25%,119.15万,42.10万,0.65%,44.65,0.00%,1.26亿
SZ000584,哈工智能,6.01,+0.55,+10.07%,-4.15%,2610.86万,1.53亿,4.36%,199.33,0.26%,36.86亿
SH600599,熊猫金控,6.78,+0.62,+10.06%,-35.55%,599.64万,3900.23万,3.61%,亏损,0.00%,11.25亿
SH600520,文一科技,8.21,+0.75,+10.05%,-24.05%,552.34万,4464.69万,3.49%,亏损,0.00%,13.01亿
SH603682,锦和商业,11.73,+1.07,+10.04%,+48.29%,2746.63万,3.15亿,29.06%,29.62,-,55.42亿
SZ300831,派瑞股份,12.27,+1.12,+10.04%,+208.29%,25.38万,311.41万,0.32%,60.59,-,39.26亿
SH900939,汇丽B,0.504,+0.046,+10.04%,-23.52%,123.86万,61.86万,1.41%,52.80,0.00%,9147.60万
SH600880,博瑞传播,4.39,+0.40,+10.03%,+10.03%,1117.75万,4816.57万,1.02%,95.87,0.50%,48.00亿
SZ000609,中迪投资,7.68,+0.70,+10.03%,+39.64%,2663.08万,2.00亿,9.12%,58.84,0.00%,22.98亿
SZ300328,宜安科技,15.80,+1.44,+10.03%,+7.19%,432.45万,6832.68万,0.95%,64.80,0.51%,72.72亿
SZ002988,豪美新材,17.33,+1.58,+10.03%,+58.41%,3.50万,60.68万,0.06%,24.42,-,40.34亿
SZ000615,京汉股份,4.61,+0.42,+10.02%,+4.06%,518.09万,2388.41万,0.69%,亏损,0.00%,36.06亿
SZ300443,金雷股份,18.33,+1.67,+10.02%,+32.74%,987.25万,1.75亿,6.19%,18.78,1.08%,43.64亿
SH600506,香梨股份,11.42,+1.04,+10.02%,+11.96%,1039.48万,1.18亿,7.04%,亏损,0.00%,16.87亿
SZ300505,川金诺,15.61,+1.42,+10.01%,-11.26%,493.54万,7555.40万,6.03%,26.70,0.85%,20.40亿
SZ300830,金现代,14.95,+1.36,+10.01%,+239.77%,63.66万,951.76万,0.74%,70.76,0.00%,64.30亿
SH603630,拉芳家化,17.26,+1.57,+10.01%,+27.85%,949.49万,1.60亿,4.19%,209.44,0.83%,39.13亿
SZ002655,共达电声,11.43,+1.04,+10.01%,-14.64%,1683.51万,1.88亿,4.68%,166.69,0.00%,41.15亿
SZ300460,惠伦晶体,16.59,+1.51,+10.01%,+0.97%,430.28万,6974.52万,2.56%,亏损,0.00%,27.92亿
SH603929,亚翔集成,20.33,+1.85,+10.01%,+33.40%,1373.66万,2.76亿,6.44%,84.29,1.25%,43.38亿
SH603392,万泰生物,35.97,+3.27,+10.00%,+311.09%,6.92万,248.91万,0.16%,65.24,-,155.97亿
SZ000788,北大医药,6.82,+0.62,+10.00%,+2.40%,832.44万,5583.87万,1.40%,89.69,0.32%,40.65亿
SH601609,金田铜业,10.89,+0.99,+10.00%,+66.26%,4027.64万,4.28亿,16.64%,32.38,0.32%,158.66亿
SZ000403,双林生物,52.48,+4.77,+10.00%,+62.48%,171.75万,9013.54万,0.63%,88.80,0.23%,143.05亿
SZ300832,新产业,72.80,+6.62,+10.00%,+131.92%,10.73万,780.85万,0.26%,40.20,0.62%,299.64亿
SZ002985,北摩高科,92.58,+8.42,+10.00%,+310.92%,2422.97万,21.55亿,64.54%,60.48,1.08%,139.02亿
SH603348,文灿股份,18.06,+1.64,+9.99%,-25.15%,357.86万,6328.87万,4.39%,89.39,0.89%,41.83亿
SH603900,莱绅通灵,8.92,+0.81,+9.99%,-5.61%,1364.10万,1.15亿,4.01%,43.78,5.06%,30.37亿
SH603042,华脉科技,17.85,+1.62,+9.98%,+17.05%,491.44万,8705.99万,4.86%,128.50,0.31%,24.28亿
SZ300260,新莱应材,19.83,+1.80,+9.98%,+68.48%,1800.45万,3.48亿,14.16%,65.15,0.73%,40.04亿
SZ000557,西部创业,3.42,+0.31,+9.97%,-0.87%,2751.17万,9408.89万,1.89%,79.39,0.00%,49.88亿
SZ300716,国立科技,9.94,+0.90,+9.96%,-4.24%,142.25万,1413.92万,1.50%,亏损,0.29%,15.91亿
SZ002449,国星光电,11.92,+1.08,+9.96%,-6.80%,5185.52万,6.03亿,8.53%,21.51,2.73%,73.72亿
data = {} with open('stock_info', 'r', encoding='gbk') as f: for ID_num, line in enumerate(f): data[ID_num] = line.strip().split(',') index_col = data[0] del data[0] # print(data) # print(index_col) while True: count = 0 choice = input('股票查询接口〉〉:').strip() if choice == '': print('输入的信息有误,请重新输入') continue elif choice.isalpha(): print(index_col) for i in range(1, len(data) + 1): if choice in data[i][1]: print(data[i]) count += 1 print('找到%s条' % count) else: choice = choice.split() target = index_col.index(choice[0]) print(index_col) for i in range(1, len(data) + 1): if choice[2] != '亏损': if choice[2].endswith('%') or choice[2].endswith('亿') or choice[2].endswith('万'): while True: if data[i][target][-1] == choice[2][-1]: if eval(data[i][target][:-1] + choice[1] + choice[2][:-1]): print(data[i]) count += 1 break else: break elif choice[2][-1] == '亿': choice[2] = str(eval(choice[2][:-1]) * 10000) + '万' elif choice[2][-1] == '万': choice[2] = str(eval(choice[2][:-1]) / 10000) + '亿' elif data[i][target] == '-': data[i][target] = '0%' else: if data[i][target] != '亏损': if eval(data[i][target] + choice[1] + choice[2]): print(data[i]) count += 1 else: if data[i][target] == '亏损': print(data[i]) count += 1 print('找到%s条' % count)
股票查询接口〉〉:市盈率(TTM) = 亏损 ['股票代码', '股票名称', '当前价', '涨跌额', '涨跌幅', '年初至今', '成交量', '成交额', '换手率', '市盈率(TTM)', '股息率', '市值'] ['SH600734', '实达集团', '2.60', '+0.24', '+10.17%', '-61.71%', '1340.27万', '3391.14万', '2.58%', '亏损', '0.00%', '16.18亿'] ['SH600599', '熊猫金控', '6.78', '+0.62', '+10.06%', '-35.55%', '599.64万', '3900.23万', '3.61%', '亏损', '0.00%', '11.25亿'] ['SH600520', '文一科技', '8.21', '+0.75', '+10.05%', '-24.05%', '552.34万', '4464.69万', '3.49%', '亏损', '0.00%', '13.01亿'] ['SZ000615', '京汉股份', '4.61', '+0.42', '+10.02%', '+4.06%', '518.09万', '2388.41万', '0.69%', '亏损', '0.00%', '36.06亿'] ['SH600506', '香梨股份', '11.42', '+1.04', '+10.02%', '+11.96%', '1039.48万', '1.18亿', '7.04%', '亏损', '0.00%', '16.87亿'] ['SZ300460', '惠伦晶体', '16.59', '+1.51', '+10.01%', '+0.97%', '430.28万', '6974.52万', '2.56%', '亏损', '0.00%', '27.92亿'] ['SZ300716', '国立科技', '9.94', '+0.90', '+9.96%', '-4.24%', '142.25万', '1413.92万', '1.50%', '亏损', '0.29%', '15.91亿'] 找到7条
股票查询接口〉〉:市值 < 10亿 ['股票代码', '股票名称', '当前价', '涨跌额', '涨跌幅', '年初至今', '成交量', '成交额', '换手率', '市盈率(TTM)', '股息率', '市值'] ['SH900957', '凌云B股', '0.36', '+0.033', '+10.09%', '-35.25%', '119.15万', '42.10万', '0.65%', '44.65', '0.00%', '1.26亿'] ['SH900939', '汇丽B', '0.504', '+0.046', '+10.04%', '-23.52%', '123.86万', '61.86万', '1.41%', '52.80', '0.00%', '9147.60万'] 找到2条