python - self - required positional argument : <p>here is my code: </p>

<p>my file which I start:</p>

<pre><code> from SQLhandler import SQLhandler 
 D = SQLhandler.loadProject(4711)
</code></pre>

<p>a part of my SQLhandler file:</p>

<pre><code>class SQLhandler(object):
   db = pymysql.connect(... )

   def loadProject(self, project_id):
    #do some stuff
</code></pre>

<p>I want to use db in other functions, so I put it on the class level and added a "self" to loadProject. Now the second line in my start file throws an error:</p>

<pre><code>"loadProject() missing 1 required positional argument: 'project_id'"
</code></pre>

<p>What's wrong with my code? </p>
