
Python Connect DB
加油开心
你好呀
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Xshell通过SSH连接Kali
1.kali上下载SSHsudo apt-get install ssh2.cd /etc/sshnano sshd_config该目录下有两个很相似的文件ssh_config和sshd_config你修改的是sshd_config将其中的#PasswordAuthentication yes 改为: PasswordAuthentication yesPermitR...原创 2019-11-05 21:55:26 · 433 阅读 · 0 评论 -
Python读取Excel表格内容
#python操作excel主要用到xlrd和xlwt这两个库,即xlrd是读excel,xlwt是写excel的库#我们重点掌握怎样去读#/////////////////////import xlrdfrom datetime import date,datetime def read_excel(): # 打开文件 workbook = xlrd.open_wo...原创 2019-11-05 21:55:00 · 304 阅读 · 0 评论 -
Python发邮件
1.打开QQ邮箱开启POP3那个服务然后就会获取授权码以下以QQ邮箱为例import yagmailyag = yagmail.SMTP(user = "你的QQ号", password='获取的授权码', host = 'smtp.qq.com')contents = [ 'Hello, i am sent by yagmail!', 'Here is a...原创 2019-11-05 21:54:22 · 143 阅读 · 0 评论 -
查询数据
'''+------------+-----------+------+------+--------+| FIRST_NAME | LAST_NAME | AGE | SEX | INCOME |+------------+-----------+------+------+--------+| Mac | Mohan | 20 | M | 200...原创 2019-11-05 21:53:47 · 228 阅读 · 0 评论 -
插入数据
#!/usr/bin/python3 import pymysql # 打开数据库连接db = pymysql.connect("localhost","root","123456","test" ) # 使用cursor()方法获取操作游标 cursor = db.cursor() # SQL 插入语句sql = """INSERT INTO EMPLOYEE(FIRST_...原创 2019-11-05 21:53:19 · 171 阅读 · 0 评论 -
创建数据库表
#!/usr/bin/python3 import pymysql # 打开数据库连接db = pymysql.connect("localhost","root","123456","test" ) # 使用 cursor() 方法创建一个游标对象 cursorcursor = db.cursor() # 使用 execute() 方法执行 SQL,如果表存在则删除curs...原创 2019-11-05 21:52:16 · 162 阅读 · 0 评论 -
数据库连接
#!/usr/bin/python3 import pymysql # 打开数据库连接db = pymysql.connect("localhost","root","123456","test" ) # 使用 cursor() 方法创建一个游标对象 cursorcursor = db.cursor() # 使用 execute() 方法执行 SQL 查询 cursor.e...原创 2019-11-05 21:51:26 · 165 阅读 · 0 评论