Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
moving from tkinter to wxpython
#41
Yes I was right but then again I was wrong CMUSphinx is a toolkit for Linux and it includes pocketsphinx
toolkit
Quote
#42
Then I think it's worth exploring.
Quote
#43
Would yo like to comment on some of the ugly bits?
Quote
#44
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:
  • I imagine that the large buttons are so that your blind user can find the various chapters by touch screen, Is that correct?
  • what does '67' refer to in books list?
  • What are you planning on putting in the notebook tabs?
  • Would a listCtrl be a better choice? see example (image under (Accordance Bible Software) left side here: https://churchtechtoday.com/2016/11/25/5...ket-today/
Quote
#45
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:
  • Create a directory named src
  • Save the __init__.py file to parent directory of src
  • Copy all other .py files to the src directory
  • run
    python BiblePaths.py
    once from command terminal to create sub directories
  • save .json file (attached) to src/data/json
  • run
    python DisplayBibleIndex.py

software:
__init__.py
    src\
        __init__.py
        BiblePaths.py
        DisplayBibleIndex.py
BiblePaths.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()


Attached Files
.json   BibleIndex.json (Size: 34.42 KB / Downloads: 23)
Quote
#46
Okay I have followed the instructions but I get an error
Error:
File "DisplayBibleIndex.py", line 18 print(f'mp3 file is located here: {description}')
Quote
#47
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:
  • I imagine that the large buttons are so that your blind user can find the various chapters by touch screen, Is that correct?
  • what does '67' refer to in books list?
  • What are you planning on putting in the notebook tabs?
  • Would a listCtrl be a better choice? see example (image under (Accordance Bible Software) left side here: https://churchtechtoday.com/2016/11/25/5...ket-today/
Quote
#48
(Mar-07-2018, 04:01 AM)Larz60+ Wrote:
  • I imagine that the large buttons are so that your blind user can find the various chapters by touch screen, Is that correct?
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:
  • what does '67' refer to in books?
It's the number of books in the bible + 1
Quote:
  • What are you planning on putting in the notebook tabs?
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.
Quote
#49
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.
Quote
#50
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.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Moving with objects in tkinter dan789 2 384 Dec-15-2018, 01:04 PM
Last Post: dan789
  Problems using Wxpython Carles 1 261 Nov-28-2018, 03:09 PM
Last Post: Larz60+
  [WxPython] Using thread in the wxPython hildogjr 8 971 Aug-11-2018, 02:59 AM
Last Post: hildogjr
  Using 2 screens in wxpython Barrowman 1 569 Jun-27-2018, 07:43 PM
Last Post: Barrowman
  Trying to use code from WxPython GUI Toolkit Barrowman 3 620 Jun-26-2018, 05:43 PM
Last Post: nilamo
  A little idea to remember wxPython classes Sebastian_Adil 0 624 Mar-26-2018, 10:23 PM
Last Post: Sebastian_Adil
  how to draw simple line in wxPython? Sebastian_Adil 6 1,018 Mar-22-2018, 08:34 PM
Last Post: Larz60+
  installing wxPython predirt 12 2,187 Mar-16-2018, 09:45 PM
Last Post: Barrowman
  [WxPython] wxpython and python 3.6 on linux Barrowman 3 1,680 Mar-15-2018, 06:57 PM
Last Post: Larz60+
  moving from os to subprocess Barrowman 10 1,691 Dec-20-2017, 09:08 AM
Last Post: Barrowman

Forum Jump:


Users browsing this thread: 1 Guest(s)