Here is how the variables are parsed from the config file :
soc_code = tuple(config.get('MyScript', 'soc_code').split(','))
genre_code = tuple(config.get('MyScript', 'genre_code').split(','))
Here is my sql query :
sql_query = pd.read_sql_query('''
SELECT SOC_NAME, GENRE_NAME FROM DATA WHERE SOC_CODE IN %s AND GENRE_CODE IN %s
''' % (genre_code, soc_code) ,conn)
The content of the config file look like this:
soc_code = CODE1, CODE2
genre_codes = GCODE1, GCODE2
I always end up with a formatting error.