Update pinyin.py

- add Python 3 support
    - some adjustments