Python Use Variable From Outer Scope