diff --git a/_temp_pinyin_script.py b/_temp_pinyin_script.py new file mode 100644 index 0000000..16164e6 --- /dev/null +++ b/_temp_pinyin_script.py @@ -0,0 +1,12 @@ +from pypinyin import pinyin, Style + +# The phrase to convert +phrase = "眼睛" + +# Generate pinyin with tone marks +pinyin_list = pinyin(phrase, style=Style.TONE) + +# Flatten the list and join +pinyin_str = " ".join([item[0] for item in pinyin_list]) + +print(pinyin_str)