0
# -*- coding: utf-8 -*-
import MySQLdb as mdb
import matplotlib.pyplot as plt
print(plt)
con = mdb.connect('localhost', 'root', '123456', 'testdb');
null = None
with con:
cur = con.cursor()
d = cur.execute("SELECT CAST(Ping AS DECIMAL(10,6)) as Ping FROM Pings WHERE Enderecos = 'www.peplink.com'")
d = cur.fetchall()
e = cur.execute("SELECT Timestamp FROM Pings WHERE Enderecos = 'www.peplink.com'")
a = len(e)
print a
e = cur.fetchall()
#plt.plot(d, e)
#plt.title("Peplink")
#plt.show()
He makes the following mistake:
a = len(e)
TypeError: object of type 'long' has no len()
And if you do
a = len(str(e))
?– Woss