How to print a list more nicely?

This answer uses the same method in the answer by @Aaron Digulla, with slightly more pythonic syntax. It might make some of the above answers easier to understand. >>> for a,b,c in zip(foolist[::3],foolist[1::3],foolist[2::3]): >>> print ‘{:<30}{:<30}{:<}’.format(a,b,c) exiv2-devel mingw-libs tcltk-demos fcgi netcdf pdcurses-devel msvcrt gdal-grass iconv qgis-devel qgis1.1 php_mapscript This can be easily adapt to any … Read more

Print a website without printing the link locations?

So to avoid additional print-out of link information in a printed web page, add the following rules to the @media print section: a:link:after, a:visited:after { content: “”; } This will remove the ugly link information like Homepage (http://localhost) and reduce it to Homepage. You may of course add rules to avoid it only in the … Read more

To prevent a function from printing in the batch console in Python

Yes, you can redirect sys.stdout: import sys import os old_stdout = sys.stdout # backup current stdout sys.stdout = open(os.devnull, “w”) my_nasty_function() sys.stdout = old_stdout # reset old stdout Just replace my_nasty_function with your actual function. EDIT: Now should work on windows aswell. EDIT: Use backup variable to reset stdout is better when someone wraps your … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)