result returned 'NoneType' object has no attribute 'execute' during I make connection of db
<p>I try to access db connection with python code, however
I got problem with python db connection. 
here is my code and I am working with python version 2.7.10.</p>

<pre><code>import pymysql

class SqlManager:
    def __init__(self):
        self.conn = None
        self.cursor = None
        self.host = "127.0.0.1"
        self.port = 3306
        self.user = "user"
        self.passwd = "pw"
        self.db_name = "db"

    def connect(self):
        self.conn = pymysql.connect(
            host=self.host, port=self.port, user=self.user,    passwd=self.passwd, db=self.db_name)
        self.cursor = self.conn.cursor(pymysql.cursors.DictCursor)
        self.conn.autocommit(True)
        return True

    def description(self):
        cur = self.cursor.execute("SELECT * FROM user")
        for row in cur:
            print(row)
</code></pre>

<p>Actually I guess I got Attribute error of Nonetype maybe the connection declare in init part with None, but I made connection in connect part, so I thought that it would work, but I was not. </p>

<p>Please suggest me what I need to fix or better way to use it.</p>

<p>Thanks for helping me.</p>