![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
GrassEva
这个作者很懒,什么都没留下…
展开
-
Python学习笔记——文件操作
1.文件读取 file=open("path/file.txt","r",encoding="utf-8") file.read()//读取全文 file.readline()//读取单行 file.close() 2.文件的写入 1)非追加,替换之前的内容 file=open("path/file.txt","w") file.write(data)//写入文件 file.wr原创 2017-09-14 13:18:39 · 235 阅读 · 0 评论 -
python3的mysq连接
pip安装pip install PyMySQL文件代码#coding utf-8 import pymysql class DatabaseClass: #insert/update,返回true/false def commitSql(self,sql): result=True db = pymysql.connect(host="local...原创 2018-04-18 09:25:01 · 252 阅读 · 0 评论 -
python3发送请求
pip安装requestspip install requests文件代码#coding:utf-8 import requests import json class RequestClass: def sendPost(self): url="http://xxx.xx.xx..." param={"key1":value1,"key2":value2...原创 2018-04-18 09:31:37 · 435 阅读 · 0 评论