五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

黑馬程序員python教程,8天python從入門到精通,學(xué)python看這套就

2023-06-18 19:26 作者:JayJu  | 我要投稿

P124

import json


class dataInfo:

??def __init__(self, data: str, id: str, money: str, province: str) -> None:

????self.date: str = data

????self.id: str = id

????try:

??????self.money: int = int(money)

????except Exception:

??????print("Error:Money isn't number!")

????self.province: str = province


class data:

??path: str = None

??__list:list[dataInfo] = []


??def __init__(self, path: str) -> None:

????self.path = path


??def ReadCsv(self) -> None:

????'''Csv格式的數(shù)據(jù)讀取'''

????with open(self.path, "r", encoding="utf-8") as f:

??????for x in f.readlines():

????????# 單行數(shù)據(jù)整理,去除\n

????????temp = x.strip()

????????# 數(shù)據(jù)拆分

????????temp = temp.split(",")

????????self.__list.append(dataInfo(temp[0], temp[1], temp[2], temp[3])

????????)


??def ReadJson(self) -> None:

????'''Json格式的數(shù)據(jù)讀取'''

????with open(self.path, "r", encoding="utf-8") as f:

??????for x in json.loads(f.read()):

????????self.__list.append(

??????????dataInfo(x['date'], x['order id'], x['money'], x['province'])

????????)


??def Get(self) -> list[dataInfo]:

????'''獲得數(shù)據(jù)列表'''

????return self.__list

黑馬程序員python教程,8天python從入門到精通,學(xué)python看這套就的評論 (共 條)

分享到微博請遵守國家法律
广南县| 开平市| 尼木县| 鹿泉市| 华池县| 阳东县| 县级市| 平陆县| 芜湖市| 乌苏市| 岫岩| 台北县| 临猗县| 高阳县| 白山市| 开原市| 商都县| 秦皇岛市| 舒兰市| 故城县| 台北县| 平远县| 安远县| 亳州市| 津南区| 盐源县| 枝江市| 长岭县| 皋兰县| 沙坪坝区| 富川| 南华县| 衡阳县| 长汀县| 且末县| 太康县| 东丽区| 临武县| 大石桥市| 德昌县| 华坪县|