[Python] How to print a list more nicely?

Discussão em 'Python' iniciado por Stack, Dezembro 6, 2024.

  1. Stack

    Stack Membro Participativo

    This is similar to How to print a list in Python “nicely”, but I would like to print the list even more nicely -- without the brackets and apostrophes and commas, and even better in columns.

    foolist = ['exiv2-devel', 'mingw-libs', 'tcltk-demos', 'fcgi', 'netcdf',
    'pdcurses-devel', 'msvcrt', 'gdal-grass', 'iconv', 'qgis-devel',
    'qgis1.1', 'php_mapscript']

    evenNicerPrint(foolist)


    Desired result:

    exiv2-devel msvcrt
    mingw-libs gdal-grass
    tcltk-demos iconv
    fcgi qgis-devel
    netcdf qgis1.1
    pdcurses-devel php_mapscript


    thanks!

    Continue reading...

Compartilhe esta Página