python control documents