[python-win32] Next question relating to 'better' versions
Ok, firstly, I have moved over to an email address I do actually have some control over the format of, but anyway. Aside from that, I was just wondering what versions of python would be better to actually get used to since while I am currently going through a 4th edition version of Learning Python, which is one of the books I ran across a mention of in the specific tutorial material I was looking at for Eclipse IDE etc. earlier since that's the sort of preferred IDE for some of the guys here at work who want to focus on a specific form of python development for a hand held device, but I see in that book they mention various version changes relating to some built in functions, slight syntax changes, etc., and, for example, while now looking into py2exe, I see that it currently is only meant to support up to around python 2.7 at the moment..? Another simple example was that while playing around at looking into something like a rather simple interactive fiction interpreter that was using to test various tutorial bits of material, I see that while in 3.2 I had been using the input() function, it does something a bit different if I then try execute that piece of scripting/coding via 2.7 or 2.6 - tries to do what 3.2 would call an eval() on it. That's still not the end of the world, but had currently been playing around with python 3.2 on my 2 different machines, but do also have 2.6 and 2.7 installed, but, for example, the environment variable's path variable currently refers to python 3.2, but anyway - just wondering if it's better to not rush into newer versions off-hand, since also think my boss mentioned 2.6 to me or something? Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Next question relating to 'better' versions
Cool. Thanks. I think that for now, until they maybe confirm that the plugins they'd want to include for actual use won't work with it, etc., I'll just stick to 3.2, and will also worry about turning it into standalone executables at a later stage since that's not really an issue either at this stage - more related to me just thinking about passing some small apps on to various guys who might not have python installed as such at some stage. For now am really just trying to get relatively comfortable with any syntax differences from other environments etc. have worked in the most recently (C# and PHP, and javascript), but will also just say that my one irritation with most languages has always been what I would describe as array content management, and I am so far quite impressed with python handling all it's different types of sequential data object handling, etc. - hope that terminology isn't too far off, but mean things like list, tuple, dictionary objects, etc. etc., and I do also quite like the polymorphism of object/variable types, but along with their built-in function handling/attachment. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message --- Subject: Re: [python-win32] Next question relating to 'better' versions From: Tim Golden Date: Thu, 19 May 2011 14:15:58 +0100 To: Cc: python-win32@python.org >On 19/05/2011 10:22, Jacob Kruger wrote: >> Ok, firstly, I have moved over to an email address I do actually have >> some control over the format of, but anyway. > >Thanks for doing that -- it does make a difference to those >of us reading the result :) > >[... Which version of Python? ...] > >It's a tricky one (sometimes) and an amount is determined by what >libraries or tools you want / need to use. You've mentioned py2exe >and Eclipse, and if the lack of those, for example, is a showstopper >then your decision is made. That said, PyDev (the Python "mode" for >Eclipse) does appear to support Python 3 (I can't find an outright >statement to that effect, but there are several mentions of Python3 >in their docs). Also, I don't about py2exe, but cx_freeze seems to >have versions for Python 3. > >But regardless of tools, there's the wider issue: which is better >to start off with? I think it's worth pointing out that, especially >if you're looking at 2.7 -- but even with earlier 2.x versions -- >there isn't *that* much difference. My wmi library runs >unaltered on versions from 2.4 to 3.3. I did have to make some >tiny compromises, but the point I'm making is that Python 3 is >*not* worlds away from Python 2. Whichever version you plump for >now, you'll be well-placed to use the other one if you ever need >to. > >General guidance would be: go with Python 3 if you're starting >afresh, unless you have some overriding need for a library or >tool which hasn't been ported (and which you can't easily port >yourself... it might be easier than you think). Another of my >libraries runs on both versions by virtue of running the 2to3.py >library across it on install. (The pywin32 extensions use the >same approach). > >TJG >___ >python-win32 mailing list >python-win32@python.org >http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Ok, version 2.7 is the actual one I should be using/focusing on
Ok, only major change have found/made thus far is now that have changed all the input() prompts for command line over to raw_input() for now. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Bit of a strange one using py2exe
Not 100% sure if this is for real, but almost seemed like when I tried out making use of py2exe to build an executable from a python script of mine, it didn't accept the use of a string value of exit in single quotes after it had built the executable, as in, something like the following, that would work fine in the normal interpreter rendition, now told me something along the lines of 'exit' is not defined: if act == 'exit': If I switched that over to using double quotation marks, it then seemed happy enough: if act == "exit": I'm guessing that the single quoted version is being handled slightly differently, and that there's something to do with the keyword, exit, or something since I am generally making use of single quotes/apostrophe's for various other string values, without those instances seeming to cause issues? Also, going to look through any sort of documentation can find, but, off-hand, does py2exe need you to in fact include all code etc. in one file? Just asking since am currently importing some functions from an external file, but had to in fact copy that code into the main file when trying this out as such, or else at runtime it tells me it can't find the other module to import a function from. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Next step trying to include extra/external file in py2exe output
Ok, when I now type in the following command: python setup.py py2exe with the following code in setup.py: #start code from glob import glob from distutils.core import setup import py2exe data_files = [("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*'))] setup( console=[ dict (script="mapData.py") ], data_files=[data_files], options={ "py2exe" : { "includes" : ["c:\\temp\\pythonScripts\\mapDataFn.py"] } } ) #end code It seems to be generating the following exception/error, based on the line where I assume I'm trying to tell it to include the contents of the file, mapDataFn.py? #error text from console window raise ImportError, "No module named " + qname ImportError: No module named c:\temp\pythonScripts\mapDataFn Should I rather copy that file to somewhere else, and then just tell it to do something like: "includes" : ["mapDataFn"] Or should I maybe just run an import higher up inside setup.py itself? Sorry if I'm misunderstanding anything/everything... Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] pyTTS in versions later than 2.5
I got hold of pyTTS-3.0.win32-py2.5.exe, but it seems to be like last available version off the sourceforge website - might be able to double check that one when at home, since this machine is a bit slow/unstable when it comes to certain types of web browsing, but anyway - was just wondering if it would then be feasible to do something like install python 2.5, install this plugin/module, and then somehow try to either extract it from there, or wrap it up somehow..? On the other hand, if trying to use something like pythoncom.create() to make use of a com component that doesn't seem available using it's namespace string, is it then possible to instantiate something like that using an actual file path? Asking since do have another DLL here that gives a bit more control over text-to-speech options/usage. TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] ProgID/class string for MS TTS Engine not working
The full class name for a standard TTS synth, when accessing it via .Net comes out as: System.Speech.Synthesis.SpeechSynthesizer And, that is referring to a file called System.Speech.dll, and there are unfortunately also different versions for the varying .net frameworks, but none of the 3 I found on my machine will allow me to execute the regsvr32 on them as such, and in python pythoncom.connect() tells me there's an issue with the class string. One other alternative I have gotten to work is to use the command line app from a guy called Jamal Masry's SayTools applet: http://www.empowermentzone.com/saysetup.exe And that one will alternatively make use of a screen reader, MSSAPI, etc., and I just used it with this: #code import os os.system("sayline 'hullo there...'") #end code That one uses the SayTools.dll that I would have liked to use more directly, but which windows7 doesn't seem to want to register a class name for, etc., but will now just have to look into what files etc. I'll need to copy/move around if I want to produce spoken text aside from normal output, etc. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Trying to get py2exe to install/work on my windows7 64 bit machine
When I try installing: py2exe-0.6.9.win64-py2.7.amd64.exe It tells me: Cannot install Python version 2.7 required, which was not found in the registry. Any thoughts/suggestions? When I ran: pywin32-216.win32-py2.7.exe it was quite happy to install to c:\python27 Have tried restarting machine, etc., and can't remember if ran some other scripts on my windows7 32 bit machine before it worked, but anyway. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] 'exit is not defined'
What I'm doing is trying to open a text file, but if it's not there, then I tell the code to exit(), and while it works when running the source code using the python executable, after I have run the code through py2exe, and then try testing it, I get the following message: Traceback (most recent call last): File "mapData.py", line 39, in NameError: name 'exit' is not defined The following is the actual little bit of code that's generating this after being py2exe'ed - the last line is the line number being mentioned above: try: fData = open(sMapName + ".txt", "r") except: fData = None finally: if not bool(fData): print("invalid map name - " + sMapName + ".txt"); exit() Any thoughts/ideas/alternative workarounds? Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] 'exit is not defined'
Sorry, but replying on list now as well. Either way, seems that while did have the import statement higher up in that file for the sys module, maybe there was something interfering with that, since when changed that statement to sys.exit() it's now working without any issues. And, secondly, the reason I'm using tabs to handle indentation is partly since the editor I specifically am using for python source editing prefers that for use by VI/blind guys, and that's why it suits me, but anyway... Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message --- Subject: Re: [python-win32] 'exit is not defined' From: "Amaury Forgeot d'Arc" Date: Fri, 3 Jun 2011 09:43:47 +0200 To: Jacob Kruger >Hi, > >2011/6/3 Jacob Kruger : >> What I'm doing is trying to open a text file, but if it's not there, then I >> tell the code to exit(), and while it works when running the source code >> using the python executable, after I have run the code through py2exe, and >> then try testing it, I get the following message: >> >> Traceback (most recent call last): >> File "mapData.py", line 39, in >> NameError: name 'exit' is not defined >> >> The following is the actual little bit of code that's generating this after >> being py2exe'ed - the last line is the line number being mentioned above: >> >> try: >> fData = open(sMapName + ".txt", "r") >> except: >> fData = None >> finally: >> if not bool(fData): print("invalid map name - " + sMapName + ".txt"); >> exit() >> >> >> Any thoughts/ideas/alternative workarounds? > >"exit" is in the sys module, you shoud have an "import sys" somewhere, >and then calll "sys.exit()". >Maybe you tested your script from some IDE which already does "from >sys import exit" for you? > >By the way, your code could be improved in several ways: >- don't use tabs for indentation, use spaces instead. >- "if not bool(fData)" could be rewritten as "if not fData" >- open() always return a file object, so the logic could be: > >import sys > >try: >fData = open(sMapName + ".txt", "r") >except IOError: >print("invalid map name - " + sMapName + ".txt") >sys.exit() > >I hope I did not spoil all the fun - coding with Python is fun! > >-- >Amaury Forgeot d'Arc ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Generic/simple way to make backups of objects/their states?
I know I can do a version of manual import/export process to do something like either backup all relevant attributes of some or other object to something like a CSV, or XML string rendition, and then save that to a file easily enough, but just wondering if there's any simpler way to render an object/class instance to a string rendition, and then to maybe reiterate the original object later on..? TIA (and not too important, but just wondering) Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Catching cursor keystrokes using something like msvcrt.getch() or msvcrt.getwch()
Off-hand, while those 2 functions seem to work with other keystrokes, I'm just wondering how, in a command line interface, I could capture things like cursor keystrokes, and, would also be nice if there was a simple way to do it that would work more cross platform, as opposed to only working on windows as such? If I use either of them, it seems to return a string value that when ord() it, it comes back as 224 for, for example, the up arrow keystroke - but when you then map that to a character using chr(), it returns as the letter h, and this is the same value for all four cursor/arrow keystrokes. TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] More relating to catching cursor keystrokes in command line
The following seems to actually work relatively consistently after just a bit of testing: #bit of code sample while True: sKey = msvcrt.getwch() if str(ord(sKey)) == "77": #end of code sample And then on this windows7 machine, the following are the strings that seem to match: 72 = up 75 = left 77 = right 80 = down Anyway, this is just testing, and like you said, would most likely not work too cross platform as such, but anyway. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] More relating to catching cursor keystrokes in command line
Thanks. Will check it out, but, BTW, the documentation isn't perfectly rendered as far as I'm concerned, since I find mailing lists the best place to do research on these matters, although have looked through documentation already, searched around places like codeproject, done a few google searches, etc., but didn't find a real answer until now, but, like you said, since it's not really platform independent, I think will for now leave it alone as such. Thanks again for help, either way Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Tim Roberts" To: "Python-Win32 List" Sent: Tuesday, July 05, 2011 9:20 PM Subject: Re: [python-win32] More relating to catching cursor keystrokes in command line Jacob Kruger wrote: The following seems to actually work relatively consistently after just a bit of testing: #bit of code sample while True: sKey = msvcrt.getwch() if str(ord(sKey)) == "77": #end of code sample And then on this windows7 machine, the following are the strings that seem to match: 72 = up 75 = left 77 = right 80 = down "SEEM" to match? Are you reading any of the replies in this thread? Did you read my explanation earlier? Have you read ANY of the documentation? You don't need to guess about this. The behavior of getch in DOS is well-defined. The arrow keys (ALL of the non-ASCII keys, in fact) generate TWO bytes in getch. The first byte is 224 (or hex 0xE0). That is a special code that tells you "this is the first byte of a two-byte key code). The second byte will then be the set you have posted. What on earth is the point of converting to string with "str(ord(sKey))"? Why wouldn't you just write "if ord(sKey) == 77"? So, a more general solution might be: def getKeyCode(): x = ord(msvcrt.getch()) if x != 224: return x return (x << 8) | ord(msvcrt.getch()) Now, you can tell the difference between up-arrow and the H key. k = getKeyCode() if k == ord('H'): print "H key pressed" elif k == 0xE048: print "Up-arrow pressed" Anyway, this is just testing, and like you said, would most likely not work too cross platform as such, but anyway. It DEFINITELY does not work cross-platform. That key-code sequencing is a remnant of the BIOS in PCs, and this getch behavior is leftover from MS-DOS. Linux requires an entirely different approach. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Trying to make use of pyAudiere
http://www.pyaudiere.org/ >From within either the interpreter, or from within my own .py files, it always >seems to complain about importing (internally) numpy.core.multiarray module, >but on the second import call to audiere itsself, it's fine, and works well >enough. However, when I then try to build the code into a sort of redistributable .exe file, I get notified that: MSVCP90.dll no such file or directory That is however one of the files under the MS VCRT subfolder in the dist subdirectory that none of the other, copied setup.py files used for py2exe complain about, so sort of assuming it has something to do with a referral to a version from within audiere or something. Anyway, just wondering if anyone else has made real use of pyAudiere, or something else similar enough/simple enough, without similar issues? Basically I just would like to get hold of a relatively platform independent module to let me preferably play, pan and manipulate the playback of a couple of different audio file types, but even if limited to only clean .wav files that would still be better than nothing, but anyway...? Have also looked into pygame, but it's got a lot more in it than I really need/want, and it's also given me some minor issues relating to trying to then build redistributable executables, etc., and this one really/honestly seems more suitable/more like what I actually want it for. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Trying to make use of pyAudiere
Maybe I'll check it out (pySonic) in any case. Once audiere is imported it seems to work nicely/well enough, but would be nice if could get it to import/load easily enough, but anyway. Thanks Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message --- Subject: Re: [python-win32] Trying to make use of pyAudiere From: Tony Cappellini Date: Wed, 17 Aug 2011 06:36:16 -0700 To: python-win32@python.org Cc: bandi...@gmail.com >> From: Jacob Kruger >> To: python-win32@python.org >> Subject: [python-win32] Trying to make use of pyAudiere >> Message-ID: >> Content-Type: text/plain; charset=iso-8859-1 >> >> http://www.pyaudiere.org/ >> >> >From within either the interpreter, or from within my own .py files, it >> >always seems to complain about importing (internally) numpy.core.multiarray >> >module, but on the second import call to audiere itsself, it's fine, and >> >works well enough. >> >Sadly to say, there doesn't seem to be much development for packages >which support audio processing for Python. >I hadn't heard of pyAudiere until your message was posted. PySonic was >the only other package I was aware of, but that hasn't been updated >since 2005 and only has installers for windows. >___ >python-win32 mailing list >python-win32@python.org >http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] PyCharm rather inaccessible/useless to me as such
Ok, thought would try out the 30 day demo/trial of PyCharm, but their whole interface is apparently done in something with no accessibility information in it, or something since tabbing around in interface, nothing gets mentioned to me, and not even sure if it has a menu system as such, so, for now will be sticking to text editor, or maybe try out eclipse, since that's what they want me to use here at work in any case, but anyway... Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Recurring DLL error with py2exe
Thought this problem was specific to pyaudiere, but now got same thing when tried to test using py2exe on a very small, test wxPython app to make sure it was worth focusing on this in terms of GUI's etc., but it again tells me the same thing. Typed in following command line code using sort of standard setup.py file that works on other things like my mapData IF engine, but did change the name of the .py file it should process: python setup.py py2exe The last 2 lines rendered in that window are then the following: *** finding dlls needed *** error: MSVCP90.dll: No such file or directory That specific DLL gets copied quite easily into the relevant subfolder of the dist folder when I run a similar command for my much larger, but, I suppose, simpler, mapData app, since that one doesn't try to import libraries/modules like piaudiere or wxPython as such. Any thoughts on what could really be happening here, or should I try sort out reinstalling windows7 or something...? TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Recurring DLL error with py2exe
Ok, where should I include that exclude line? I tried just copying it into the setup.py file a bit higher up, but not sure if needs to be specifically included in some part of it, and I found out if I also tried to tell it not to copy the MSVCRT subfolder it still generates that error so it must have something to do with the actual compilation processing of the external module or something, but, maybe if I just need to tell it to exclude those files from a specific spot in the setup.py file that could sort it out? Anyway, here's current source of my setup.py file: #---start of source--- from glob import glob from distutils.core import setup import py2exe dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll', 'tk84.dll', 'MSVCP90.dll', 'mswsock.dll', 'powrprof.dll'] data_files = [ ("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*')) ] #data_files= [] options = { "bundle_files": 1, "ascii": 1, # to make a smaller executable, don't include the encodings "compressed": 1, # compress the library archive } setup( # The first three parameters are not required, if at least a # 'version' is given, then a versioninfo resource is built from # them and added to the executables. version = "1.0.0", description = "testingWxPython", name = "aboutBox", options = {'py2exe': options}, # targets to build console = ["AboutBox.py"], data_files=data_files ) #---end of source--- Could it also maybe be something to do with this line?: console = ["AboutBox.py"], Since while setup.py is running in console mode, don't know if the resulting wxPython based .exe runs in a console mode window as such..? Thanks Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message --- Subject: Re: [python-win32] Recurring DLL error with py2exe From: "Werner F. Bruhin" Date: Thu, 25 Aug 2011 16:06:05 +0200 To: python-win32@python.org >Hi Jacob, > >On 08/25/2011 03:02 PM, Jacob Kruger wrote: >> Thought this problem was specific to pyaudiere, but now got same thing when >> tried to test using py2exe on a very small, test wxPython app to make sure >> it was worth focusing on this in terms of GUI's etc., but it again tells me >> the same thing. >> >> Typed in following command line code using sort of standard setup.py file >> that works on other things like my mapData IF engine, but did change the >> name of the .py file it should process: >> python setup.py py2exe >> >> The last 2 lines rendered in that window are then the following: >> *** finding dlls needed *** >> error: MSVCP90.dll: No such file or directory >> >> That specific DLL gets copied quite easily into the relevant subfolder of >> the dist folder when I run a similar command for my much larger, but, I >> suppose, simpler, mapData app, since that one doesn't try to import >> libraries/modules like piaudiere or wxPython as such. >> >> Any thoughts on what could really be happening here, or should I try sort >> out reinstalling windows7 or something...? >py2exe is getting confused on this DLL for some reason, you just need to >exclude it. > >dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', >'tcl84.dll', 'tk84.dll', 'MSVCP90.dll', 'mswsock.dll', 'powrprof.dll'] > >Additional information for wxPython and py2exe can be found on the wiki >here: > >http://wiki.wxpython.org/py2exe > >Werner > >___ >python-win32 mailing list >python-win32@python.org >http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Recurring DLL error with py2exe
Custom extensions? Not in VS.Net itsself, and aside from other general stuff on machine, it still works for the other python code, and only seems to generate this error/issue when trying to generate .exe files for these two pieces that make use of either piaudiere or now wxPython as such. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Tim Roberts" To: "Python-Win32 List" Sent: Thursday, August 25, 2011 6:57 PM Subject: Re: [python-win32] Recurring DLL error with py2exe Jacob Kruger wrote: Typed in following command line code using sort of standard setup.py file that works on other things like my mapData IF engine, but did change the name of the .py file it should process: python setup.py py2exe The last 2 lines rendered in that window are then the following: *** finding dlls needed *** error: MSVCP90.dll: No such file or directory That specific DLL gets copied quite easily into the relevant subfolder of the dist folder when I run a similar command for my much larger, but, I suppose, simpler, mapData app, since that one doesn't try to import libraries/modules like piaudiere or wxPython as such. MSVCP90.DLL is one of the DLLs caught up in the Microsoft "side-by-side" stupidity. It cannot just be copied into a destination folder, it has to be properly installed with a manifest. Do you have some custom extensions? I didn't think there were any versions of Python that were built with Visual Studio 2008. VS2010 wisely eliminates the side-by-side stuff for the CRT DLLs, so the problem goes away. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Recurring DLL error with py2exe
Thanks, Werner Adding the reference to the dll_excludes to the options dict made the py2exe setup.py now run fine. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message --- Subject: Re: [python-win32] Recurring DLL error with py2exe From: "Werner F. Bruhin" Date: Thu, 25 Aug 2011 17:57:05 +0200 To: jac...@mailzone.co.za Cc: Jacob Kruger , python-win32@python.org >On 08/25/2011 04:30 PM, Jacob Kruger wrote: >> Ok, where should I include that exclude line? >> >> I tried just copying it into the setup.py file a bit higher up, but not sure if needs to be specifically included in some part of it, and I found out if I also tried to tell it not to copy the MSVCRT subfolder it still generates that error so it must have something to do with the actual compilation processing of the external module or something, but, maybe if I just need to tell it to exclude those files from a specific spot in the setup.py file that could sort it out? >dll_exludes is a py2exe option, should we in your options dict - see below. >> Anyway, here's current source of my setup.py file: >> #---start of source--- >> from glob import glob >> from distutils.core import setup >> import py2exe >> dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll', 'tk84.dll', 'MSVCP90.dll', 'mswsock.dll', 'powrprof.dll'] >> data_files = [ >> ("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*')) >> ] >> #data_files= [] >> options = { >> "bundle_files": 1, >Option "1" is more trouble then it is worse - would recommend 2 and use >a installer such as InnoSetup to deliver a single file. Some of this is >shown/explained on the wxPython wiki. >> "ascii": 1, # to make a smaller executable, don't include the encodings >> "compressed": 1, # compress the library archive >"dll_excludes": dll_excludes, >> } >> >> setup( >> # The first three parameters are not required, if at least a >> # 'version' is given, then a versioninfo resource is built from >> # them and added to the executables. >> version = "1.0.0", >> description = "testingWxPython", >> name = "aboutBox", >> options = {'py2exe': options}, >> >> # targets to build >> console = ["AboutBox.py"], >> data_files=data_files >> ) >> #---end of source--- >> >> Could it also maybe be something to do with this line?: >> console = ["AboutBox.py"], >> >> Since while setup.py is running in console mode, don't know if the resulting wxPython based .exe runs in a console mode window as such..? >No problem, it will show a console window and a second window is opened >with the wxPython GUI. This is sometimes handy to track down some >tracebacks which don't show if you use "window". > >Werner ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Recurring DLL error with py2exe
Oh yes, and it also lets me build the .exe for the small test app making use of pyaudiere, so I can now get it to play sounds, with panning etc. quite easily - will just get some friends etc. to test this on cleaner, older versions of operating systems etc. once can upload the zip file to FTP server from home where connection is at least decent... So, thanks again, and stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message --- Subject: Re: [python-win32] Recurring DLL error with py2exe From: Jacob Kruger Date: Fri, 26 Aug 2011 09:11:06 +0200 To: >Thanks, Werner > >Adding the reference to the dll_excludes to the options dict made the >py2exe setup.py now run fine. > >Stay well > >Jacob Kruger >Blind Biker >Skype: BlindZA >'...fate had broken his body, but not his spirit...' > > >- Original Message --- > >Subject: Re: [python-win32] Recurring DLL error with py2exe > From: "Werner F. Bruhin" > Date: Thu, 25 Aug 2011 17:57:05 +0200 > To: jac...@mailzone.co.za > Cc: Jacob Kruger , > python-win32@python.org > >>On 08/25/2011 04:30 PM, Jacob Kruger wrote: >>> Ok, where should I include that exclude line? >>> >>> I tried just copying it into the setup.py file a bit higher up, but not >sure if needs to be specifically included in some part of it, and I found >out if I also tried to tell it not to copy the MSVCRT subfolder it still >generates that error so it must have something to do with the actual >compilation processing of the external module or something, but, maybe if I >just need to tell it to exclude those files from a specific spot in the >setup.py file that could sort it out? >>dll_exludes is a py2exe option, should we in your options dict - see >below. >>> Anyway, here's current source of my setup.py file: >>> #---start of source--- >>> from glob import glob >>> from distutils.core import setup >>> import py2exe >>> dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', >'tcl84.dll', 'tk84.dll', 'MSVCP90.dll', 'mswsock.dll', 'powrprof.dll'] >>> data_files = [ >>> ("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio >9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*')) >>> ] >>> #data_files= [] >>> options = { >>> "bundle_files": 1, >>Option "1" is more trouble then it is worse - would recommend 2 and use >>a installer such as InnoSetup to deliver a single file. Some of this is >>shown/explained on the wxPython wiki. >>> "ascii": 1, # to make a smaller executable, don't include the >encodings >>> "compressed": 1, # compress the library archive >>"dll_excludes": dll_excludes, >>> } >>> >>> setup( >>> # The first three parameters are not required, if at least a >>> # 'version' is given, then a versioninfo resource is built from >>> # them and added to the executables. >>> version = "1.0.0", >>> description = "testingWxPython", >>> name = "aboutBox", >>> options = {'py2exe': options}, >>> >>> # targets to build >>> console = ["AboutBox.py"], >>> data_files=data_files >>> ) >>> #---end of source--- >>> >>> Could it also maybe be something to do with this line?: >>> console = ["AboutBox.py"], >>> >>> Since while setup.py is running in console mode, don't know if the >resulting wxPython based .exe runs in a console mode window as such..? >>No problem, it will show a console window and a second window is opened >>with the wxPython GUI. This is sometimes handy to track down some >>tracebacks which don't show if you use "window". >> >>Werner > >___ >python-win32 mailing list >python-win32@python.org >http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Passing command line arguments to imported modules, or something like a session/global variable
Hi there Playing around with a module called layout-by-code that lets me generate wxPython interfaces quickly/easily, but, if I want to, for example, open a new window that then also defines it's own interface, it would be nice to be able to either pass object variables to it, that could also maybe have their content changed before focus reverts to the original/parent window, or something, and suppose could use some form of external communications channel, like a text file, a sqlite3 database file, etc., but was just wondering if there was something am missing out on, since global variable definition doesn't seem to work, etc., but anyway. Have tried playing around with 3 different ways of implementing this using just a module import statement - and that's the only one that's really stable/working at the moment - importing a module and then calling a function in it, with arguments - that one crashes out over and over again - and importing a class defined in the module file - but that one seems to get stuck/hang up a bit. I know I could more manually work around this using wxPython interface itsself more directly, but this LBC module really makes it easy/simple to almost literally spit out a usable/accessible interface quite easily/quickly at the moment. My tests are in this zip file if that means much - parentWindow.py runs tests on the child...py children - and, yes, know have again made use of tab characters for indentation, but that's also more suitable for my sort of development environment: http://www.blindza.co.za/uploads/LBC/childWindowsLBC.zip TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Somewhat GUInterface for my mapData IF/RPG engine
If you want to check it out, here's the source code, etc. - and switched over the indentation to 2 spaces instead of tabs for this archive - and you'll see that am making use of a module called lbc - layout by code - that lets me put together a relatively dynamic interface quite quickly/easily, including building new child windows/frames on the fly, etc., but anyway - has some minor limitations, but seems generally alright for some things, and it actually also makes use of wxPython FWIW - is sort of a wrapper arond parts of it. Anyway, here's the source if you want to have a look at it - starting point/file is mapDataGenerator.py - 421Kb: http://www.blindza.co.za/uploads/mapData/mapDataLBC_src/mapDataGenLBC_indent_src.zip -- Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] GUI interface for my small RPG applets
Done using a layout by code module, called LBC, but also noted that, for example, you can add standard wxPython controls as children to things like the lbc.Dialog as well if you want/need to, but anyway. The front-end is here: http://www.blindza.co.za/uploads/mapData/mapDataLBC_dist/mapDataLBC_dist.zip and, the backend/generator applet is here: http://www.blindza.co.za/uploads/mapData/mapDataLBC_dist/mapDataGenLBC_dist.zip I also have the pyc (python compiled versions), but not sure they'll work on linux/mac machines as of yet, since haven't been able to test it as of yet. However, here's the python source: http://www.blindza.co.za/uploads/mapData/mapDataLBC_src/mapDataLBC_src.zip Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] The opposite of a wxPython's SetFocus() method?
Just wondering if therre's something similar to invoking a sort of blur effect to remove focus from a control before returning it to that control? This is partly that since with a screenreader already focused on a control, it won't necessarily render/mention updates to that control by default, but might if could take focus away from the control, and then return it after having made the changes to it's contents, etc., but without (preferably) having focused on another specific screen area inbetween, since that would then also most likely get rendered inbetween, if you know what I mean. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Restart/re-run a thread
Trying out/testing the use of multiple threading.Thread objects to play sounds using winsound.PlaySound function, and in order to be able to play multiple sounds at the same time/near enough to each other, I am trying out implementing a separate thread to call the function that handles this, but just wondering about the easiest way to then restart/rerun a thread, and/or if it's really possible/viable to in fact stop a thread while/if it's running..? Have it currently set to recreate a new thread each time I want it to in fact play a sound, and while this doesn't seem to thus far have made the python.exe task start to build up it's memory usage etc. in the task manager, I would just think that you could at the least, either stop a thread if it's currently running (threading.Thread.isAlive)() function) and/or then restart it, but it seems to want to then return an exception that the thread can't be restarted? Alternatively, I suppose I could also assign each thread to a class that then replays the winsound object, or something, but just wondering in general if there's an easier way to stop/restart a Thread object/item? Lastly, it otherwise seems quite happy/comfortable to run multiple threads/play multiple sounds at the same time/near enough to each other, which is nice. TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Restart/re-run a thread
Thanks. What have also found that seems nice/usable enough is to sort of implement a class that inherits from threading.Thread, and then it runs the class's functionality in the threaded background, and you can define other functions and variables to check state if you want to - something like the following - off the top of my head: #---start of code--- import threading, time class myClass(threading.Thread): counter = -1 def __init__(self): self.counter = 0 threading.Thread.__init__(self) def getCount(self): return self.counter def run(self): while self.counter < 60: self.counter += 1 time.sleep(1) #---end of code--- The partial point is this one will be initiated, but when you then tell your instance of the class/object to start(), it sort of automatically tells itself to run(), and you can call the getCount() function to get the value of it's internal counter variable, etc. - simple example, but seems to work well enough, if you get my/the drift, and, what have pretty much found all over the 'net is that you get told not to try destroy anything manually/yourself, but anyway. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: geoff To: Jacob Kruger Cc: python-win32@python.org Sent: Thursday, October 27, 2011 3:47 PM Subject: Re: [python-win32] Restart/re-run a thread The python docs are pretty clear that there is no way to external stop a thread and this was a design decision. Typically, I have used a threading.Event to control the actions of the worker threads from a loop in the main program. Setup each worker thread as a loop using the event.wait() method to block the loop. When you are ready for all of the threads to proceed, use the controller thread and event.set(). All of the worker threads will exit the blocking state of their loop and proceed with execution. Once finished, they return to the event.wait() mode. To stop the threads, I typically use another thread.Event object called "keepgoing" and test for that at the top of the worker threads processing loop. When the threads have finished processing and you want them to stop, you can set the keepgoing event to false. The example below is from memory, so be careful; keepgoing = threading.Event() keepgoing.set() # evaluates to True startprocess = threading.Event() startprocess.clear() # evaluates to False class worker(threading.Thread): def __init__(self, keepgoing, startprocess): while keepgoing: if startprocess: ... do someprocessing here else: startprocess.wait()#blocks the thread waiting for the event to be set. Note that if you need to pass objects into the worker thread, I would suggest placing in a collections.deque. One the startprocess is set, you can use deque.pop() to take the object out of the deque in a thread safe way. Hope this helps. BTW, I am not sure if this is for education purposes or for production, but debugging threads is REALLY HARD, so make sure this is something you really need to do. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Restart/re-run a thread
Thanks. winsound.PlaySound("file.wav", winsound.SND_ASYNC) Does handle it asynchronously, but, yes, thanks for complete example. Am in any case still trying to find/get hold of a sound library of some sort that will do a bit more, like I want it to, and one called pyaudiere works fine on my windows7 32bit machine, but refuses to work on my windows7 64bit machine, same as another wrapper module called sound_lib - and main thing I would like, apart from just playing/stopping/pausing sounds is to be able to handle a little bit of 3D, like panning playback etc., but not end of the world thus far. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Ben Timby" To: Sent: Thursday, October 27, 2011 4:31 PM Subject: Re: [python-win32] Restart/re-run a thread Jacob, What you are looking at is called a thread pool. The simple case you have now is that you start a thread whenever there is work to do (playing a sound). The thread does this work, then exits. A thread pool means you have a set number of threads idling and receiving work via a queue. When work appears, they perform it and then go back to idle. There are thread pool implementations for Python that you could simply plug into your application. from multiprocessing.pool import ThreadPool http://code.activestate.com/recipes/203871-a-generic-programming-thread-pool/ In either case, if you are looking to kill off a thread midway through the work (cut off the sound before it is done playing). Then you will need to use a flag to inform the thread that you wish for it to stop playing sound. This means you need a polling loop that will play a short sample of the track and then check the flag before playing the next sample. This way the thread can exit part of the way through the sound. A thread pool will not save memory. It saves the setup/teardown of threads. This is a relatively expensive process, and if an application starts hundreds of thousands of threads during it's lifetime, this adds up. Think about it, either way, you will need a number of concurrent threads that equals the number of sounds you wish to play concurrently. This means a thread pool will have X threads active (though idle) at all times. The simple case will have X threads active (and working) only while the sounds are being played. The only real advantage of the thread pool is that it avoids setup/teardown, so it could possibly save some latency when playing a new sound. This is because a new thread does not need to be initialized, it just has to wake up and start playing the sound. You have to decide if this latency is a problem and if so, go the thread pool route. Of course, Python threads are not native threads, so I think any advantage here probably washes out. My suggestion is to stick with the simple case. A simple sound player class can do the whole task for you, and your code will be much easier to follow and debug. Throwing a thread pool into the mix will complicate things. Simple case: class PlaySound(threading.Thread): def __init__(self, sound='foobar.wav'): self.sound = sound self.running = True self.sample = 0 threading.Thread.__init__(self): self.start() def playsample(self): soundlib.play(self.sound, startms=self.sample*100, lengthms=100) self.sample += 100 def run(self): while self.running: self.playsample() def stop(self): self.running = False s = PlaySound('explosion.wav') if user_exited: s.stop() The main key here is that instead of playing the whole sound file in one shot, you play only a small portion of it between polls. This way the thread can stop mid-sound. You need to use a sound library that will support breaking a sound into multiple parts in order to achieve this. Another option here is to ditch threads altogether and find a sound library that does async playback. Let it handle this mess for you. http://docs.python.org/library/winsound.html ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Restart/re-run a thread
Will check it out, but will also just say that a few of the game libraries I have looked at already are of no interest to me, since they produce inaccessible output/interfaces, but, will look into them a bit more for sound output...:) Have also gotten hold of another, sort of TTS module/wrapper that makes use of actual screen reader voices in meantime, and which works with python 2.7, which is what am using at the moment, but anyway: http://hg.qwitter-client.net/accessible_output/ Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Ben Timby" To: "Jacob Kruger" Sent: Thursday, October 27, 2011 5:34 PM Subject: Re: [python-win32] Restart/re-run a thread Jacob, May be getting a bit off topic here :-). However, for 3D sound, look for python game libraries. For cross-platform 3D sound, it looks like you might want FMOD. There is pySonic, a python wrapper for FMOD. http://pysonic.sourceforge.net/ FMOD is non-free. However, it is gratis for non-commercial use. I am sure there are other options as well, but I suggest looking for libraries geared toward "games" since they will have the features you apparently need. Good luck! ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Ok, reinstalled complete win32 set of packages/modules and now all sound/interface elements seem to be working on this windows7 64bit machine
I installed in effectively the following order - dunno why before I seemed to need to install specifically the amr64bit installations, but anyway - what it now means is both pyaudiere and sound_lib sort of 3D sound packages will now work on this machine, under python27 32bit installation: Install packages: python-2.7.msi py2exe-0.6.9.win32-py2.7.exe pywin32-216.win32-py2.7.exe numpy-1.6.1-win32-superpack-python2.7.exe pyaudiere-0.2.win32-py2.7.msi I then installed the following packages by running their setup.py code with the install option: python setup.py install distribute-0.6.19 #http://packages.python.org/distribute/ platform_utils #http://hg.qwitter-client.net/platform_utils accessible_output #http://hg.qwitter-client.net/accessible_output sound_lib #http://hg.qwitter-client.net/sound_lib Both pyaudiere and sound_lib are sort of audio modules with some 3D support, and sound_lib seems to make use of the base24 component - you seem to just need to copy the base.dll file that's included in downloads from the following site into the relevant lib/site_packages.../sound_lib folder: http://www.un4seen.com/ Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Ok, reinstalled complete win32 set of packages/modules and now allsound/interface elements seem to be working on this windows764bit machine
Oh yes, and another module is the wxPython keyboard_handler: http://hg.qwitter-client.net/keyboard_handler Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: Jacob Kruger To: python-win32@python.org Sent: Thursday, October 27, 2011 11:01 PM Subject: [python-win32] Ok,reinstalled complete win32 set of packages/modules and now allsound/interface elements seem to be working on this windows764bit machine I installed in effectively the following order - dunno why before I seemed to need to install specifically the amr64bit installations, but anyway - what it now means is both pyaudiere and sound_lib sort of 3D sound packages will now work on this machine, under python27 32bit installation: Install packages: python-2.7.msi py2exe-0.6.9.win32-py2.7.exe pywin32-216.win32-py2.7.exe numpy-1.6.1-win32-superpack-python2.7.exe pyaudiere-0.2.win32-py2.7.msi I then installed the following packages by running their setup.py code with the install option: python setup.py install distribute-0.6.19 #http://packages.python.org/distribute/ platform_utils #http://hg.qwitter-client.net/platform_utils accessible_output #http://hg.qwitter-client.net/accessible_output sound_lib #http://hg.qwitter-client.net/sound_lib Both pyaudiere and sound_lib are sort of audio modules with some 3D support, and sound_lib seems to make use of the base24 component - you seem to just need to copy the base.dll file that's included in downloads from the following site into the relevant lib/site_packages.../sound_lib folder: http://www.un4seen.com/ Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' -- ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] MySQL connection/admin tool
Busy now building a sort of MySQL admin interface, and installed MySQL-python-1.2.3.win32-py2.7.exe, and see it includes both the basic mysql module, as well as something called MySQLdb which is some sort of a wrapper or something, but anyway. Anyway, was just wondering if there are specific ways it would be better to connect to a MySQL database/server, and if there are commonly used examples out there, since didn't seem to find any off hand, and this is starting to come together, but, just wondering..? Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] MySQL connection/admin tool
Will check it out. Thanks Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: Vernon Cole To: Jacob Kruger Cc: python-win32@python.org Sent: Friday, November 25, 2011 7:32 PM Subject: Re: [python-win32] MySQL connection/admin tool Jacob: adodbapi provides an extended dbapi 2.0 (PEP 249) connection to many databases, MySQL is one of the ones I test with regularly. It is included in pywin32. Just "import adodbapi" to use it. (You do have to install the MySQL ODBC driver.) The other packages you mention are MySQL specific, and may have more features specific to MySQL, I don't know ... I've never tried them. Examples of PEP 249 use can be found on Google search "python database api example". Examples of adodbapi use are in the "tests" folder under site_packages/adodbapi -- see also http://sourceforge.net/projects/adodbapi/ good luck -- Vernon On Fri, Nov 25, 2011 at 7:33 AM, Jacob Kruger wrote: Busy now building a sort of MySQL admin interface, and installed MySQL-python-1.2.3.win32-py2.7.exe, and see it includes both the basic mysql module, as well as something called MySQLdb which is some sort of a wrapper or something, but anyway. Anyway, was just wondering if there are specific ways it would be better to connect to a MySQL database/server, and if there are commonly used examples out there, since didn't seem to find any off hand, and this is starting to come together, but, just wondering..? Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] MySQL connection/admin tool
Ok, here seems to be quite a nice, sort of step-by-step bit of reference/tutorial material related to making use of MySQLdb, etc.: http://www.kitebird.com/articles/pydbapi.html Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: Vernon Cole To: Jacob Kruger Cc: python-win32@python.org Sent: Friday, November 25, 2011 7:32 PM Subject: Re: [python-win32] MySQL connection/admin tool Jacob: adodbapi provides an extended dbapi 2.0 (PEP 249) connection to many databases, MySQL is one of the ones I test with regularly. It is included in pywin32. Just "import adodbapi" to use it. (You do have to install the MySQL ODBC driver.) The other packages you mention are MySQL specific, and may have more features specific to MySQL, I don't know ... I've never tried them. Examples of PEP 249 use can be found on Google search "python database api example". Examples of adodbapi use are in the "tests" folder under site_packages/adodbapi -- see also http://sourceforge.net/projects/adodbapi/ good luck -- Vernon On Fri, Nov 25, 2011 at 7:33 AM, Jacob Kruger wrote: Busy now building a sort of MySQL admin interface, and installed MySQL-python-1.2.3.win32-py2.7.exe, and see it includes both the basic mysql module, as well as something called MySQLdb which is some sort of a wrapper or something, but anyway. Anyway, was just wondering if there are specific ways it would be better to connect to a MySQL database/server, and if there are commonly used examples out there, since didn't seem to find any off hand, and this is starting to come together, but, just wondering..? Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] timePlanning/logging app
Here's a page related to the first sort of version of a time/project planning app have just finished off using python, wxPython, LBC, sqlite3 etc.: http://www.blindza.co.za/work/timePlanning.htm Here's the first paragraph off that page, to give you an idea of what it is targeting: "This small piece of software is meant to let you create primary projects/areas of interest, and then, under each of them, you can create sub-projects, or specific pieces of them that you would then be performing activities with regards to. It includes general information relating to the projects, the sub-projects, and then also allows you to sort of log specific activities/actions carried out relating to specific sub-projects, including a small bit of descriptive information, as well as time period logging, since when you then get it to generate a report for time periods, based on selecting month/time ranges, it will provide totals for the projects, as well as overall activity totals, etc." ON that page, you'll find download links for the windows compiled version, as well as the Python compiled script version that should, hopefully, run on other platforms as well, but here's also a link to the actual python source file if you want to check it out: http://www.blindza.co.za/uploads/timePlanning/timePlanningSource.zip (for python guys who prefer indentation based on 2 spaces, etc., I am still using a tab character here, but could change that one around quite easily) Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Second DLL question
How easy/simple is it to actually compile python code into a DLL to be used on windows by other programming languages, etc.? I can easily enough use py2exe to generate command line apps that can be called using command line arguments, etc., but was just wondering (as well). TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Referencing a DLL, preferably using relative file path, etc.
Although have looked around, haven't found too much consistent information relating to doing something like referencing a DLL, preferably using something like a relative file path, as opposed to having it as a registered DLL through regsvr32, etc. Is this possible/simple as such? TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Query related to Python
What are you using to edit python in/with? For example, I use a text editor to create/edit python scripts/source code, so, yes, I can copy/paste quite easily, and from python interpreter in command line of windows, aside from other workarounds, I have occasionally used the alt + space bar keystroke to invoke system menu, opened up the edit submenu, done a select all, and then a similar copy to copy contents of that window to clipboard for later reference. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "amy john" To: Sent: Friday, January 27, 2012 8:25 AM Subject: [python-win32] Query related to Python Hi, My name is Nupur Jha. I have one query related to Python. [1] I would like to know if we update any python file then while saving it can we extract the updated line and paste in excel. [2] If so what all we are suppose to do. I will be thankful if I will get a positive reply from your side. Thanks & Regards Nupur Jha ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Query related to Python
OK, sorry, but didn't even know/hadn't realise there was actually something like a save button in the interpreter window... As in, you do mean what comes up/displays in command line/console window when you do something like type python into a command prompt in windows XP/windows7? I literally just use it as a command line/typing interpreter to test/try out things, and look up certain aspects of modules/objects, but maybe one of the other, sighted guys can help more...? When I want to actually edit real bits of code, in larger amounts, etc., I use a programming specific text editor, but it's again just that - a beefed up text editor program, so don't think it can really log changes, or run it's own version of source control as such - sorry. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message ----- From: "amy john" To: "Jacob Kruger" Sent: Friday, January 27, 2012 9:56 AM Subject: Re: [python-win32] Query related to Python Hi Jacob, Thanks for your reply. I am using python interpreter. I guess i will have to ellaborate more to you about my question. I need my python interpreter tool to save the updations in an excel performed by me in it as soon as I click on "Save" button. In short I want to do some coding to change the functionality of "Save" button in python interpreter. I would be obliged if you can answer my question. Thanks & Regards Nupur Jha On 1/27/12, Jacob Kruger wrote: What are you using to edit python in/with? For example, I use a text editor to create/edit python scripts/source code, so, yes, I can copy/paste quite easily, and from python interpreter in command line of windows, aside from other workarounds, I have occasionally used the alt + space bar keystroke to invoke system menu, opened up the edit submenu, done a select all, and then a similar copy to copy contents of that window to clipboard for later reference. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "amy john" To: Sent: Friday, January 27, 2012 8:25 AM Subject: [python-win32] Query related to Python Hi, My name is Nupur Jha. I have one query related to Python. [1] I would like to know if we update any python file then while saving it can we extract the updated line and paste in excel. [2] If so what all we are suppose to do. I will be thankful if I will get a positive reply from your side. Thanks & Regards Nupur Jha ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] mouse cursor coordinates
Wondering off-hand if there's a simple/easy way to obtain mouse cursor coordinates, and, also, how simple is it to interact with operating system, in terms of if the mouse cursor is in fact outside the GUI as such - if that makes sense? TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] mouse cursor coordinates
Thanks. What primarily meant is wondered if an app would only be able to get hold of mouse cursor coordinates if mouse cursor was over parts of it's interface, or would it still be able to get real coordinates, as opposed to relative coordinates even if the mouse moved out off it's interface/window, etc.? This is partly since another VI guy was asking me about a way to in fact sort of track mouse cursor movement over other parts of the operating system as such, since while you can do certain similar things using various screen reader software packages, they're not exactly what he was looking for, and this also makes me again wonder, related to second part of question, how possible would it be to do something like get the app to run off somewhere like the system tray, but still catch certain keystrokes? Alternatively, I suppose it could just run in background, but not hidden/minimised as such, but don't think that would help it catch certain keystroke combinations as such. Sorry if these are silly questions... Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Tim Roberts" To: "Python-Win32 List" Sent: Friday, February 03, 2012 8:22 PM Subject: Re: [python-win32] mouse cursor coordinates Jacob Kruger wrote: Wondering off-hand if there's a simple/easy way to obtain mouse cursor coordinates, and, also, how simple is it to interact with operating system, in terms of if the mouse cursor is in fact outside the GUI as such - if that makes sense? win32gui.GetCursorPos will return the current mouse position in screen coordinates. Your second question is not clear to me. An application does not receive mouse messages when the mouse goes outside its window, unless it is using "mouse capture". If you click on a button control and hold the mouse button down, then drag the mouse outside the button, you'll notice that the button window stays depressed until you release the mouse. That happens because the button control "captures the mouse". All mouse messages are directed only to the button until it releases capture, which it will do when the mouse button is released. Beyond that, you'll have to ask a more specific question. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] mouse cursor coordinates
Ok, just tested it using win32gui.GetCursorPos function, and it does seem to obtain coordinates outside primary window as well, so let's see - thanks. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Tim Roberts" To: "Python-Win32 List" Sent: Friday, February 03, 2012 8:22 PM Subject: Re: [python-win32] mouse cursor coordinates Jacob Kruger wrote: Wondering off-hand if there's a simple/easy way to obtain mouse cursor coordinates, and, also, how simple is it to interact with operating system, in terms of if the mouse cursor is in fact outside the GUI as such - if that makes sense? win32gui.GetCursorPos will return the current mouse position in screen coordinates. Your second question is not clear to me. An application does not receive mouse messages when the mouse goes outside its window, unless it is using "mouse capture". If you click on a button control and hold the mouse button down, then drag the mouse outside the button, you'll notice that the button window stays depressed until you release the mouse. That happens because the button control "captures the mouse". All mouse messages are directed only to the button until it releases capture, which it will do when the mouse button is released. Beyond that, you'll have to ask a more specific question. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] mouse cursor coordinates
OK, did another web search relating to this now, and found the following page: http://atcoalition.org/article/large-computer-pointerscursors Either way, there they mention that on windows, if you go to mouse pointer options, there's an option you can enable/turn on: Show location of pointer when I press the CTRL key And it apparently makes the mouse cursor turn into a relatively visible bulls eye type pointer then...? Also means that if partially sighted guys find the right .cur file to maybe replace the specifically used bullseye file with, they should easily enough be able to implement something like a large cross hair cursor based on a keystroke as such, using built in windows functionality. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Jacob Kruger" To: Sent: Friday, February 03, 2012 9:43 PM Subject: Re: [python-win32] mouse cursor coordinates Ok, just tested it using win32gui.GetCursorPos function, and it does seem to obtain coordinates outside primary window as well, so let's see - thanks. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Tim Roberts" To: "Python-Win32 List" Sent: Friday, February 03, 2012 8:22 PM Subject: Re: [python-win32] mouse cursor coordinates Jacob Kruger wrote: Wondering off-hand if there's a simple/easy way to obtain mouse cursor coordinates, and, also, how simple is it to interact with operating system, in terms of if the mouse cursor is in fact outside the GUI as such - if that makes sense? win32gui.GetCursorPos will return the current mouse position in screen coordinates. Your second question is not clear to me. An application does not receive mouse messages when the mouse goes outside its window, unless it is using "mouse capture". If you click on a button control and hold the mouse button down, then drag the mouse outside the button, you'll notice that the button window stays depressed until you release the mouse. That happens because the button control "captures the mouse". All mouse messages are directed only to the button until it releases capture, which it will do when the mouse button is released. Beyond that, you'll have to ask a more specific question. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Trying to run py2exe built/generated executables within a VMWare windows XP 32 bit instance
Trying to play around with a VMWare player virtual instance of windows XP, 32 bit, service pack 3, etc. to try out, among other things, python executables, code etc., since my primary machine is a windows7 64 bit machine, and while these executables, built using py2exe seem to run fine on actual, physically separate windows XP machines, in this instance, it comes up with something along the lines of the following: The application, appName.exe failed to launch. Try reinstalling it with a new configuration ...or something like that. Any thoughts/ideas, and is it likely that this might be somewhat specific to things like the virtual video card, sound card, memory, etc. etc. that are being used/accessed by this virtual instance of windows XP? Might also try out something like a bare minimum/basic app bit later that only makes use of python standard/system modules, since most of these make use of externally installed modules, but haven't encountered similar issues on physical machines as of yet, but anyway. Thoughts? TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Python sound playback threading control?
(back on this list now) Ok, this might be a slightly silly thought/idea/project, but, it's partly an experiment, to do with real time keystroke event handling/processing and sound playback triggering/interruption, etc., and it's sort of a starting point of something like a real-time, audio, platform game type app, done using python, and using things like sound_lib, keyboard_handler, accessible_output (those modules from http://hg.qwitter-client.net/), along with LBC (layout-by-code) module, etc. to currently handle keystrokes, and sound effect playback. However, what it comes down to is to wanting to make it possible to sort of bypass something like current sound playback, or interrupt it, and re-initiate the playback for the same object/sound file, etc. Anyway, if you'd like to have a look as such, and give me your thoughts/feedback, here's the source code thus far, in a zip file: https://dl.dropbox.com/u/13327195/platformGame.zip The two versions of the main code file are platformGame.py and platformGame-nonThreading.py. For what might also offer (minor) interest, am also making use of the class in the XmlDictObject.py file to convert XML data to and from a dictionary collection. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Python sound playback threading control?
Well, it's currently making use of the sound_lib module - not sure which API it's using as such - but am using the stream object's play_blocking() method, which seems to be meant to interrupt other playbacks, but also played around with first using the stream's stop() method, before then trying to initiate .play(), or play_blocking(), and while they all seemed to work a little differently, none of those options seemed to really handle it quite like I would have hoped for/expected, in terms of just cutting sound playback off immediately, and then initiating a new playback, or something - suppose should also test this a bit on another machine to make sure it's not the machine am currently working with a form of performance lag, or something. Alternatively, any thoughts on something simple could try using that would offer something similar in terms of just, at least being able to manipulate playback pitch, at least 2D panning, pausing/stopping on demand, etc.? And, got hold of that sound_lib module from here: http://hg.qwitter-client.net/sound_lib TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Tim Roberts" To: "Python-Win32 List" Sent: Wednesday, February 13, 2013 9:51 PM Subject: Re: [python-win32] Python sound playback threading control? Jacob Kruger wrote: However, what it comes down to is to wanting to make it possible to sort of bypass something like current sound playback, or interrupt it, and re-initiate the playback for the same object/sound file, etc It depends on what APIs you're using to play the sound. Often, you're feeding the sound in buffer by buffer, so stopping the playback is just a matter of telling your own sound thread to stop sending buffers. If you're using some other higher-level API where you just deliver a WAV file, then you'll need to check out the facilities in that API. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Python sound playback threading control?
Ok, makes some sense, and now just experimented with the restart argument of the play_blocking() method, running it inside a loop for ten times, and, it then renders like 10 repeat playbacks one after the other quite quickly, whereas, yes, if just use play(), and then use stop() inbetween, you literally only hear sound being played like once, while it still returns the result of 1 for each time. Think must, for now just experiment with combinations of something like halting/pausing keystroke handling inbetween timeframe of sound playback, if using play_blocking(), or specifically make use of play(), but also keep track of/insert something like a thread pause for keyboard handling there as well. And, yes, already had bookmarked that page of the python wiki, but haven't gotten around to looking into it in too much detail as of yet... One of the other reasons am quite happy with sound_lib thus far is it offers 2D panning, as well as frequency manipulation, for implementing minor effects on sounds as well - for example, another simple example had is where took the sound of a motorbike running sort of flatly, and by playing it in a form of looping mode, when I then changed frequency in an incremental way, it sounded literally like speeding up, etc., as such. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Tim Roberts" To: "Python-Win32 List" Sent: Thursday, February 14, 2013 8:04 PM Subject: Re: [python-win32] Python sound playback threading control? Jacob Kruger wrote: Well, it's currently making use of the sound_lib module - not sure which API it's using as such - It's a wrapper around the "BASS" library, which is itself a wrapper around the lower-level APIs. The BASS library itself is an abstraction -- it lets you think in terms of whole files, rather than individual PCM packets. As a result, you give up a certain amount of low-level control. However, you should be able to "pause" and "stop" the streaming. but am using the stream object's play_blocking() method, which seems to be meant to interrupt other playbacks, Not at all! A blocking function means that it starts the playback, and then waits until the entire file is played, so that it cannot be interrupted. If you want to interrupt things, that's exactly the WRONG interface. You should be using "play". Alternatively, any thoughts on something simple could try using that would offer something similar in terms of just, at least being able to manipulate playback pitch, at least 2D panning, pausing/stopping on demand, etc.? You've crossed a number of different domains there. You have certainly exited from the realm of "something simple". sound_lib will help you manage your streams (play, pause, stop, etc). Manipulating the pitch requires that you manipulate the sound files themselves. You will have to decode the files by hand, and run an algorithm on the decoded byte streams. 2D panning requires low-level access to the speaker configuration, which is yet another domain. You might start looking here to see if you can find the type of resources you need. http://wiki.python.org/moin/PythonInMusic -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Simple little sound mixing app that reads timing/sound data from XML file
As subject line says - current example .xml file is tracks.xml, and sound clips are in /sounds subdirectory, and it uses sound_lib to handle playback: https://dl.dropboxusercontent.com/u/13327195/soundMixing2Source.zip Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Simple little sound mixing app that reads timing/sound data from XML file
Critique is good, and will check out referral to global variable definitions, etc. Was actually using this initially as looking into processing XML file parsing, initially, and then just played with it, and, I generally just use the LBC module since it's the simplest/easiest way for me to generate layout quickly and easily, but, know should look into wx itself in more detail/depth. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: Tim Roberts To: Python-Win32 List Sent: Wednesday, November 20, 2013 03:03 AM Subject: Re: [python-win32] Simple little sound mixing app that reads timing/sound data from XML file Jacob Kruger wrote: As subject line says - current example .xml file is tracks.xml, and sound clips are in /sounds subdirectory, and it uses sound_lib to handle playback: Are you looking for critique? With the one exception of blStop in OnEvent, none of your "global" directives are necessary. As an overgeneralization, global variables are bad. That "lbc.py" module encourages you to think of your application in a rather non-Pythonic (non-wx) way, in my opinion. Usually, almost your whole app would be member functions within a class derived from wx.Dialog. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Simple little sound mixing app that reads timing/sound data from XML file
Oh yes, and considered class implementation, but, haven't bothered as of yet, since, like said, this was actually more of a form of testing/trying out XML parsing to start off with. Also, presume with regards to global keyword usage, while it may not always be required/necessary, unless you want to be 100% sure referral to something like that blStop, sort of boolean switch variable is definitely referring to correct object/element, I was maybe also just being careful, but, will have a look around for a bit more documentation regarding this side of it - sorry, but, python is also sort of like my secondary platform, so am definitely not perfect in my workings with it as such..and, things like the blStop switch variable are generally the type of thing would try use if was running something like the playback routines in another, background thread process, or something, instead of how this one is currently operating. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: Tim Roberts To: Python-Win32 List Sent: Wednesday, November 20, 2013 03:03 AM Subject: Re: [python-win32] Simple little sound mixing app that reads timing/sound data from XML file Jacob Kruger wrote: As subject line says - current example .xml file is tracks.xml, and sound clips are in /sounds subdirectory, and it uses sound_lib to handle playback: Are you looking for critique? With the one exception of blStop in OnEvent, none of your "global" directives are necessary. As an overgeneralization, global variables are bad. That "lbc.py" module encourages you to think of your application in a rather non-Pythonic (non-wx) way, in my opinion. Usually, almost your whole app would be member functions within a class derived from wx.Dialog. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] Exception handling wrapper/function for something like a whole class
Like subject line says, and while would generally prefer to implement specific pieces of error handling try...except code blocks, etc., per code/functionality section, am currently trying to figure out why a test user is experiencing issues with some code making use of things like user app data file locations, etc., and am not exactly sure how/why/when errors/exceptions are occuring, and since this is happening on something like a windows7 machine with UAC turned on, etc., and since these are currently executing/operating as sort of py2exe 'compiled' applets, it's unable to generate the sort of automatic error log files at the moment either - not sure if relevant, but, used os.chdir to try changing the sort of active/current directory to the app specific user data location early on during instantiation of the classes, etc., but, doesn't seem to affect automated error logging target location as such, and, I think the app trying to then generate those automated error log files is then also raising file system access issues itself. Anyway, while can implement try...except blocks in all of the pieces of code, event handlers, function calls etc., I would like to, for now implement something like where in PHP you can just assign your own function to be the sort of default exception/error handler at some stages, and just wondering how you could possibly do something like that for a class object/element, etc.,such that it could then handle either all, or multiple exception types, etc.? And, if am confused, or targeting the wrong approach, you are also welcome to offer better suggestions/guidelines relating to any form of exception handling approach, etc.? TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Exception handling wrapper/function for somethinglike a whole class
Ok, one thing now came across is the cgitb module, and, the following bit of code somewhere near top might help it at least log errors a bit better: import cgitb, os cgitb.enable(format="text", logdir=os.environ["APPDATA"] + \\appAuthor\\appName) That should then, hopefully, at least generate a form of error/exception log in the location I specify as logdir. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: Jacob Kruger To: python-win32@python.org Sent: Tuesday, December 17, 2013 05:44 AM Subject: [python-win32] Exception handling wrapper/function for somethinglike a whole class Like subject line says, and while would generally prefer to implement specific pieces of error handling try...except code blocks, etc., per code/functionality section, am currently trying to figure out why a test user is experiencing issues with some code making use of things like user app data file locations, etc., and am not exactly sure how/why/when errors/exceptions are occuring, and since this is happening on something like a windows7 machine with UAC turned on, etc., and since these are currently executing/operating as sort of py2exe 'compiled' applets, it's unable to generate the sort of automatic error log files at the moment either - not sure if relevant, but, used os.chdir to try changing the sort of active/current directory to the app specific user data location early on during instantiation of the classes, etc., but, doesn't seem to affect automated error logging target location as such, and, I think the app trying to then generate those automated error log files is then also raising file system access issues itself. Anyway, while can implement try...except blocks in all of the pieces of code, event handlers, function calls etc., I would like to, for now implement something like where in PHP you can just assign your own function to be the sort of default exception/error handler at some stages, and just wondering how you could possibly do something like that for a class object/element, etc.,such that it could then handle either all, or multiple exception types, etc.? And, if am confused, or targeting the wrong approach, you are also welcome to offer better suggestions/guidelines relating to any form of exception handling approach, etc.? TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' -- ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] monitoring access to files
In windows at least, I can use os.stat(sFileName) to retrieve file attributes, including modified time, accessed time, etc.? Haven't used it, but, anyway: http://docs.python.org/2/library/os.html#os.stat Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "OptiCar" To: Sent: Tuesday, December 17, 2013 11:53 AM Subject: [python-win32] monitoring access to files Hello, i've not found method or module on python to monitor access to file, on linux i've found dazuko, all i found can monitor change, deleting renaming, i've secondarly to monitor process, windows title and user operations, in my research, i found that it is possible to catch the interruption 21 or else, in scribing the adress of our code in Interrution Vector Table, i would like a code wich works in every computer for every interruptions, keyboard, mouse, files i think antivirus does done the same way, to "catch" files access. on windows we have pyhook, does any module could catch more than mouse or keyboard, and directly files access? we have to enter deep in computer works in assembler, but i think it could be done. does anybody heard a module or how could we monitor file access, independently of partition table, or system in use. thanks OptiCar ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] wxPython layout based on a form of markup?
Aside from either using layout-by-code, or just working with wxPython itself, is there any form of markup-based wxPython layout implementation known of by anyone, off-hand? As in, a way to control/handle wxPython layout using something like XML, HTML, etc. etc.? Would be perfectly OK to handle effect implementation thereafter, but, since none of the GUI designers have come across seem all that usable to me, am just wondering? Suppose could also try something like the use of iron python inside a slightly older version of MS VS.Net, and see if that could handle wxPython layout for me, and then just try move it back to a sort of stock python implementation, but, just thought might as well ask here first/anyway..? KNow there are also some sort of modules like GTK to handle implementing layout using HTML inside wrappers etc., but, haven't gotten to really trying to use those yet - have run GTK install here, nd while it's there under /python27/lib/site-packages, don't seem to be able to import it as of yet, either, and, part of reason am specifically asking about wxPython is that for UI, tkinter doesn't work well enough with screen readers/accessibility packages, and wxPython is best bet thus far, but, I work primarily in web development, so, yes, would be nice to work with web layout implementation as well... TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Win32 GUI for beginners.
Sean, I am also what some of us refer to as a blindie, and, AFAIK, wxPython is roundabout the best framework to make use of for use/compatibility with screen readers/MSAA, and, while have in past primarily used the LBC (layoub by code) wxPython wrapper module to quickly generate simple/small UI's, I am now trying to get going using wxPython properly/itself. If I may ask, what do you use to edit your python code, etc.? I use edSharp, which is a sort of blind programmers text editor, created by Jamal Masry - if tht name means much to you. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Sean Murphy" To: "Tim Roberts" Cc: Sent: Wednesday, January 01, 2014 08:52 AM Subject: Re: [python-win32] Win32 GUI for beginners. All, thanks for the information. I will look into it. In relation to Tim's comment. The reason why I want to stick to Win32 API's is because I am blind. The screen reader which allows me to use the computer does not work with Xwindow style widgets. They have to be native Windows style objects. That is the challenge I have in front of me in finding a GUI library that works with my screen reader. I do have some knowledge of Event driven, OOPS programming. But it is very basic and normally I use other peoples codes. :-) I am in the middle of writing a Telnet app to send a huge config to my router which is one of my learning steps. :-) Sean On 01/01/2014, at 7:06 AM, Tim Roberts wrote: Sean Murphy wrote: I am very very new to Python. I have read the book on programming for Windows with Python that was released in 2000. The book is very good but doesn't give me the basic information I am seeking. Since I am a beginner programmer. I want to caution you that you have an awful lot of fundamental concepts to get down before you're ready to tackle something like this. You have to learn the Python language, which means learning the concepts of class-based and object-oriented programming. After getting straight-line programming, you'll have to learn the concepts of event-driven programming, which is the paradigm used by all of the modern GUIs. Then, you'll need to learn the idiosyncracies of whatever GUI library you choose, all of which make compromises to mate with the variations in the operating systems they support. I want to create a GUI windows app with Python. The program has to use default Windows 32 or 64 bit objects. I'm curious to know what you meant by that. Do you simply mean you don't want to buy any components? Because essentially all of the major Python GUI toolkits have their own library of components that are vastly simpler to use than the SDK components. If you REALLY just want to write an MFC program in Python, it's possible to do that using pywin32, but it's not really very Python-like. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] Alternatives for 'compiling' python code into .exe
Working with python 2.7, and along with trying to implement a larger, scrolling panel, making use of wx.lib.scrolledpanel.ScrolledPanel, using wxPython 3.0, py2exe no longer seems able to 'compile' code into working .exe files for use on windows - the error message below is generated into the .log file when I try to execute the app thereafter: Traceback (most recent call last): File "sizerExperiment4.py", line 2, in File "zipextimporter.pyo", line 82, in load_module File "wx\__init__.pyo", line 45, in File "zipextimporter.pyo", line 82, in load_module File "wx\_core.pyo", line 125, in AttributeError: 'module' object has no attribute 'PROCESS_ENTER' Is there an alternative to py2exe I can try making use of? TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Alternatives for 'compiling' python code into .exe
OK, another update - took, and modified a slightly different version of the setup.py for py2exe that includes packaging MS runtime files/DLL's in library.zip, etc., and .exe output now seems to work, but anyway... Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: Jacob Kruger To: python-win32@python.org Sent: Friday, January 10, 2014 09:49 AM Subject: [python-win32] Alternatives for 'compiling' python code into .exe Working with python 2.7, and along with trying to implement a larger, scrolling panel, making use of wx.lib.scrolledpanel.ScrolledPanel, using wxPython 3.0, py2exe no longer seems able to 'compile' code into working .exe files for use on windows - the error message below is generated into the .log file when I try to execute the app thereafter: Traceback (most recent call last): File "sizerExperiment4.py", line 2, in File "zipextimporter.pyo", line 82, in load_module File "wx\__init__.pyo", line 45, in File "zipextimporter.pyo", line 82, in load_module File "wx\_core.pyo", line 125, in AttributeError: 'module' object has no attribute 'PROCESS_ENTER' Is there an alternative to py2exe I can try making use of? TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' -- ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] win32gui cursor position tracking etc.
Firstly, I know the following can retrieve mouse cursor position coordinates easily enough: import win32gui tPos = win32gui.GetCursorPos() But, while something like .GetCursorInfo looks promising, I am struggling to find more info about what the first two returned items are - one of them seems to be an integer which almost matches the same value you get returned using just .GetCursor(), but, the main thing is while the mouse cursor coordinates are useful, etc., the main thing I actually want to be able to retrieve at this stage is the current position/coordinates of either the currently focused item, or the keyboard/PC cursor - as in, for example, if your mouse is hovering higher up on screen, but, lower down you're typing text in some or other text box, etc., and, primary issue is that I would prefer to just be able to track the cursor itself, since the control elements/interface the user may be involved in using will be a separate piece of software, etc. - as in, I actually want to do something more along the lines of double checking if the computer is in active use, and, while am pretty sure wouldn't be able to intercept keystrokes - don't want to- but something similar to being able to easily track position/coordinates of mouse cursor is what am trying to implement, and issue is also that for example with forms of accessibility software like my screenreader, I might at times not really use the mouse cursor for quite a while at all, since I primarily just navigate whole operating system using cursor and tab keys, along with keyboard invocation of menu systems, control shortcut keys, etc.. Suggestions? Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] win32gui cursor position tracking etc.
Ok, figured out workaround that does pretty much what I want: win32api.GetLastInputInfo() That seems to return time stamp of last user interaction, including mouse moving, clicking, keyboard input, app switching, etc. stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: Jacob Kruger To: python-win32@python.org Sent: Tuesday, 18 February, 2014 9:59 PM Subject: [python-win32] win32gui cursor position tracking etc. Firstly, I know the following can retrieve mouse cursor position coordinates easily enough: import win32gui tPos = win32gui.GetCursorPos() But, while something like .GetCursorInfo looks promising, I am struggling to find more info about what the first two returned items are - one of them seems to be an integer which almost matches the same value you get returned using just .GetCursor(), but, the main thing is while the mouse cursor coordinates are useful, etc., the main thing I actually want to be able to retrieve at this stage is the current position/coordinates of either the currently focused item, or the keyboard/PC cursor - as in, for example, if your mouse is hovering higher up on screen, but, lower down you're typing text in some or other text box, etc., and, primary issue is that I would prefer to just be able to track the cursor itself, since the control elements/interface the user may be involved in using will be a separate piece of software, etc. - as in, I actually want to do something more along the lines of double checking if the computer is in active use, and, while am pretty sure wouldn't be able to intercept keystrokes - don't want to- but something similar to being able to easily track position/coordinates of mouse cursor is what am trying to implement, and issue is also that for example with forms of accessibility software like my screenreader, I might at times not really use the mouse cursor for quite a while at all, since I primarily just navigate whole operating system using cursor and tab keys, along with keyboard invocation of menu systems, control shortcut keys, etc.. Suggestions? Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' -- ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] win32gui cursor position tracking etc.
Thanks. Seems like this cursor is pretty much only referring to mouse/pointer cursor, and isn't the one I am actually interested in then - that one's most likely hidden from 'external'/other apps/software, but, at least that other workaround I found seems alright for now anyway. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: Tim Roberts To: Python-Win32 List Sent: Wednesday, 19 February, 2014 8:05 PM Subject: Re: [python-win32] win32gui cursor position tracking etc. Jacob Kruger wrote: ... But, while something like .GetCursorInfo looks promising, I am struggling to find more info about what the first two returned items are - one of them seems to be an integer which almost matches the same value you get returned using just .GetCursor(), ... Suggestions? You always need to remember that virtually everything exposed by the PyWin32 modules are wrappers around ordinary Win32 APIs. The master reference for Win32 APIs is the MSDN library. If you had Googled for GetCursorInfo, you'd get this page: http://msdn.microsoft.com/en-us/library/windows/desktop/ms648389.aspx which would point you to the CURSORINFO structure that has your goodies: http://msdn.microsoft.com/en-us/library/windows/desktop/ms648381.aspx -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] Getting an app to run from/in the windows system tray
In other words, would like to be able to hide the main part of the interface, and display an icon in the windows system tray, which then either offers a context menu, or else just re-displays the main part of the interface when you double-click on the system tray icon? TIA Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Getting an app to run from/in the windows system tray
Thanks - will check it out, and, it seems to pretty much do what I want if I just run it. Stay well Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." - Original Message - From: "Mark Hammond" To: "Jacob Kruger" ; Sent: Wednesday, 05 March, 2014 9:26 AM Subject: Re: [python-win32] Getting an app to run from/in the windows system tray Check out win32\Demos\win32gui_taskbar.py - it shows how to do the taskbar thing. As far as "hiding the main part of the interface", you just close those windows after creating the taskbar icon. On 5/03/2014 2:33 PM, Jacob Kruger wrote: In other words, would like to be able to hide the main part of the interface, and display an icon in the windows system tray, which then either offers a context menu, or else just re-displays the main part of the interface when you double-click on the system tray icon? TIA Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] Simple audio recording
Am playing around with a bit of a personal assistant app, that includes letting people record smallish audio notes/sound clips, etc., and am currently using pyAudio to handle recording - relatively simple/easy, etc., but, one small issue seems to be that if I use something like winsound to beep just before start recording, to sort of notify user that recording is about to start, this seems to possibly cause input/output stream issues. In other words, possible to avoid/work around, but, just wondering what guys would recommend looking into for simple little bits of audio recording of sound clips, etc.? TIA Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] Bringing an external initiated/called window to foreground/focus?
If, for example, I use something like following command line call/command to launch an instance of windows explorer, in a specific location, with a specific file highlighted/selected, the issue is that it seems to, possibly be hovering in background/not actually taking focus on my windows7 64 bit machine: explorer /select,c:\temp\testFile.txt Wondering if there's a relatively simple way to bring a specific, external window/application into foreground focus? TIA Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Bringing an external initiated/called window to foreground/focus?
Perfect! Only issue will be varying possibilities of titles for windows explorer window, but, can work around that. Thanks Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." - Original Message - From: Jim Bell To: Jacob Kruger ; python-win32 Sent: Wednesday, 19 March, 2014 1:50 PM Subject: Re: [python-win32] Bringing an external initiated/called window to foreground/focus? Find and activate it by matching its window title. import win32com.client shell = win32com.client.Dispatch('WScript.Shell') if shell.AppActivate('Explorer'): # put a better match here. print 'Did it.' On 2014-03-19 5:32 AM, Jacob Kruger wrote: If, for example, I use something like following command line call/command to launch an instance of windows explorer, in a specific location, with a specific file highlighted/selected, the issue is that it seems to, possibly be hovering in background/not actually taking focus on my windows7 64 bit machine: explorer /select,c:\temp\testFile.txt Wondering if there's a relatively simple way to bring a specific, external window/application into foreground focus? TIA Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] My bzPersonalAssistant code/project
If of interest, here are two separate download links - the one for the current source code, and the other, larger one for currently compiled windows executable etc. - bzPersonalAssistant.exe. And, since this is sort of first time am really focusing on _trying_ to use wxPython frames, dialog's etc. a bit better/properly, I would also appreciate it if you can let me know if have messed up anything specific in terms of layout, general usage, etc. - BTW, blind biker in my email signature is a fact, and I can't look at GUI interface in the 'normal' way... - and, yes, there are still other pieces of using LBC module at times, etc., but, will eventually try clear those out as well, but, that's partly why want to find out if am doing much correctly in terms of how am trying to implement wxPython GUI building/rendition. Anyway, here's the source code - total of652Kb, and starting point is bzPersonalAssistant.py : http://www.blindza.co.za/bzPersonalAssistant/bzPersonalAssistantSource.zip Otherwise, here's the windows executable version - total of 8.35Mb, and was built using cx_Freeze - executable there is bzPersonalAssistant.exe: http://www.blindza.co.za/bzPersonalAssistant/bzPersonalAssistantExecutable.zip Now, this is meant to be sort of what the name says - a smallish piece of personal assistant type of software, and currently offers you typing in, categorising and searching for text notes, lets you define categories for, and then record .wav audio clips/audio notes, using windows standard audio input source - and have already figured out how to do something like invoke lame encoder via command line to switch over to sort of ending up offering .MP3 output, but haven't bothered with that yet, since at least part of that might relate to path/location compatibility if I actually let people do much more than test this applet, but, let's see. The other categories are a form of calendar, and categorised collections of web links, and contacts, and haven't finished off documentation of much as of yet, but, for example, since this is sort of targeting VI/blind users to a certain extent - wx is AFAIC the best GUI framework in terms of python generated acdcessibility - it can also tell you certain things using forms of TTS, and should notify you on the change of hour using small synthesized sound clips from the ./sounds directory as well, but anyway. I'm making use of python 2.7, wxPython 3.0, and other non-standard python modules are things like accessible_output, a small audio recording class in there - thanks for that one - etc. etc., along with a couple of win32 specific modules at moment, but anyway. Please let me know if you look at this at all, and what you think of end-result/output/code - know/am sure there are likely to still be some unresolved bugs/glitches in there - but am still busy playing around with this - and, yes, I generally use tab character for indentation - and have left it like that in source code for now. TIA Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] My bzPersonalAssistant code/project
Thanks. BTW, the other non-standard modules am making use of, aside from wxPython 3.0 - went over to that one for help with wx.lib.scrolledpanel - include accessible_output, and sound_lib - from: http://hg.q-continuum.net Stay well Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." - Original Message - From: mc@mclaveau To: python-win32@python.org Sent: Saturday, 22 March, 2014 1:38 AM Subject: Re: [python-win32] My bzPersonalAssistant code/project Slt! Hmmm... I have downloaded the source-file. I try it, and... I found that wxPython is necessary. But, perso, I use my own GUI (based on PyWin32). I will try the exe version in a virtual computer, when I will found times. @+ -- MCi Le 22.03.14 00:03, Jacob Kruger a écrit : If of interest, here are two separate download links - the one for the current source code, and the other, larger one for currently compiled windows executable etc. - bzPersonalAssistant.exe. And, since this is sort of first time am really focusing on _trying_ to use wxPython frames, dialog's etc. a bit better/properly, I would also appreciate it if you can let me know if have messed up anything specific in terms of layout, general usage, etc. - BTW, blind biker in my email signature is a fact, and I can't look at GUI interface in the 'normal' way... - and, yes, there are still other pieces of using LBC module at times, etc., but, will eventually try clear those out as well, but, that's partly why want to find out if am doing much correctly in terms of how am trying to implement wxPython GUI building/rendition. Anyway, here's the source code - total of652Kb, and starting point is bzPersonalAssistant.py : http://www.blindza.co.za/bzPersonalAssistant/bzPersonalAssistantSource.zip Otherwise, here's the windows executable version - total of 8.35Mb, and was built using cx_Freeze - executable there is bzPersonalAssistant.exe: http://www.blindza.co.za/bzPersonalAssistant/bzPersonalAssistantExecutable.zip Now, this is meant to be sort of what the name says - a smallish piece of personal assistant type of software, and currently offers you typing in, categorising and searching for text notes, lets you define categories for, and then record .wav audio clips/audio notes, using windows standard audio input source - and have already figured out how to do something like invoke lame encoder via command line to switch over to sort of ending up offering .MP3 output, but haven't bothered with that yet, since at least part of that might relate to path/location compatibility if I actually let people do much more than test this applet, but, let's see. The other categories are a form of calendar, and categorised collections of web links, and contacts, and haven't finished off documentation of much as of yet, but, for example, since this is sort of targeting VI/blind users to a certain extent - wx is AFAIC the best GUI framework in terms of python generated acdcessibility - it can also tell you certain things using forms of TTS, and should notify you on the change of hour using small synthesized sound clips from the ./sounds directory as well, but anyway. I'm making use of python 2.7, wxPython 3.0, and other non-standard python modules are things like accessible_output, a small audio recording class in there - thanks for that one - etc. etc., along with a couple of win32 specific modules at moment, but anyway. Please let me know if you look at this at all, and what you think of end-result/output/code - know/am sure there are likely to still be some unresolved bugs/glitches in there - but am still busy playing around with this - and, yes, I generally use tab character for indentation - and have left it like that in source code for now. TIA Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 -- ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] [wxPython-users] My bzPersonalAssistant code/project
Ok, will look into newer versions, in case, but, would those package directories be the same as generated when adding them to data_files when using py2exe? As in how do you include them for referral/reference when using cx_Freeze? Or do I just copy the directories generated by sound_lib.py2exe_datafiles(), etc. to the output folder of cx_Freeze as well..? TIA Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." - Original Message - From: "James Scholes" To: Sent: Saturday, 22 March, 2014 1:22 PM Subject: Re: [wxPython-users] My bzPersonalAssistant code/project Jacob Kruger wrote: Otherwise, here's the windows executable version - total of 8.35Mb, and was built using cx_Freeze - executable there is bzPersonalAssistant.exe: http://www.blindza.co.za/bzPersonalAssistant/bzPersonalAssistantExecutable.zip You haven't packaged the lib directories that come with sound_lib and accessible_output, so your application fails to start from the executable. I'd also recommend updating to accessible_output2 from: http://hg.q-continuum.net/accessible_output2/ -- James Scholes http://twitter.com/JamesScholes ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] My bzPersonalAssistant code/project
Ok, next question - partly since I have almost no experience with trying to create/redistribute windows executables, etc. Built this app with both cx_Freeze, and now also a version using py2exe, and the cx_Freeze version doesn't want to run at all inside my one windows XP VMWare instance, which I tried to test it on, and did also try installing both 9.0 and 10.0 versions of VCRT, in case, but, still just immediately renders an error message, but, can't find any details under event viewer log, so not exactly sure what's causing this, but although can't read error dialogue much, it seems to be mentioning something about CX wrapper/packaging, or something, and if I then also build a version using py2exe, which was avoiding, since this seems to have issues with wxPython, or something since won't even do everything on my development machine - runs, but, some buttons just don't handle events, etc., with no information coming up, but, if copy that executable over to test machine, then it at least runs somewhat, but, still generates an error when I try to, for example, invoke audio recording, but, am not sure if the MS error report means much - see attachment. Anyway, was wondering if there's a general/simple way to find/figure out what libraries/preinstallations you might need to notify an end user about, or provide copies of with something like this? All my real development work in past has been related to web development, where you don't have to worry about end user environment as much... TIA Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." ÿþ<