![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python Connect DB
加油开心
你好呀
展开
-
Xshell通过SSH连接Kali
1.kali上下载SSH sudo apt-get install ssh 2. cd /etc/ssh nano sshd_config 该目录下有两个很相似的文件 ssh_config和sshd_config 你修改的是sshd_config 将其中的 #PasswordAuthentication yes 改为: PasswordAuthentication yes PermitR...原创 2019-11-05 21:55:26 · 357 阅读 · 0 评论 -
Python读取Excel表格内容
#python操作excel主要用到xlrd和xlwt这两个库,即xlrd是读excel,xlwt是写excel的库 #我们重点掌握怎样去读 #///////////////////// import xlrd from datetime import date,datetime def read_excel(): # 打开文件 workbook = xlrd.open_wo...原创 2019-11-05 21:55:00 · 252 阅读 · 0 评论 -
Python发邮件
1.打开QQ邮箱开启POP3那个服务 然后就会获取授权码 以下以QQ邮箱为例 import yagmail yag = 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 · 116 阅读 · 0 评论 -
查询数据
''' +------------+-----------+------+------+--------+ | FIRST_NAME | LAST_NAME | AGE | SEX | INCOME | +------------+-----------+------+------+--------+ | Mac | Mohan | 20 | M | 200...原创 2019-11-05 21:53:47 · 179 阅读 · 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 · 102 阅读 · 0 评论 -
创建数据库表
#!/usr/bin/python3 import pymysql # 打开数据库连接 db = pymysql.connect("localhost","root","123456","test" ) # 使用 cursor() 方法创建一个游标对象 cursor cursor = db.cursor() # 使用 execute() 方法执行 SQL,如果表存在则删除 curs...原创 2019-11-05 21:52:16 · 118 阅读 · 0 评论 -
数据库连接
#!/usr/bin/python3 import pymysql # 打开数据库连接 db = pymysql.connect("localhost","root","123456","test" ) # 使用 cursor() 方法创建一个游标对象 cursor cursor = db.cursor() # 使用 execute() 方法执行 SQL 查询 cursor.e...原创 2019-11-05 21:51:26 · 125 阅读 · 0 评论