[PATCH 2/3] python: add write lockspace and resource