Perl Functions in Python