Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
moving from tkinter to wxpython
#70
what do you use for an ide?
Do you have pip available? if so, pip install wxpython should work.
I have used Linux (and Unix) more over the past 38 years (since Unix was made available by Bell Labs )
but for the past few years have been stuck on windows (My Linux box crashed beyond recovery, and I have not
replaced it yet). I hope wxpython is not a problem on Mint.
the syntax for:
print(f"Mp3 file for Leviticus is here: {self.BibleIndex['Old Testament']['Leviticus']['mp3']}")
f is the f-string, it allows printing with interpretation of any code between '{' and '}'.
The code that is in there: self.BibleIndex['Old Testament']['Leviticus']['mp3']
references the BibleIndex dictionary that was loaded from the json file that I created.
That dictionary has several nested levels, everything between '[' and ']' is a key to the next level.
Here's and example (book of jude which is short in actual portion of json dictionary, modified to make complete dictionary:

Output:
BibleIndex = { "New Testament": { "Jude": { "1": { "chapter_title": "Contending for the Faith", "1": "Jude, the servant of Jesus Christ, and brother of James, to them that are sanctified by God the Father, and preserved in Jesus Christ, [and] called:", "2": "Mercy unto you, and peace, and love, be multiplied.", "3": "Beloved, when I gave all diligence to write unto you of the common salvation, it was needful for me to write unto you, and exhort [you] that ye should earnestly contend for the faith which was once delivered unto the saints.", "4": "For there are certain men crept in unawares, who were before of old ordained to this condemnation, ungodly men, turning the grace of our God into lasciviousness, and denying the only Lord God, and our Lord Jesus Christ.", "5": "I will therefore put you in remembrance, though ye once knew this, how that the Lord, having saved the people out of the land of Egypt, afterward destroyed them that believed not.", "6": "And the angels which kept not their first estate, but left their own habitation, he hath reserved in everlasting chains under darkness unto the judgment of the great day.", "7": "Even as Sodom and Gomorrha, and the cities about them in like manner, giving themselves over to fornication, and going after strange flesh, are set forth for an example, suffering the vengeance of eternal fire.", "8": "Likewise also these [filthy] dreamers defile the flesh, despise dominion, and speak evil of dignities.", "9": "Yet Michael the archangel, when contending with the devil he disputed about the body of Moses, durst not bring against him a railing accusation, but said, The Lord rebuke thee.", "10": "But these speak evil of those things which they know not: but what they know naturally, as brute beasts, in those things they corrupt themselves.", "11": "Woe unto them! for they have gone in the way of Cain, and ran greedily after the error of Balaam for reward, and perished in the gainsaying of Core.", "12": "These are spots in your feasts of charity, when they feast with you, feeding themselves without fear: clouds [they are] without water, carried about of winds; trees whose fruit withereth, without fruit, twice dead, plucked up by the roots;", "13": "Raging waves of the sea, foaming out their own shame; wandering stars, to whom is reserved the blackness of darkness for ever.", "14": "And Enoch also, the seventh from Adam, prophesied of these, saying, Behold, the Lord cometh with ten thousands of his saints,", "15": "To execute judgment upon all, and to convince all that are ungodly among them of all their ungodly deeds which they have ungodly committed, and of all their hard [speeches] which ungodly sinners have spoken against him.", "16": "These are murmurers, complainers, walking after their own lusts; and their mouth speaketh great swelling [words,] having men's persons in admiration because of advantage.", "17": "But, beloved, remember ye the words which were spoken before of the apostles of our Lord Jesus Christ;", "18": "How that they told you there should be mockers in the last time, who should walk after their own ungodly lusts.", "19": "These be they who separate themselves, sensual, having not the Spirit.", "20": "But ye, beloved, building up yourselves on your most holy faith, praying in the Holy Ghost,", "21": "Keep yourselves in the love of God, looking for the mercy of our Lord Jesus Christ unto eternal life.", "22": "And of some have compassion, making a difference:", "23": "And others save with fear, pulling [them] out of the fire; hating even the garment spotted by the flesh.", "24": "Now unto him that is able to keep you from falling, and to present [you] faultless before the presence of his glory with exceeding joy,", "25": "To the only wise God our Saviour, [be] glory and majesty, dominion and power, both now and ever. Amen.", "mp3path": [ "Jude", "65005_0_KJV_Bible-Jude.mp3" ] }, "chapter_title": [ "The General Epistle of Jude" ] } } }
if you cut and paste this into an interactive python session, you can try the following operations:
>>> volume = 'New Testament'
>>> book = 'Jude'
>>> chapter = '1'
>>> verse = '16'
>>> print(BibleIndex[volume][book][chapter][verse])
These are murmurers, complainers, walking after their own lusts; and their mouth speaketh great swelling [words,] having men's persons in admiration because of advantage.
>>> print(BibleIndex[volume][book][chapter]['mp3path'])
['Jude', '65005_0_KJV_Bible-Jude.mp3']
>>> print(BibleIndex[volume][book][chapter]['chapter_title'])
Contending for the Faith
>>>
Hope that helps. This is information is available for the entire bible.
The audio files are located in src/data/KingJames/Audio/ChapterName/ with ChapterName like '1Samuel'
they can be opened (example 65005_0_KJV_Bible-Jude.mp3 form snippet above) with:
mp3file = self.bpath.KingJamesAudiopath / BibleIndex[volume][book][chapter]['chapter_title']
# Or
mp3file = self.bpath.KingJamesAudiopath / BibleIndex['New Testament']['Jude']['16']['mp3path']
# Then open for reading like
with mp3file.open('rb') as f:
    ...
One final note. I'm testing from a new installation, and finding some bugs. I have all but one fixed. I also
added a new program: RunMeOnce.py
which when run on a new install will set up all directories, create the json files, sownload text and audio files,
basically everything.
Even though I said I was going to take the night off, I didn't. It's 7:51 AM here in New England, and we had 2 feet of
snow last night, I am waiting for Mr. Plow, and then sleep for a while. but all will be done today, unless you would like
me to continue with adding the keys to the page dictionary (post 68:)
Quote:add volume, book and chapter to self.pages, so that when a chapter is selected,
the keys for fetching the audio file are at your fingertips.

Let me know.
Reply


Messages In This Thread
moving from tkinter to wxpython - by Barrowman - Feb-18-2018, 11:09 PM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-18-2018, 11:26 PM
RE: moving from tkinter to wxpython - by Barrowman - Feb-19-2018, 05:40 AM
RE: moving from tkinter to wxpython - by Barrowman - Feb-19-2018, 08:21 PM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-19-2018, 09:31 PM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-20-2018, 03:49 AM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-20-2018, 05:51 AM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-20-2018, 01:10 PM
RE: moving from tkinter to wxpython - by Barrowman - Feb-20-2018, 09:20 PM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-20-2018, 11:11 PM
RE: moving from tkinter to wxpython - by Barrowman - Feb-21-2018, 11:25 PM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-22-2018, 02:37 AM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-22-2018, 02:48 AM
RE: moving from tkinter to wxpython - by Barrowman - Feb-22-2018, 12:06 PM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-22-2018, 12:22 PM
RE: moving from tkinter to wxpython - by Barrowman - Feb-22-2018, 05:51 PM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-22-2018, 06:51 PM
RE: moving from tkinter to wxpython - by Barrowman - Feb-23-2018, 12:05 AM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-23-2018, 02:29 AM
RE: moving from tkinter to wxpython - by Barrowman - Feb-26-2018, 07:04 PM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-26-2018, 08:45 PM
RE: moving from tkinter to wxpython - by Barrowman - Feb-27-2018, 07:54 PM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-27-2018, 10:47 PM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-27-2018, 11:15 PM
RE: moving from tkinter to wxpython - by Barrowman - Feb-28-2018, 09:15 AM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-28-2018, 10:52 AM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-28-2018, 01:10 PM
RE: moving from tkinter to wxpython - by Barrowman - Feb-28-2018, 02:56 PM
RE: moving from tkinter to wxpython - by Larz60+ - Feb-28-2018, 05:19 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-01-2018, 02:23 AM
RE: moving from tkinter to wxpython - by Barrowman - Mar-01-2018, 01:17 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-03-2018, 10:49 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-04-2018, 12:47 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-04-2018, 01:07 AM
RE: moving from tkinter to wxpython - by Barrowman - Mar-04-2018, 07:47 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-04-2018, 01:34 AM
RE: moving from tkinter to wxpython - by Barrowman - Mar-04-2018, 03:36 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-04-2018, 10:47 AM
RE: moving from tkinter to wxpython - by Barrowman - Mar-04-2018, 01:41 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-04-2018, 04:13 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-04-2018, 05:23 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-04-2018, 06:19 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-06-2018, 10:01 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-07-2018, 04:01 AM
RE: moving from tkinter to wxpython - by Barrowman - Mar-08-2018, 01:32 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-07-2018, 10:18 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-08-2018, 11:06 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-08-2018, 01:16 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-08-2018, 05:50 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-08-2018, 06:10 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-09-2018, 02:36 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-09-2018, 02:49 AM
RE: moving from tkinter to wxpython - by Barrowman - Mar-09-2018, 09:03 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-09-2018, 05:16 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-09-2018, 06:08 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-09-2018, 06:33 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-10-2018, 04:52 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-10-2018, 08:45 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-10-2018, 08:55 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-11-2018, 06:20 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-11-2018, 09:21 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-12-2018, 01:44 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-12-2018, 03:39 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-13-2018, 04:33 AM
RE: moving from tkinter to wxpython - by Barrowman - Mar-13-2018, 10:12 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-13-2018, 05:58 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-13-2018, 02:29 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-13-2018, 11:17 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-14-2018, 09:02 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-14-2018, 12:01 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-14-2018, 08:52 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-14-2018, 10:00 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-15-2018, 02:13 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-16-2018, 01:04 AM
RE: moving from tkinter to wxpython - by Barrowman - Mar-16-2018, 09:36 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-16-2018, 10:16 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-17-2018, 07:19 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-19-2018, 03:13 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-20-2018, 08:45 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-20-2018, 10:47 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-21-2018, 12:27 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-21-2018, 03:42 AM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-21-2018, 05:37 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-23-2018, 10:58 AM
RE: moving from tkinter to wxpython - by Barrowman - Mar-23-2018, 04:49 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-23-2018, 06:14 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-23-2018, 08:15 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-23-2018, 09:43 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-24-2018, 10:10 AM
RE: moving from tkinter to wxpython - by Barrowman - Mar-24-2018, 05:11 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-24-2018, 06:30 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-24-2018, 08:28 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-24-2018, 08:58 PM
RE: moving from tkinter to wxpython - by Barrowman - Mar-24-2018, 09:41 PM
RE: moving from tkinter to wxpython - by Larz60+ - Mar-25-2018, 12:39 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020