How can I run python script to add hyphens to txt file? 🤔
For windows I was using 'python softhyphen.py filename.txt' (where softhyphen.py is the file containing hyphenation rules)..
Tried the same but the terminal does not recognize 'python' command, only 'python3', and gives me SyntaxError: invalid syntax 😐

#python #hyphenation

@nickelson I would try:

A. finding a Python 3 version of the script
or
B. using 2to3 and some manual changes if needed to port it to Python 3

To do A. I did a search and found PyHyphen on PyPi, the Python package repo: https://pypi.org/project/PyHyphen/

You can do B. using https://docs.python.org/3/library/2to3.html

For example:
```
# edit a Python 2 file in-place
$ 2to3 -w softhyphen.py
```

#python #2to3 #SoftHyphens #TypeSetting

PyHyphen

The hyphenation library of LibreOffice and FireFox wrapped for Python

PyPI