Incorrect format in list output

1

I have the following query:

 sqlLote = ("select lot.idLote from Lote lot \
 inner join [dbo].[Usuario] u on lot.idUsuario = u.idUsuario \
 where u.userName = '%s'") % \
         (usuario)

The result of this query per sql gives

  

1 4 5 6 9

When I print it on the screen, the data looks like this:

cursorUsuario = connUsuario.execute(sqlLote)
print([x for x in cursorUsuario])
  

[(1,), (4,), (5,), (6,), (9,)]

Why is it not shown in the following way?

  

[1,4,5,6,9]

    
asked by Sebastian 15.08.2018 в 20:27
source

1 answer

0

If you want to show it that way, you should do the following:

print([x[0] for x in cursorUsuario])
    
answered by 15.08.2018 / 20:36
source