![]() |
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 - Larz60+ - Mar-09-2018 Ok, I have finished the json file. This is important, because I will incorporate it into your code (next step). The file now contains the complete king James bible and can be accessed by volume = 'New Testament' or 'Old Testament' book = 'Genesis', 'Ephesians', '1st Chronicles', etc. chapter = 1, 2, ... verse = 1, 2, ... here's a very simple example to access Ephesians 3:7 all keys can be variables import BiblePaths import json bpath = BiblePaths.BiblePaths() with bpath.IndexedBible.open() as f: Bible = json.load(f) verse = Bible['New Testament']['Ephesians']['3']['7'] print(verse) count = len(Bible['Old Testament']['Genesis']) print('Genesis has {} chapters'.format(count))result: the code has become too lengthy to post here, so it will be on github,URL: github.com/Larz60p/Barrowman give me ten minutes to get it up there. RE: moving from tkinter to wxpython - Larz60+ - Mar-09-2018 Ok, you can download the zip file (or clone) here: https://github.com/Larz60p/Barrowman put the zip in a directory named Bible, and upzip there. first run needs internet access to get files: python CreateChapterJson.pythat will download the King James text files used for creating the json file, and then create the file. I will work on incorporating it into your existing code next. RE: moving from tkinter to wxpython - Barrowman - Mar-09-2018 Thanks, It's amazing how hard you have been working on this. How would I change which Bible she would use? She would like the modern English one here: https://www.jw.org/en/publications/bible/ It's the 1984 edition. The later one only has audio for about half the books. Is that possible? RE: moving from tkinter to wxpython - Larz60+ - Mar-09-2018 Take a look at how the bible is created: CreateChapterJson.py You would have to modify that to work with the new data, or, probably better, write a new one and preserve this one. My time is up on this one after the incorporation into the original code, probably today or tomorrow. About once a month I pick something to sink my teeth into, this one just happened to fit the bill this month. It might just as easily have been the Quran or TaNaKh as they all have their individual challenges. RE: moving from tkinter to wxpython - Barrowman - Mar-09-2018 That's fine. Thanks very much for all you have done. I know my friend will appreciate it. I will make sure she knows that most, if not all of what she will end up with, is due to your guidance and expertise. RE: moving from tkinter to wxpython - Larz60+ - Mar-09-2018 I am adding a scraper to get audio from: http://www.mp3bible.ca/playlistKJV/ which is copyright free. They will be placed in a separate directory, and added to the existing JSON file. You can replace these with your own version, and make appropriate changes to the file if you do so. This site has all of the files. RE: moving from tkinter to wxpython - Larz60+ - Mar-10-2018 still working on scraper. quitting for the night RE: moving from tkinter to wxpython - Larz60+ - Mar-10-2018 The scraper is almost done, actually it runs until Pslams, and then blows up. Just the same, while I'm fixing that, I'll put it on github so that you can play with it. There is new code in BiblePaths, and I may have changed something else also, so just download the package. It will download audio for all chapters, all books (until it blows up) It automatically creates all necessary directories, but here's the layout: (from src directory) data/KingJames/audio/m3u - Playlists for all mp3's (don't use these to listen, as they require internet access) data/KingJames/audio/Genesis, data/KingJames/audio/1Kings, etc. contain actual mp3 files. Give me about 1/2 hour to get it done. RE: moving from tkinter to wxpython - Larz60+ - Mar-10-2018 Github has been updated, let me know if there are any issues (other than the one I already know about) RE: moving from tkinter to wxpython - Larz60+ - Mar-11-2018 There was one more update to github. The audio download is now working. The file locations have to be added to the json file, and all incorporated into the GUI. Looks like a finish tomorrow, barring any unforeseen circumstances, which never happens in software development, right? |