[20191106]善用column格式化输出.txt # man columnDESCRIPTION The column utility formats its input into multiple columns. Rows are filled before columns. Input is taken from file operands, or, by default, from the standard input. Empty lines are ign…
格式化输出io:format是我接触Erlang使用的第一个库函数(io:format("Hello World")),随着学习的深入,它也是我debug优先选择最简单直接的工具. 不过它除了简单的输出外,还有很多进阶用法.甚至通过它,你就可以在命令行画出精艳的图表.比如:我在Visualize Erlang/Elixir Nodes On The Command Line observer_cli中绘制的与htop类似图表. 同时这个API的选项特别多,却又非常好用,你完全可以不必了…
1 文件与IO 1.1读写文本数据 读写各种不同的文本数据,如ASCII,UTF-8,UTF-9编码等. 使用带有rt模式的open()函数读取文本文件. 例如: with open('db', 'rt') as f: data = f.read() print(data) with open('db', 'rt') as f: for line in f: print(line.strip('\n')) 使用带有wt的open()函数写入一个文本文件,如果之前文件内容存在则清除并覆盖掉. 例如…
01,日期格式化输出 SQL> alter session set NLS_DATE_FORMAT='YYYY-MM-DD HH24:mi:ss'; SQL> select sysdate from dual; SYSDATE ------------------- :: SQL> alter session set nls_date_format ='yyyy"年"mm"月"dd"日生"'; 会话已更改. SQL> co…