user202729 / plover-python-dictionary-lib

Library for writing Python dictionary for Plover, and generating JSON dictionary file from Python dictionary.
GNU General Public License v3.0
2 stars 1 forks source link

How do I "run" my python dictionary to get it to output a json? #4

Open winstond opened 11 months ago

winstond commented 11 months ago

I tried: python dictionary.py

But I get an error: ModuleNotFoundError: No module named 'plover'. I tried a few things, but I'm not super familiar with python so not sure what I'm missing.

Thank you.

user202729 commented 11 months ago

Not sure what I can support about this. I think you have a few options

winstond commented 11 months ago

Yes, I do apologize. More of a Python question really. I'm on Win 11. Plover is in the usual place, C:\Program Files\Open Steno Project\Plover.

Perhaps once I can confirm the way to do this it could be added to the readme page?

I have a dictionary for Hindi I'd like to share, but right now I'd have to provide command line instructions for people to use it. Hoping to just have a JSON.

winstond commented 11 months ago

Update: I managed to get it to work. Here are the steps in case anyone else stumbles on this:

Windows 11. Python install on system, but Plover uses it's own...

  1. Open a powershell (might need to open as admin depending on where your files are)
  2. Navigate to your plover directory (ex: c:\program files\open steno project\plover)
  3. Install plover-python-dictionary-lib in this instance of python with: .\data\python.exe -m pip install plover_python_dictionary_lib
  4. Run your python dictionary (which should include the line to print the dictionary to the terminal as per readme) .\data\python.exe .\hindirun.py Your dictionary should dump out to the terminal
  5. Highlight and copy your dictionary from the command prompt and make your json file.

(I tried piping to a file, but my JSON output had unicode characters so I got an encoding error. However copying the output in the terminal and pasting it still worked even though the terminal wouldn't display the the unicode characters properly.)

user202729 commented 11 months ago

Some day it would be easier.

https://github.com/openstenoproject/plover_python_dictionary/issues/9