A GUI is provided to show the original text and translated text. And when you copy a text, the GUI will display the text and its translated one. what's more, the GUI is on the top state. So there is no worry that any window will cover it, unless you minimize it. Additionally, you can resize it as you need.
If you don't have Chrome, go to Chrome's official website.
If you prefer older ones, you can find them here.
- Enter in the URL bar chrome://version/ and view browser version.
- Go website1 or website2, find the corresponding version and download it.
- Modify Lines 7-9 of translator.py, so as to let computer know where the chrome and its driver are.
- Run main.py
- Put the extracted chromedriver into any folder and open the terminal in that folder.
- Enter the following commands:
sudo mv chromedriver /usr/bin # move chromedriver to /usr/bin cd /usr/bin # go to /usr/bin sudo chmod +x chromedriver # give permission to the driver sudo apt-get install xsel xclip # install required plug-ins
- Modify Lines 7-9 of translator.py, so as to let computer know where the chrome and its driver are.
- Run main.py
To be continued
You can pack it up using pyinstaller.
- Set Lines 7-9 of transtator.py as:
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) chrome_path = BASE_DIR + '\Application\chrome.exe' driver_path = BASE_DIR + '\Application\chromedriver.exe'
- Go to C:\Program Files\Google\Chrome or C:\Program Files (x86)\Google\Chrome, copy the folder Application to the folder where main.py locates.
- Copy chromedriver.exe to Application
- Open CMD in the folder where main.py locates, type:
pyinstaller -F -w -i ui.ico main.py --add-data Application;Application