![]() |
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-20-2018 Thanks. Cloned and ran KJ_BibleApp.py. Am I missng something? Is it supposed to say the Names of the books anf chapters at the mouse hovers over them yet? Is it because of differences between WIndows and Linux? I did python3.6 RunMeOnce.py python3.6 KJ_BibleApp.pyWhich produced no sound so I tried python3.6 ScrapeAudio.py python3.6 UpdateBibleIndexAudioLinks.pyand then ran python3.6 KJ_BibleApp.pyBut still no sound. RE: moving from tkinter to wxpython - Larz60+ - Mar-21-2018 There is no sound, I fixed another problem that I had encountered, and also had to work on another project for a few days. The sound files are there, but not hooked in yet. I thought that the text should also be shown at the same time since it's all there. Almost all of this time (from the start) has been taken up on creating the dictionary that's loaded in with this code: with self.bpath.IndexedBible.open() as f: self.bible = json.load(f)at the beginning of the KJ_BibleApp.py program, and stored in the file: data/json/IndexedBible.json RE: moving from tkinter to wxpython - Larz60+ - Mar-21-2018 I'm looking for a better way to play audio, but for now will proceed with pygame.mixer. I have a post which may bring some alternatives. here's the simple test: import BiblePaths from pygame import mixer import json import os class PlayAudio: def __init__(self): self.bpath = BiblePaths.BiblePaths() with self.bpath.IndexedBible.open() as f: self.bible = json.load(f) def play_chapter(self, volume, book, chapter): mp3loc = self.bible[volume][book][chapter]['mp3path'] # found a bug, this is a hack until I fix the create program mp3loc[1] = str(mp3loc[1]).replace(' ', '_') mp3path = self.bpath.KingJamesAudiopath / mp3loc[0] / mp3loc[1] newpath = (mp3path.resolve()).as_posix() mixer.init() mixer.music.load(newpath) results = mixer.music.play() print('Press enter to quit') input() def testit(): pa = PlayAudio() pa.play_chapter('Old Testament', 'Jeremiah', '45') if __name__ == '__main__': testit() RE: moving from tkinter to wxpython - Larz60+ - Mar-21-2018 At this point, I am done for now. Code is working to the extent that you can play the audio for any book, any chapter using the GUI The repository has been reverted back to Barrowman and several programs have been changed. (So, regretfully needs to be cloned once more) Known issues:
RE: moving from tkinter to wxpython - Larz60+ - Mar-23-2018 waiting for response RE: moving from tkinter to wxpython - Barrowman - Mar-23-2018 Hi, sorry I didn't get back sooner. my wife has been very ill but improving now. I cloned the new stuff ran RunMeOnce and the KJ_BibleApp.py. Can move from one book to another with tabs but not with the buttons on any page. No sound whatsever so no way my friend can even know the program is running unfortunately. RE: moving from tkinter to wxpython - Larz60+ - Mar-23-2018 which repository did you use? If you try the PlayAudio.py does it work? And finally, check to see if OnClick (KJ_BibleApp.py) looks like: def OnClick(self, event): TargetId, pageidx, volume, book, chapter, page = event.GetEventObject().name if chapter is not None: mp3path = self.get_mp3_filepath(volume, book, str(chapter)) mixer.init() mixer.music.load(mp3path) mixer.music.play() elif TargetId is not None: self.nb.SetSelection(TargetId)I have to make a quick trip to wally mart to pick up a few things. I'll take a look when I get back. Hope to see a reply to this by then. Also, I sent you a Private Message, please respond to that. Thanks. RE: moving from tkinter to wxpython - Barrowman - Mar-23-2018 Yes, I tried the PlayAudio.py it gave no errors but also n sound. I used the Barrowman repository. I have just repeated the cloning and all the rest. The tabs work to change to different books. From each page within a particular book only the Index button works. The OnClick function is as you have asked. There is still no sound whatsoever. There are no errors reported as it runs. My old code does produce sound. RE: moving from tkinter to wxpython - Larz60+ - Mar-23-2018 See the PM. The package is dependent on relative file structure. If you change it, you will have to change the top part of BiblePaths.py (the paths area) That should be all that's required, once this has been properly done, everything, even the RunMeOnce.py module should work without a hitch. You are getting no audio because the code doesn't know where to find the files. After you make above changes, everything will work. RE: moving from tkinter to wxpython - Larz60+ - Mar-24-2018 We need to bring the discussion back on the forum. Others may be having problems as well. It's now 6:06 AM here, I'm too tired to continue until I get some sleep. Check that all dependencies (README.md) are installed. The test I ran worked without a hitch for me. Please show any errors you are encountering. I'll be back for a short while in about three hours, then again at six. |