import MySQLdb
import re
def write():
file = open('/home/fixstream/Desktop/test10.txt', 'r')
print file.read()
file.close()
write()
Run Code Online (Sandbox Code Playgroud)
我上面的代码,现在我想将文本文件存储到mysql数据库中.我是python以及数据库的新手.所以任何人都可以帮助我吗?
python-2.7 ×1