首页 > 其他分享 >5.26每日总结

5.26每日总结

时间:2023-05-26 22:13:01浏览次数:36  
标签:总结 count plt color 每日 5.26 year print select

<%@ page import="san.Thesql" %>
<%@ page import="san.Pd_stu" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"

         pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
  <title>信息查询</title>
  <style type="text/css">
    html,body{
      width: 99%;
      height: 99%;
    }
    h1 {
      color: #333;
      text-align: center;
      margin-top: 50px;
    }

    table {
      margin-top: 20px;
      border-collapse: collapse;
      box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
      background-color: #fff;
    }

    th, td {
      padding: 20px;
      text-align: center;
      border: 1px solid #ddd;
      font-size: 17px;
    }

    th {
      background-color: #8b8989;
      color: #fff;
      font-size: 24px;
    }

    tr:nth-child(even) {
      background-color: #f2f2f2;
    }
    input{
      border: none;
      border-radius: 10px;
      height: 27px;
    }
    .submit{
      background-color: rgb( 21, 218, 218);
      color: aliceblue;
      height: 50px;
      width: 60%;
    }
    .submit:active{
      background-color: rgb(166, 172, 175);
    }
    a{
      text-decoration: none;
      font-size: 20px;
      color: #3bc9e2;
    }
    .content {
      height: calc(95% - 0px);
      overflow-y: scroll;
    }
  </style>
</head>
<%
  Thesql thesql=new Thesql();
  Pd_stu pdStu[] = thesql.show_stu();
  int student_num = pdStu.length;
%>
<body>
<div align="center"><h1>学生联系方式</h1></div>
<div align="center"><a href="add.jsp">添加学生</a></div>
 <table width="90%" align="center">
    <tr>
      <th height="25%" width="25%">工号</th>
      <th width="25%">姓名</th>
      <th width="25%">手机号码</th>
      <th width="25%">管理</th>
    </tr>
    <tr><td colspan="5">
      <div class="content">
        <table border="1" style="font-size:18px;width: 100%;height: 100% ;margin-top: 0px">
          <%for(int i=0;i<student_num;i++){%>
          <tr>
            <td height="10%" width="25%"><%=pdStu[i].id%></td>
            <td width="25%"><%=pdStu[i].name%></td>
            <td width="25%"><%=pdStu[i].phone%></td>
            <td width="25%" align="center"><a href="person_information.jsp?id_=<%=pdStu[i].id%>" style="margin-right: 20%">查看</a>
              <a href="#">删除</a></td>
          </tr>
          <%} %>
        </table>
      </div>
    </td></tr>


  </table>
<script type="text/javascript">
</script>
</body>
</html>
import requests
from bs4 import BeautifulSoup as bs
import pandas as pd
from matplotlib import pyplot as plt

def get_rank(url):
    count = 0
    rank = []
    headers = {
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36 Edg/101.0.1210.3"
    }
    resp = requests.get(url, headers=headers).content.decode()
    soup = bs(resp, "lxml")
    univname = soup.find_all('a', class_="name-cn")
    for i in univname:
        if count != 10:
            university = i.text.replace(" ", "")
            score = soup.select("#content-box > div.rk-table-box > table > tbody > tr:nth-child({}) > td:nth-child(5)"
                                .format(count + 1))[0].text.strip()
            rank.append([university, score])
        else:
            break
        count += 1
    return rank


total = []
u_year = 2018
for i in range(18, 22):
    url = "https://www.shanghairanking.cn/rankings/bcur/20{}11".format(i)
    print(url)
    title = ['学校名称', '总分']
    df = pd.DataFrame(get_rank(url), columns=title)
    total.append(df)
for i in total:
    plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签
    x = list(i["学校名称"])[::-1]
    y = list(i["总分"])[::-1]
    # 1.创建画布
    plt.figure(figsize=(20, 8), dpi=100)
    # 2.绘制图像
    plt.plot(x, y, label="大学排名")
    # 2.2 添加网格显示
    plt.grid(True, linestyle="--", alpha=0.5)
    # 2.3 添加描述信息
    plt.xlabel("大学名称")
    plt.ylabel("总分")
    plt.title(str(u_year) + "年软科中国最好大学排名Top10", fontsize=20)
    # 2.5 添加图例
    plt.legend(loc="best")
    # 3.图像显示
    plt.savefig(str(u_year)+".png")
    plt.show()

    u_year += 1

while True:
    info = input("请输入要查询的大学名称和年份:")
    count = 0
    university, year = info.split()
    year = int(year)
    judge = 2022 - year
    tmp = total[::-1]
    if 4 >= judge >= 0:
        name = list(total[judge - 1]["学校名称"])
        for j in name:
            if university == j:
                print(university + "在{0}年排名第{1}".format(year, count + 1))
                break
            count += 1
        if count ==10:
            print("很抱歉,没有该学校的排名记录!!!")
            print("请选择以下选项:")
            print("   1.继续查询")
            print("   2.结束查询")
            select = int(input(""))

            if select == 1:
                continue
            elif select == 2:
                break
        else:
            break
    else:
        print("很抱歉,没有该年份的排名记录!!!")
        print("请选择以下选项:")
        print("   1.继续查询")
        print("   2.结束查询")
        select = int(input(""))

        if select == 1:
            continue
        elif select == 2:
            break

 

标签:总结,count,plt,color,每日,5.26,year,print,select
From: https://www.cnblogs.com/louwangshayu/p/17435926.html

相关文章

  • 今日总结
    今日报告代码时间:0h代码行数:0行发表的博客:0篇今天上午上了一上午的课,下午手写了三千字的社会实践报告,之后一直复习数据库,下周三就要数据考试下周一软工考试下周五web考试下周六数据库考试......
  • 5.26总结
    packagecom.itheima.test;//测试用例importcom.itheima.mapper.BrandMapper;importcom.itheima.pojo.Brand;importorg.apache.ibatis.io.Resources;importorg.apache.ibatis.session.SqlSession;importorg.apache.ibatis.session.SqlSessionFactory;importorg.apach......
  • 每日打卡
    回文素数问题描述:回文素数是数字以中间一个数或两个数成对称的素数,求1000以内的回文素数问题分析:先用倒序数的方法判断是否为素数,再穷举出其中的回文数代码:#include<stdio.h>#include<math.h>intfun(intn);intmain(){           inti,j,k,l,m;     ......
  • 5.26 C++文件读写操作
    程序运行时产生的数据都属于临时数据,程序—旦运行结束都会被释放通过文件可以将数据持久化C++中对文件操作需要包含头文件<fstream>文件类型分为两种:1.文本文件:文件以文本的ASCII码形式存储在计算机中2.二进制文件:文件以文本的二进制形式存储在计算机中操作文件的三大类:ofst......
  • 每日打卡一小时(第三十五天)
    一.问题描述设计一个void类型的函数reverse_string,其功能是将一个给定的字符串逆序。例如,给定字符串为“hello”,逆序后为“olleh”。二.设计思路注意字符串的结束标志二.代码实现#include<iostream>#include<string>usingnamespacestd;voidreverse_string(string&a......
  • 2023.5.26每日总结
    packageservlets;importjava.io.IOException;importjava.util.ArrayList;importjavax.servlet.ServletException;importjavax.servlet.annotation.WebServlet;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjava......
  • 2023.5.26——软件工程日报
    所花时间(包括上课):6h代码量(行):0行博客量(篇):1篇今天,上午学习,下午学习。我了解到的知识点:1.了解了一些数据库的知识;2.了解了一些python的知识;3.了解了一些英语知识;5.了解了一些Javaweb的知识;4.了解了一些数学建模的知识;6.了解了一些计算机网络的知识;......
  • 2023.5.26——软件工程站立会议(阶段二)
    站立会议内容:1.整个项目预期的任务量:目前已经花的时间:剩余的时间:2.任务看板照片: 3.团队照片: 4.产品状态:最新做好的功能:正在完成中5.燃尽图:......
  • 5.26打卡
    #include<bits/stdc++.h>usingnamespacestd;classExamInfo{public:ExamInfo(stringname,chargrade):name(name),mode(GRADE),grade(grade){}ExamInfo(stringname,boolpass):name(name),mode(PASS),pass(pass){}ExamInfo(strin......
  • 每日打卡-32
    一.问题描述平衡字符串中,'L'和'R'字符的数量是相同的。给你一个平衡字符串s,请你将它分割成尽可能多的子字符串,并满足:每个子字符串都是平衡字符串。返回可以通过分割得到的平衡字符串的最大数量。二.设计思路这道题要求尽可能多的切割平衡字符串我们通过观察例题以及......