update Python script for the new library #366