Top "Pretty-print" questions

Prettyprint (or pretty-print) is the application of any of various stylistic formatting conventions to text, source code, markup, and other similar kinds of content.

How to format strings using printf() to get equal length in the output?

I have two functions, one which produces messages like Starting initialization... and another which checks return codes and outputs "Ok", "…

c string printf pretty-print
Print a list of space-separated elements in Python 3

I have a list L of elements, say natural numbers. I want to print them in one line with a …

python python-3.x pretty-print
Formatting floats without trailing zeros

How can I format a float so that it doesn't contain trailing zeros? In other words, I want the resulting …

python formatting floating-point pretty-print
Pretty-Print JSON Data to a File using Python

A project for class involves parsing Twitter JSON data. I'm getting the data and setting it to the file without …

python json twitter pretty-print
How do I pretty-print existing JSON data with Java?

I have a compact JSON string, and I want to format it nicely in Java without having to deserialize it …

java json formatting pretty-print
The simplest way to comma-delimit a list?

What is the clearest way to comma-delimit a list in Java? I know several ways of doing it, but I'm …

java pretty-print
How to Pretty Print HTML to a file, with indentation

I am using lxml.html to generate some HTML. I want to pretty print (with indentation) my final result into …

python html lxml pretty-print
Pretty-printing output from javax.xml.transform.Transformer with only standard java api (Indentation and Doctype positioning)

Using the following simple code: package test; import java.io.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; public …

java xml pretty-print
How do I get Python's ElementTree to pretty print to an XML file?

Background I am using SQLite to access a database and retrieve the desired information. I'm using ElementTree in Python version 2.6 …

python xml python-2.6 elementtree pretty-print
How can I beautify JavaScript code using Command Line?

I am writing a batch script in order to beautify JavaScript code. It needs to work on both Windows and …

javascript command-line-interface pretty-print multiplatform