摘要:
import sysimport pymysqlfrom PIL import Imageimport os, timepath = "./"# 打开图片存放到内存中fp = open("./2.png", 'rb')img = fp.read()fp.close()database = pymys 阅读全文
posted @ 2021-02-06 11:39
ReluStarry
阅读(399)
评论(0)
推荐(0)
摘要:
open() 方法: Python open() 方法用于打开一个文件,并返回文件对象,在对文件进行处理过程都需要使用到这个函数,如果该文件无法被打开,会抛出 OSError。 注意:使用 open() 方法一定要保证关闭文件对象,即调用 close() 方法。 open() 函数常用形式是接收两个 阅读全文
posted @ 2021-02-06 10:26
ReluStarry
阅读(80)
评论(0)
推荐(0)