Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
python [2019/07/09 17:23]
paul [Formatting]
python [2019/07/09 17:29] (current)
paul [Formatting]
Line 172: Line 172:
 ==== Formatting ==== ==== Formatting ====
  
-If you want to print a neat line of data use the [Format String Syntax|https://docs.python.org/2/library/string.html#format-string-syntax]+If you want to print a neat line of data use the [[https://docs.python.org/2/library/string.html#format-string-syntax|Format String Syntax]]. 
 + 
 +For example:  
 +<code python> 
 +print("[ FAIL ] {: <20} Channel: {: <20} Statistics: {:>6.4f} hz".format(description, chan, stats)) 
 +</code> 
 + 
 +This sets a fix width for each field and aligns the test either left ''%%<%%'' or right ''%%>%%'' 
 ===== Mutability ===== ===== Mutability =====
  
  • python.1562693031.txt.gz
  • Last modified: 2019/07/09 17:23
  • by paul