import pandas as pd
date ={"date":["2023-01-01","2023-03-01","2023-02-01","2023-06-01","2023-04-01","2023-05-01"]}
df = pd.DataFrame(date)
df["date"]= pd.to_datetime(df["date"])
df = df.sort_values("date", ascending=False)
from datetime import datetime
# 输入数据
date ={"data":["2023-01-01","2023-03-01","2023-02-01","2023-06-01","2023-04-01","2023-05-01"]}# 将字符串列表转换为datetime对象列表
datetime_list =[datetime.strptime(d,'%Y-%m-%d')for d in date['data']]# 按照日期降序排序
datetime_list.sort(reverse=True)# 输出排序后的datetime对象for dt in datetime_list:print(dt.strftime('%Y-%m-%d'))
需要安装PyPDF2库,具体原代码如下:
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 29 14:44:20 2024author: YBK
"""import PyPDF2
import os
import tkinter as tk
import windndpdf_files []
def dragged_files(f…