Closed lawrence124 closed 2 years ago
Hello, the first screenshot did not show the complete stack trace to include the error. Would you be able to post the stack trace?
If I have to guess, for Windows you'd have to put your code under the if __name__ == "__main__":
idiom when you run code from a .py
file (due to parallelization -- see the "Caution" note at the top of the Quickstart page):
import pycantonese
if __name__ == "__main__":
print(pycantonese.characters_to_jyutping('香港人講廣東話'))
Let me know if this resolves the issue.
it solved the problem, sorry for not reading the quickstart page thoroughly/
Describe the bug running in python environment is ok but not when it is in a py file
To reproduce running "python cantonese.py" will result in error/crash, while cantonese.py only has 2 lines:
import pycantonese pycantonese.characters_to_jyutping('香港人講廣東話') # Hongkongers speak Cantonese
but directly running in python environment was ok:![image](https://user-images.githubusercontent.com/29505986/176981923-4cfbf5d5-97de-492d-8d6a-fdf1f8130c25.png)
Expected behavior A clear and concise description of what you expected to happen instead.
Screenshots If applicable, add screenshots to help explain your problem.
System (please complete the following information):
import pycantonese; print(pycantonese.__version__)
]Additional context Add any other context about the problem here.