![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
Crystal_qwq
这个作者很懒,什么都没留下…
展开
-
AttributeError: module ‘re‘ has no attribute ‘s‘
python报错AttributeError: module ‘re‘ has no attribute ‘s‘原因是‘s’需要大写‘S’......原创 2022-05-11 21:55:47 · 720 阅读 · 0 评论 -
python如何导入datetime包
原创 2022-04-27 11:58:11 · 1451 阅读 · 0 评论 -
使用PyMySQL完全数据库的基本操作:1、连接数据库(pythontest)、2、创建数据库表:例如:用户表 user(用户编号user_id、用户名user_name、用户密码user
使用PyMySQL完全数据库的基本操作:1、连接数据库(pythontest)、2、创建数据库表:例如:用户表 user(用户编号user_id、用户名user_name、用户密码user原创 2022-03-28 15:45:34 · 976 阅读 · 0 评论 -
使用SQLAIchemy创建Stduent类,并对应stduent表,其中id是主键,含name、gender属性值
#引入包from sqlalchemy import create_enginefrom sqlalchemy.ext.declarative import declarative_basefrom sqlalchemy import Column, Integer, String#引入行声明(可指定主键),数据类型#1.创建连接引擎#mysql+pymysql:数据库类型+数据库驱动engine=create_engine('mysql+pymysql://root:xxxx@localho原创 2022-03-28 15:33:54 · 1446 阅读 · 0 评论 -
使用python编写一个类 , 要求含属性、方法,并打印输出,并且增加一个学生类(子类)
#类定义class People: #基本属性 name='' age=0 #私有属性(外部无法直接访问) __weight=0 #定义构造方法 def __init__(self,n,a,w):#__init__ : 构造函数,在生成对象时调用 self.name=n self.age=a self.__weight=w def speak(self): print("%s 说...原创 2022-03-28 15:23:33 · 1811 阅读 · 0 评论