0

Currently I have a following format:

import pylint, mypy

# python code that I want to lint is in string
code = '
import pandas as pd
def foo(a:int, b:int)->int:
    df=pd.DataFrame()
    ...
'

I'm running the python using some software, and I can't run terminal command that would simply do pylint ml_model.py

I can get the code script as string.

So what i want is:

import pylint, mypy

# python code that I want to lint is in string
code = '
import pandas as pd
def foo(a:int, b:int)->int:
    df=pd.DataFrame()
    ...
'

# result would show the score and errors
result = pylint.lint(code)

I can't get the file directory, which if i did, i could use solution here

I don't need to use pylint specifically, it can be anything.

Any hints or help will be appreciated.

Thanks in advance

0 Answers0