Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何用Python编写小型数据库?_Python_Database_Python 2.7 - Fatal编程技术网

如何用Python编写小型数据库?

如何用Python编写小型数据库?,python,database,python-2.7,Python,Database,Python 2.7,我应该使用Python轻松地编写一个小型数据库,但不使用SQL或类似的东西。我曾在课堂或字典上尝试过,但不幸的是没有成功 class DUT(object): def __init__(self, id_number, dut, meas_time, end_time): self.id_number = id_number self.dut = dut self.meas_time = meas_time self.end

我应该使用Python轻松地编写一个小型数据库,但不使用SQL或类似的东西。我曾在课堂或字典上尝试过,但不幸的是没有成功

class DUT(object):
    def __init__(self, id_number, dut, meas_time, end_time):
        self.id_number = id_number
        self.dut = dut
        self.meas_time = meas_time
        self.end_time = end_time

        T001 = DUT(001, "CAF01", 200, 300)
        T002 = DUT(002, "CAF02", 150, 600)
我该怎么办

我会在图片上的excel表格中创建相同的东西。应可以添加带有ID号、DUT名称、测量时间和结束时间的新样品(DUT)

用户应该能够添加新样本,查找/更改/覆盖或删除相同的样本。所有这些都应该是自动化的,例如一个功能或类似的东西


如果是“小型”数据库,是否使用熊猫数据框将其保存到csv?平均预期每天写入的行数是多少?写入数据库是一项艰巨的任务,您最好使用现有的众多受支持数据库中的一个,而不是一个小表?使用。如果使用多个表。两者都是Python库的一部分。我考虑了你的建议…非常好的想法。