
python
lian751137250
这个作者很懒,什么都没留下…
展开
-
Python 中json 数据处理
# 引入json包名import json# json格式的数据,在Python中jsonObj对应dict,jsonArray 对应Listg_data = { 'name': 'pengjunlee', 'age': 32, 'vip': True, 'address': {'province': 'GuangDong', 'city': 'ShenZhen'}}# load 将文件中的json数据转换成Python的数据格式def test_load.原创 2022-04-10 16:31:39 · 1506 阅读 · 0 评论 -
python 连接数据库
# Student.py #定义学生类class Student: def __init__(self,name,email,age): self.name = name self.email = email self.age = age def __str__(self): return "Student:%s,%s,%s"%(self.name,self.email,self.age)#sql_test.py.原创 2020-09-11 11:11:27 · 171 阅读 · 0 评论 -
pygame贪吃蛇
import pygamefrom sys import exitimport random#点定义class Point: row = 0 col = 0 def __init__(self,row,col): self.row = row self.col = col def copy(self): return Point(self.row,self.col) def __str__(self):.原创 2020-09-03 16:18:05 · 187 阅读 · 0 评论