Convert Powershell Script To Python Programming