国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(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看這套就的評論 (共 條)

分享到微博請遵守國家法律
忻州市| 兴国县| 精河县| 尼勒克县| 彰化县| 从化市| 林芝县| 瓮安县| 漳州市| 叙永县| 临汾市| 石屏县| 通州市| 罗城| 大冶市| 六安市| 白水县| 新余市| 合作市| 营山县| 长岛县| 韶山市| 青海省| 枣强县| 兰溪市| 武威市| 浑源县| 靖边县| 通榆县| 剑河县| 金坛市| 濉溪县| 泗洪县| 宁国市| 景谷| 固安县| 江孜县| 平江县| 苍溪县| 桐城市| 申扎县|