was bedeutet der ", =" Operator?
Verfasst: Montag 4. August 2014, 08:52
Hi, in einem Programmbeispiel fand ich das hier:
(Quelle: http://matplotlib.org/1.3.0/examples/an ... decay.html)
Dort steht
Warum schreibt man hinter das line ein Komma?
Hier noch so ein Zuweisungsbeispiel mit Komma:
Über einen Tipp würde ich mich freuen.
Code: Alles auswählen
def run(data):
# update the data
t,y = data
xdata.append(t)
ydata.append(y)
xmin, xmax = ax.get_xlim()
if t >= xmax:
ax.set_xlim(xmin, 2*xmax)
ax.figure.canvas.draw()
line.set_data(xdata, ydata)
return line,
Dort steht
Code: Alles auswählen
return line,
Hier noch so ein Zuweisungsbeispiel mit Komma:
Code: Alles auswählen
line, = ax.plot([], [], lw=2)