python
lian751137250
这个作者很懒,什么都没留下…
展开
-
Python 中json 数据处理
# 引入json包名 import json # json格式的数据,在Python中jsonObj对应dict,jsonArray 对应List g_data = { 'name': 'pengjunlee', 'age': 32, 'vip': True, 'address': {'province': 'GuangDong', 'city': 'ShenZhen'} } # load 将文件中的json数据转换成Python的数据格式 def test_load.原创 2022-04-10 16:31:39 · 1433 阅读 · 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 · 147 阅读 · 0 评论 -
pygame贪吃蛇
import pygame from sys import exit import 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 · 156 阅读 · 0 评论