擅长:python、mysql、java
<p>在这种情况下,我个人会选择<a href="https://docs.python.org/3/tutorial/datastructures.html#dictionaries" rel="nofollow noreferrer" title="Data Structures - Dictionaries">dictionaries</a>。您可以很容易地将它们中的每一个定义为:</p>
<pre><code>{"no": 1, "maker": "Ford", "doors": "4", "year": 2016}
</code></pre>
<p>使用<code>pickle</code>或内置的<a href="https://docs.python.org/3/library/json.html" rel="nofollow noreferrer" title="json module">json library</a>从文件中存储和读取dict相当容易</p>