![]() |
moving from tkinter to wxpython - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: moving from tkinter to wxpython (/thread-8405.html) |
RE: moving from tkinter to wxpython - Barrowman - Mar-04-2018 Yes I was right but then again I was wrong CMUSphinx is a toolkit for Linux and it includes pocketsphinx toolkit RE: moving from tkinter to wxpython - Larz60+ - Mar-04-2018 Then I think it's worth exploring. RE: moving from tkinter to wxpython - Barrowman - Mar-06-2018 Would yo like to comment on some of the ugly bits? RE: moving from tkinter to wxpython - Larz60+ - Mar-07-2018 I haven't forgotten about you, but I have been working on my own code but will get to yours later this evening, and into tomorrow if required. But I do have some questions:
RE: moving from tkinter to wxpython - Larz60+ - Mar-07-2018 Here's my idea of how chapters, mp3 file locations and (coming up) text should be handled I am adding King James text to the json file also, and will share all the code to create as soon as done: do the following steps in order:
software: __init__.py src\ __init__.py BiblePaths.py DisplayBibleIndex.pyBiblePaths.py from pathlib import Path class BiblePaths: def __init__(self): self.homepage = Path('.') self.datapath = self.homepage / 'data' self.datapath.mkdir(exist_ok=True) self.jsonpath = self.datapath / 'json' self.jsonpath.mkdir(exist_ok=True) self.KingJamespath = self.datapath / 'KingJames' self.KingJamespath.mkdir(exist_ok=True) self.BibleIndex = self.jsonpath / 'BibleIndex.json' self.emptyinit = self.homepage / '__init__.py' self.emptyinit.touch(exist_ok=True) def onetime(): bp = BiblePaths() if __name__ == '__main__': onetime()DisplayBibleIndex.py import BiblePaths import json class DisplayBibleIndex: def __init__(self): self.npath = BiblePaths.BiblePaths() with self.npath.BibleIndex.open() as f: self.BibleIndex = json.load(f) self.show_index() def show_index(self): for volume, contents in self.BibleIndex.items(): for book, detail in contents.items(): print() for chapter, description in detail.items(): if chapter == 'mp3': print(f'mp3 file is located here: {description}') else: print(f'volume: {volume}, book: {book}, chapter: {chapter} {description}') # This is an example of how to get info on a particular Book, chapter: print(f"\nLeviticus Chapter 5: {self.BibleIndex['Old Testament']['Leviticus']['5']}") print(f"Mp3 file for Leviticus is here: {self.BibleIndex['Old Testament']['Leviticus']['mp3']}") if __name__ == '__main__': DisplayBibleIndex() RE: moving from tkinter to wxpython - Barrowman - Mar-08-2018 Okay I have followed the instructions but I get an error
RE: moving from tkinter to wxpython - Larz60+ - Mar-08-2018 f-string was introduced in python 3.6 replacement is like: # f-string version print(f'mp3 file is located here: {description}') #pre python 3.6 version print('mp3 file is located here: {}'.format(description))just change all occurrences, or better you get up to date! Had 5 or 6 power outages last night, plus 2 feet of snow. Slowed me down a bit. I need sleep, be back i several hours. But I do have some questions:
RE: moving from tkinter to wxpython - Barrowman - Mar-08-2018 (Mar-07-2018, 04:01 AM)Larz60+ Wrote:Well she uses the touchpad and as she cannot see the buttons need to be quite big. While the mousepointer is over a button it says either the book name or chapter ( just once). immediately the mousepointer moves off the button it stops. This prevents it starting to say multiple words as she moves the mouse about otherwise they would all start and continue until the word is finished. Quote:It's the number of books in the bible + 1 Quote:The names of the books are on the tabs so sighted people can click on them to navigate. They are too small for her to use and not all can be on screen at the same time due to the number of pages. Quote:Seems to be a completely different thing and not sure how I could write that sort of code to do what I set out to do. I am still curious about which bits of my code are ugly. I would like to see why some is and how I could improve it. I do want to advance in this. RE: moving from tkinter to wxpython - Larz60+ - Mar-08-2018 Quote:I am still curious about which bits of my code are ugly. I would like to see why some is and how I could improve it. I do want to advance in this.working on it, that's why the questions, and the JSON file. I just got up for a few minutes, need more sleep, than back to it. Last nights power failures slowed my down a lot. RE: moving from tkinter to wxpython - Barrowman - Mar-08-2018 Not to worry, we are obviously in different time zones. We have never had more than 6" snow here. Very rare to have power cuts too. |