2020年12月16日星期三

vim 列编辑

 How to do column editing in vim?

https://stackoverflow.com/a/6972206/4539590 

To edit a column, follow these steps:

  1. Stand on the beginning of the column
  2. Press Ctrl+v, then mark across the column you want to edit.
  3. Press Shift+i to insert text at the beginning of the column, Shift+a to append text, r to replace highlighted text, d to delete, c to change... etc.
  4. Hit ESC when done.

 

2020年12月15日星期二

Python strptime()

 Python strptime()

parsing-non-zero-padded-timestamps-in-python 

datetime.strptime():  creates a datetime object from the given string.

 

from datetime import datetime

dt_string = "12/11/2018 09:15:32"

dt_object1 = datetime.strptime(dt_string, "%d/%m/%Y %H:%M:%S")

dt_object2 = datetime.strptime(dt_string, "%m/%d/%Y %H:%M:%S")