Search code examples
python-3.xpython-3.7pylint

Pylint complaining about function reports


I am attempting to import functions from couple of files called

mysql_calls.py

system_calls.py

If I import with

from mysql_calls import *

pylint complains about wildcard import and if I just do

import mysql_calls

pylint complains about undefined vars when I use functions from imported modules.

alert_feeder.py:215:17: E0602: Undefined variable 'mysql_query' (undefined-variable)

What is the right way to do this? I am also not (yet?) using every functions from imported modules, and pylint also complains about that.


Solution

  • When you run import mysql_calls, its function mysql_query is accessible as mysql_calls.mysql_query.

    More details: Modules - Python 3 documentation