How to read sql files by python
Most people do not understand the knowledge points of this article "python how to read sql files", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "python how to read sql files" article.
The specific steps are as follows:
1. First, open python and create a new python project
After the 2.python project is created, import the dxfgrabber module in the project using the import method
Import dxfgrabber
After the 3.dxfgrabber module is imported, define two variables in the project, storing the sql folder path and file name, respectively.
Path ='D:\ user' +'\\'
File = 'test.sql'
4. Finally, after the folder path and file name are defined, the contents of the sql file can be obtained by using the open () function.
Res = open (path + file, 'ringing, encoding =' utf8')
Res.close ()
The above is about the content of this article on "how python reads sql files". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.