Prettyprint to a file?
What you need is Pretty Print pprint module: from pprint import pprint # Build the tree somehow with open(‘output.txt’, ‘wt’) as out: pprint(myTree, stream=out)
What you need is Pretty Print pprint module: from pprint import pprint # Build the tree somehow with open(‘output.txt’, ‘wt’) as out: pprint(myTree, stream=out)
Are you looking for the -ddump-splices flag to the compiler?
UPDATE: it’s now on GitHub: https://github.com/DTW-DanWard/PowerShell-Beautifier I wrote a PowerShell pretty printer / code cleaner in PowerShell. It cleans white space, indents code groups, replaces aliases with commands, fixes casing on commands, parameters, types, etc. You can use it to reformat a file in place or read a source file and output the result in … Read more
I tried this and worked: df.info(verbose=True)
#!/usr/bin/ruby1.8 require ‘pp’ mooth = [ “booth”, “month”, “mooch”, “morth”, “mouth”, “mowth”, “sooth”, “tooth” ] PP.pp(mooth, $>, 40) # => [“booth”, # => “month”, # => “mooch”, # => “morth”, # => “mouth”, # => “mowth”, # => “sooth”, # => “tooth”] PP.pp(mooth, $>, 79) # => [“booth”, “month”, “mooch”, “morth”, “mouth”, “mowth”, “sooth”, “tooth”] … Read more
Python JSON’s module can do this too (python -m json.tool), e.g.: cat myjsonfile.json | python -m json.tool > pretty.json
You can apply the list as separate arguments: print(*L) and let print() take care of converting each element to a string. You can, as always, control the separator by setting the sep keyword argument: >>> L = [1, 2, 3, 4, 5] >>> print(*L) 1 2 3 4 5 >>> print(*L, sep=’, ‘) 1, 2, … Read more
If you are using Spring Boot 1.2 or later the simple solution is to add spring.jackson.serialization.INDENT_OUTPUT=true to the application.properties file. This assumes that you are using Jackson for serialization. If you are using an earlier version of Spring Boot then you can add http.mappers.json-pretty-print=true This solution still works with Spring Boot 1.2 but it is … Read more
I don’t know how best to deal with some of the more invasive changes you’re describing, but… The -w option to git blame, git diff, and others causes git to ignore changes in whitespace, so you can more easily see the real differences.
The trick is to pass a string as the indent and to treat the last child specially: class Node { public void PrintPretty(string indent, bool last) { Console.Write(indent); if (last) { Console.Write(“\\-“); indent += ” “; } else { Console.Write(“|-“); indent += “| “; } Console.WriteLine(Name); for (int i = 0; i < Children.Count; i++) … Read more