How to work with sqlite3 and Python

前端 未结 4 557
刺人心
刺人心 2021-01-20 21:50

I was looking for any database solution with Python. And found the tutorial Python: A Simple Step-by-Step SQLite Tutorial. There I found a code example which shows how to cr

4条回答
  •  太阳男子
    2021-01-20 22:24

    No, you would not need to install any other module but python-sqlite.

    Run sudo apt-get install python-sqlite on Ubuntu

    Also, when you see in the above code see one database named mydatabase.db. This is the name of the file that shall be used to store your data. Sqlite stores data in the form of flat files only. So this file ("mydatabase.db" in this case) will contain your database schema and content.

    As no absoulute path given this will be created in the present working directory, that is, the directory from script is running.

提交回复
热议问题