擅长:python、mysql、java
<p>你有几个问题。正如Alex S.指出的,myList是一个列表,尤其是一个包含一个元素的列表:类构造函数。<br/>
我想你想要的是:</p>
<pre><code> # assumption: you have textlines,
# which is an array of lines of the form firstname,lastname,blah
myList = [studentclass(*(args.split(",")) for args in textlines]
</code></pre>
<p>然后执行<code>myList[counter].firstname</code>以获得(counter th)firstname值</p>