Python code updates