Re: [python-win32] Creating distributable packages/installers from python code for the windows platform
Could very well be, but, for example, did now manage to get an installer sorted out using null soft NSIS scripting, and, it works fine, so, there's still something going wrong during inno setup's process, since am using the exact same .exe I compiled using pyInstaller. Will try experimenting a bit more with otehr code collections, etc. as well. Jacob Kruger Skype: BlindZA "...resistance is futile!...acceptance is versatile..." On 2024/04/26 13:06, Nikolay Spahiev wrote: On 26.04.24 г. 10:53 ч., Jacob Kruger wrote: Hi there ... But, I thought that, just maybe, if I used something like inno setup to create an installer, it might help work around that initial distribution issue, but, the odd thing is inno setups compression/packaging seems to corrupt my executable - as in, I am suddenly receiving error messages in output when running it after installation, with messages relating to something like incorrect + operator for str and None, which doesn't make sense in terms of the code, etc. - my guess is something to do with a form of character set encoding, or something along the way, in the process. We (vintech.bg) use innosetup for distributing python software made with py2exe without problems for more than 20 years. I think problem is somewhere else. Usually after disabling the antivirus software everything works as expected. HTH Niki ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] Creating distributable packages/installers from python code for the windows platform
Hi there I am quite comfortable with having used things like pyInstaller, cx_freeze and, most recently, playing around with nuitka, in tems of compiling code into a form of executable for the iwindows platform, but, there seems to be another side issue - let me explain a bit more. Firstly, while I normally focus on web-development, working with flask and/or django, where it's less of an issue since am then distributing my code, etc. to servers myself, a recent bit of development relates to creating a form of windows executable which must run as a windows background service, to carry out a form of network connectivity monitoring, and it then posts data packets to a RESTFul API every now and then, which have already put in place, using flask, which is running on an external/separate server. The issue is just that we need to install the client software on multiple call-centre workstations, all running windows 11, so I wanted to create an installation package/installer to make it easier for technicians to carry out this task. I firstly tried just compiling my code into a single executable file using pyInstaller, and, that worked fine here on my development machine, but, the test guys are telling me that kaspersky is blocking it's execution, so, even though I could tell them where to place it before-hand, and have it then carry out initial configuration tasks using things like subprocess command execution, etc., I looked into trying to sign the compiled executable, but, to obtain something like a software certificate for a once-off, relatively small project would probably be a bit too costly to make it worthwhile. This was done, initially, just using pyInstaller to compile the software since that's the one I have used the most often. But, I thought that, just maybe, if I used something like inno setup to create an installer, it might help work around that initial distribution issue, but, the odd thing is inno setups compression/packaging seems to corrupt my executable - as in, I am suddenly receiving error messages in output when running it after installation, with messages relating to something like incorrect + operator for str and None, which doesn't make sense in terms of the code, etc. - my guess is something to do with a form of character set encoding, or something along the way, in the process. I then tried switching over to cx_freeze for compiling my code, and, no output at all, and, have now just tried nuitka, in case, and, seems to not want to run executable at all, even if haven't packaged it using inno setup. In other words - sorry for long message - just wondering if any of you have ideas about how to handle this type of thing since, sorry, but I have very limited experience in terms of producing compiled packages like this, and, main thing is to try make them more-or-less distributable, even if focusing on a form of internal target market? And, if relevant, the modules am making use of in the primary operation of the software are things like requests, subprocess, dotenv, sqlalchemy, dateutil and pythonping, but anyway - don't think those could necessarily cause issues in this context? Thanks in advance -- Jacob Kruger Skype: BlindZA "...resistance is futile!...acceptance is versatile..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] PyInstaller giving me hassles the last week or so, operating under windows 11 64-bit - package required
This started happening this past week, and, while it's worked fine in the past, the moment I try to launch the pyinstaller process at all, to generate compiled output, or even if just launch it with no command line options, I receive the following error message: pkg_resources.DistributionNotFound: The 'altgraph' distribution was not found and is required by the application The full contents of the output string when I even try to just launch pyinstaller with no commands/arguments is the following: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\pythonScripts\monitoring_nssm\venv\Scripts\pyinstaller.exe\__main__.py", line 7, in File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\PyInstaller\__main__.py", line 228, in _console_script_run run() File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\PyInstaller\__main__.py", line 170, in run parser = generate_parser() ^ File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\PyInstaller\__main__.py", line 136, in generate_parser import PyInstaller.building.build_main File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\PyInstaller\building\build_main.py", line 28, in from PyInstaller.building.api import COLLECT, EXE, MERGE, PYZ File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\PyInstaller\building\api.py", line 32, in from PyInstaller.building.splash import Splash # argument type validation in EXE ^^ File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\PyInstaller\building\splash.py", line 23, in from PyInstaller.depend import bindepend File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\PyInstaller\depend\bindepend.py", line 25, in from PyInstaller.depend import dylib, utils File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\PyInstaller\depend\utils.py", line 31, in from PyInstaller.lib.modulegraph import modulegraph File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 34, in from altgraph.ObjectGraph import ObjectGraph File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\altgraph\__init__.py", line 144, in __version__ = pkg_resources.require("altgraph")[0].version ^ File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\pkg_resources\__init__.py", line 952, in require needed = self.resolve(parse_requirements(requirements)) ^^ File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\pkg_resources\__init__.py", line 813, in resolve dist = self._resolve_dist( ^^^ File "C:\pythonScripts\monitoring_nssm\venv\Lib\site-packages\pkg_resources\__init__.py", line 854, in _resolve_dist raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'altgraph' distribution was not found and is required by the application # ---end of output--- I have tried completely removing python's installation, and, reinstalling it, but, same issue more or less immediately. If I freeze pip's installed list within this specific virtual environment, it lists the following: altgraph==0.17.4 packaging==24.0 pefile==2023.2.7 pyinstaller==6.5.0 pyinstaller-hooks-contrib==2024.3 pywin32-ctypes==0.2.2 # ---end of requirements.txt--- And, if, just for testing, I launch python interpreter, and, ask it to import altgraph, it provides the same last line of error output? If relevant, this was running with python 3.11.8, under windows 11 64-bit, and, can't think of anything that specifically occurred/changed this past week, besides normal things like windows updates, etc., but, don't really think that's likely to be relevant, unless something to do with pywin32 has caused an issue? Tried replacing python 3.11 with 3.12, but, exact same issue. Also, if relevant, while running under latest up-to-date version of windows 11 64 bit, have in any case enabled case-sensitivity on the folder I store all my python code in, just in case. Thoughts? TIA -- Jacob Kruger +2782 413 4791 "Resistance is futile!...Acceptance is versatile..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Recommended web server implementation to actively run multiple flask web apps on a windows machine
Thanks. More to do with that, at times, I want to run forms of apache, for things like the adminer database management, single page .php file, while sort of running flask alongside, and, yes, generally then just run flask on a different port, but, for example, when put flask in production, more or less run it under nginx on linux servers, using nginx .conf to route requests to .sock, or via gunicorn services. So, do agree that think must try out nginx running here under windows a bit more, or play around with wsgi mod under apache properly. Thanks Jacob Kruger Skype: BlindZA "...resistance is futile!...acceptance is versatile..." On 2023/09/08 09:37, Mriswithe wrote: Not sure if this is the sort of thing you are looking for, but if what you want is a simple http server, there is an http server in Python stdlib (https://docs.python.org/3/library/http.server.html ) for simple non-prod web serving purposes, but flask will run itself in the same non-prod capacity.for development purposes. On Fri, Sep 8, 2023, 2:10 AM Jacob Kruger wrote: Vernon, this is really just for dev testing, and/or for testing a bit across machines, etc. - would also never consider running an actual production web server on windows - last time did that was a very long time ago, when classic ASP, and ASP.net, running against MSSQL server were my focus areas. Jacob Kruger Skype: BlindZA "...resistance is futile!...acceptance is versatile..." On 2023/09/07 16:04, Vernon D. Cole wrote: I highly recommend nginx. I also highly recommend NOT running a web server on Windows. On Wed, Sep 6, 2023 at 1:14 AM Jacob Kruger wrote: Hi there My primary development focus at the moment is web applications, using the flask web-framework, and, while, in development, I can just run them on different ports, etc. on my dev machine - windows 11 home 64 bit - in the past I worked with laragon or WAMPP when working with PHP development. Now, I know in theory it's possible to map something like virtual directorys/paths via apache, which is what WAMP is working with, but, was just wondering what is the recommended web server package to work with in this context? Laragon? nGinX? WAMP? XAMPP? TIA -- Jacob Kruger Skype: BlindZA "...resistance is futile!...acceptance is versatile..." ___ 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] Recommended web server implementation to actively run multiple flask web apps on a windows machine
Vernon, this is really just for dev testing, and/or for testing a bit across machines, etc. - would also never consider running an actual production web server on windows - last time did that was a very long time ago, when classic ASP, and ASP.net, running against MSSQL server were my focus areas. Jacob Kruger Skype: BlindZA "...resistance is futile!...acceptance is versatile..." On 2023/09/07 16:04, Vernon D. Cole wrote: I highly recommend nginx. I also highly recommend NOT running a web server on Windows. On Wed, Sep 6, 2023 at 1:14 AM Jacob Kruger wrote: Hi there My primary development focus at the moment is web applications, using the flask web-framework, and, while, in development, I can just run them on different ports, etc. on my dev machine - windows 11 home 64 bit - in the past I worked with laragon or WAMPP when working with PHP development. Now, I know in theory it's possible to map something like virtual directorys/paths via apache, which is what WAMP is working with, but, was just wondering what is the recommended web server package to work with in this context? Laragon? nGinX? WAMP? XAMPP? TIA -- Jacob Kruger Skype: BlindZA "...resistance is futile!...acceptance is versatile..." ___ 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] Recommended web server implementation to actively run multiple flask web apps on a windows machine
Hi there My primary development focus at the moment is web applications, using the flask web-framework, and, while, in development, I can just run them on different ports, etc. on my dev machine - windows 11 home 64 bit - in the past I worked with laragon or WAMPP when working with PHP development. Now, I know in theory it's possible to map something like virtual directorys/paths via apache, which is what WAMP is working with, but, was just wondering what is the recommended web server package to work with in this context? Laragon? nGinX? WAMP? XAMPP? TIA -- Jacob Kruger Skype: BlindZA "...resistance is futile!...acceptance is versatile..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] imap mail parsing - forms of socket timeout/EOF errors
Hi there Know haven't posted on this list for a little while now, but, thought may as well ask if any of you guys have an idea about what seems to be a pretty common issue, but, with no specific, or consistent workarounds that am finding mention of via various google searches, etc. Effectively, if trying to use either the imaplib, or the poplib modules to query a remote mail server inbox, to then parse the mail messages contents, to insert them into a postgresql database, for more efficient querying/referencing, I am, at times - not consistently at all - receiving one of the two following messages, depending on which protocol/client I was trying to make use of:- the error message/exception information am getting from imap is the following: imaplib.IMAP4.abort: command: FETCH => socket error: EOF the pop3 error message is the following: poplib.error_proto: -ERR EOF For example, if just run same code against my one test server, with just 100 messages in the inbox, it works fine every time on both protocols, but, when try run it against the live mailbox, which has over 2 million mails in it, this happens on a regular, if inconsistent basis when you try retrieving specific messages each time, based on their server-side UID/ID. So, just wondering if anyone has come across things like this before, has ideas about implementing a form of timeout, or connection renewal, or if you have ideas about additional resources could try making use of instead for this type of thing - main thing is want to be able to, initially at least, just parse all the mail contents, updating the database on a repeated basis, since this inbox receives a lot of e-mails every hour/day, and, possibly, later on, be able to retrieve or interact with mail messages as well? Thanks in advance -- Jacob Kruger +2782 413 4791 Skype: BlindZA "...resistance is futile...but, acceptance is versatile..."___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Debugging python with something like VS code, when working with flask web framework
Side note - switching over to django instead of flask, and, debugging stopping on breakpoints inside VS code seems to work a bit better, but, along the lines of that, figured out that what might work a bit better from my perspective is using python's own breakpoint() function call to invoke [pdb] in the output console, where I can then type in querying code, etc., before then typing in continue and hitting enter to let code resume execution, and, if launching execution from within VS code, then I use ctrl + F5, to launch the process without it's own debugging initiated, etc. Jacob Kruger +2782 413 4791 Skype: BlindZA "Resistance is futile...but, acceptance is versatile..." "...resistance is futile...but, acceptance is versatile..." On 2021-08-13 08:41 AM, jacob kruger wrote: Hi there I am specifically trying to sort out debugging code and processes when working with the flask web development framework, while working with VS code insiders. Now, following things like the following steps, but, specifically using an external terminal, I can get it to pause on breakpoints, etc. when executing normal code, but, when trying to run it against the flask module process, it seems to just execute the code and not manage to attach to the execution processes, etc.? Python and flask tutorial in VS code: https://code.visualstudio.com/docs/python/tutorial-flask <https://code.visualstudio.com/docs/python/tutorial-flask> Or, the more generic debugging implementation tutorial: Getting started tutorial for python and VS code: https://code.visualstudio.com/docs/python/python-tutorial#_configure-and-run-the-debugger <https://code.visualstudio.com/docs/python/python-tutorial#_configure-and-run-the-debugger> This is working on a windows 10 64 bit pro machine, and, just want to know if anyone has suggestions with regards to implementing debugging when working with web development frameworks like flask, pyramid, etc.? TIA Jacob Kruger +2782 413 4791 Skype: BlindZA "Resistance is futile...but, acceptance is versatile..." "...resistance is futile...but, acceptance is versatile..." ___ 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] Debugging python with something like VS code, when working with flask web framework
Hi there I am specifically trying to sort out debugging code and processes when working with the flask web development framework, while working with VS code insiders. Now, following things like the following steps, but, specifically using an external terminal, I can get it to pause on breakpoints, etc. when executing normal code, but, when trying to run it against the flask module process, it seems to just execute the code and not manage to attach to the execution processes, etc.? Python and flask tutorial in VS code: https://code.visualstudio.com/docs/python/tutorial-flask <https://code.visualstudio.com/docs/python/tutorial-flask> Or, the more generic debugging implementation tutorial: Getting started tutorial for python and VS code: https://code.visualstudio.com/docs/python/python-tutorial#_configure-and-run-the-debugger <https://code.visualstudio.com/docs/python/python-tutorial#_configure-and-run-the-debugger> This is working on a windows 10 64 bit pro machine, and, just want to know if anyone has suggestions with regards to implementing debugging when working with web development frameworks like flask, pyramid, etc.? TIA Jacob Kruger +2782 413 4791 Skype: BlindZA "Resistance is futile...but, acceptance is versatile..." "...resistance is futile...but, acceptance is versatile..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] Debugging python with something like VS code, when working with flask web framework
Hi there I am specifically trying to sort out debugging code and processes when working with the flask web development framework, while working with VS code insiders. Now, following things like the following steps, but, specifically using an external terminal, I can get it to pause on breakpoints, etc. when executing normal code, but, when trying to run it against the flask module process, it seems to just execute the code and not manage to attach to the execution processes, etc.? Python and flask tutorial in VS code: https://code.visualstudio.com/docs/python/tutorial-flask Or, the more generic debugging implementation tutorial - Getting started tutorial for python and VS code: https://code.visualstudio.com/docs/python/python-tutorial#_configure-and-run-the-debugger This is on a windows 10 64 bit pro machine, and, just want to know if anyone has suggestions with regards to implementing debugging when working with web development frameworks like flask, pyramid, etc.? TIA Jacob Kruger +2782 413 4791 Skype: BlindZA "Resistance is futile...but, acceptance is versatile..." "...resistance is futile...but, acceptance is versatile..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] winsound.Beep not producing any output - windows 10 2004 64 bit
Thanks, Todd - hadn't even thought about the fact that classic beep sound literally plays through the on-board speaker...been a while...LOL! Like said, not end of the world, but, will check out pyo, etc. in any case. Jacob Kruger Blind Biker Skype: BlindZA "...resistance is futile...but, acceptance is versatile..." On 2020-07-22 02:00 PM, Todd Fiske wrote: Hi Jacob, winsound.Beep() operates on the built-in computer speaker, which is not always included these days. winsound.PlaySound() plays over the sound card and whatever speakers are connected to them. You could probably find the speaker header pins on the motherboard and get a little PC speaker for a couple bucks to play the old timey square wave sounds from Beep. Alternately there are several Python synth modules that can be used to generate tones. A popular one is called pyo. Most of them are probably overkill for doing what Beep does, but they can be fun rabbit holes to explore. https://wiki.python.org/moin/PythonInMusic Todd On 7/22/20, jacob kruger wrote: Hi there Not too important, but, bit odd in that, like subject line says, using something like the following 2 lines of code produces no audio output at all: import winsound winsound.Beep(3200, 500) Not too sure when this started happening, and, if it realtes to windows version, etc., or just possibly other software have installed here, but anyway. winsound.PlaySound() function does still cooperate, so, it's not like winsound itself is messing up audio output channels, but, just wondering what could cause this, and, if there are any simple alternatives, in case I just want to use it to either generate tones based on frequencies, or use it let me know when something has finished off in the background? Jacob Kruger Skype: BlindZA "...resistance is futile...but, acceptance is versatile..." ___ 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] winsound.Beep not producing any output - windows 10 2004 64 bit
Hi there Not too important, but, bit odd in that, like subject line says, using something like the following 2 lines of code produces no audio output at all: import winsound winsound.Beep(3200, 500) Not too sure when this started happening, and, if it realtes to windows version, etc., or just possibly other software have installed here, but anyway. winsound.PlaySound() function does still cooperate, so, it's not like winsound itself is messing up audio output channels, but, just wondering what could cause this, and, if there are any simple alternatives, in case I just want to use it to either generate tones based on frequencies, or use it let me know when something has finished off in the background? Jacob Kruger Skype: BlindZA "...resistance is futile...but, acceptance is versatile..." ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Something similar to py2exe for bundling python code into single file executables, using python 3.5.1?
Ok, turns out py2exe is definitely not compatible with 3.5.x - all online forum postings came across mention that, for example, under ./Lib/site-packages/py2exe there are no files relating to py35, so, will have to look into an alternative. Stay well Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." On 2016-03-21 2:34 AM, paul_kon...@dell.com wrote: I haven't tried py2exe with Python 3.5.1 specifically, but it works just fine with Python 3.4. Give it a try. paul ... AFAIK, py2exe isn't really usable with 3.5.1, as of yet? ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] Something similar to py2exe for bundling python code into single file executables, using python 3.5.1?
Like subject lines says, just wondering what's the simplest, easiest module/add-on, etc. to use for generating something close to a single file executable file when working with python 3.5.1? cx_freeze? AFAIK, py2exe isn't really usable with 3.5.1, as of yet? 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] Implementing an instance of an external/physical .dll file?
I have a .dll pulled from following hub: https://github.com/qtnc/UniversalSpeech What's the easiest/simplest way to then implement/instantiate an instance of it working via file path? If possible, and, currently working with python 3.4, on a windows7 64 bit machine, FWIW. Stay well 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] Implementing an instance of an external/physical .dll file?
- Original Message - You can use the ctypes module to access virtually any arbitrary DLL. That's what they mean when they talk about an FFI library. There's a learning curve, but essentially anything is possible. Ok, both of the following code snippets execute without any errors/issues: from ctypes import * import os #first one uS = windll.LoadLibrary(os.path.realpath(UniversalSpeech.dll)) #second one uSc = cdll.LoadLibrary(os.path.realpath(UniversalSpeech.dll)) #end code But, issue then is that am really not sure how to then work with functions/methods 'exposed' by the instance/DLL, since if look at some of the ctypes tutorial material, it seems like you need to already know exactly what the .dll offers, etc., to then set up/implement wrappers/pointers to things like functions, etc.? Let me caution you, however, that the DLL in that release is a 32-bit DLL. If you are using 32-bit Python, you're OK. If you're using 64-bit Python, you can't use the binary. You'd have to build it from source. I specifically stick to 32-bit python, in case it will affect target, etc. -- Tim Roberts, t...@probo.com But, for example, when working with another alternative that has been registered on system, and then using win32com.client, can just make function calls, etc., but, think that one relates to that .dll having been run through an effective regsvr32? So, something along the lines of referring to it using it's ProgID: #start code import win32com.client spk = win32com.client.Dispatch(Say.Tools) spk.Say(hello world) #end code 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] Creating standalone executable
Was also going to mention pyInstaller - once it's installed, there'll be an executable in your python/scripts directory, and something like the following command line from your directory where your source is will try to generate a single file executable - something like the following: c:\python27\scripts\pyinstaller.exe scriptName.py --onefile Not sure it also works perfectly with required files/libraries, etc., and generally stick to cx_freeze myself, but, this does work for a cleaner bit of output...smile Stay well Jacob Kruger Blind Biker Skype: BlindZA Roger Wilco wants to welcome you...to the space janitor's closet... - Original Message - From: J.D. Main To: python-win32@python.org Sent: Tuesday, January 06, 2015 7:30 PM Subject: Re: [python-win32] Creating standalone executable I've had good success with PyInstaller. https://github.com/pyinstaller/pyinstaller/wiki I like it better than Py2Exe - it seems to just work without a lot of fiddling. JDM On 1/6/2015 9:59 AM, John Sampson wrote: I tried py2exe but the executable file has to be in a specific folder along with many other files that py2exe generates. It therefore cannot be placed in any folder. As far as I can see cx-freeze produces a folder, not a single file. I am looking for a way of producing a single executable file that can be run in any folder, and nothing else - that is, standalone. Regards John Sampson On 06/01/2015 13:07, Graeme Glass wrote: Yes it is. http://www.py2exe.org/ http://cx-freeze.sourceforge.net/ On 6 January 2015 at 14:50, John Sampson jrs@ntlworld.com wrote: Is it possible to create a standalone executable (.EXE file) from a Python script? By 'standalone' I mean an executable file that can be placed in any folder and contains or finds the libraries, modules etc. that it depends on. Regards John Sampson ___ 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 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] Python version itself
I have thus far been working with python 2.7, for no particular reason aside from that it's been stable/comfortable/usable from when I really got going with python, but, while think latest release version of python is something like 3.4, what are the reasons, if any, for sticking to/with the older version for a while longer? Cross platform compatibility? Code updates it will require if moving older code over to newer interpreter, 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
Re: [python-win32] Python version itself
Thanks. And, yes, know it wasn't specifically python-win32 specific smile, but, in terms of platform compatibility, my primary issue thus far has been generating windows executables while making use of various external modules, and one of the new releases along the lines of this is a newer version of py2exe, but, only for python 3.3 upwards, and that's pretty much why even considered moving over to newer version of python itself, but, on other hand, seems am managing to work with what I want to most of the time, using python 2.7 and cx_freeze to then generate executables to pass on to end users, on different versions of windows itself, using workarounds like my relatively recent issue with MP3 playback, etc. Stay well Jacob Kruger Blind Biker Skype: BlindZA Roger Wilco wants to welcome you...to the space janitor's closet... - Original Message - From: Bob Hood To: Jacob Kruger ; python-win32@python.org Sent: Sunday, 11 May, 2014 11:09 PM Subject: Re: [python-win32] Python version itself On 5/11/2014 2:39 PM, Jacob Kruger wrote: I have thus far been working with python 2.7, for no particular reason aside from that it's been stable/comfortable/usable from when I really got going with python, but, while think latest release version of python is something like 3.4, what are the reasons, if any, for sticking to/with the older version for a while longer? Cross platform compatibility? Code updates it will require if moving older code over to newer interpreter, etc.? Kind of off topic, but what the heck, I'm bored today. :) Typically, it's dependencies and the cost of the effort to address them. Python 3.x literally made language changes that have the potential to break existing 2.7.x scripts, and I'd imagine the 2.7.x line still has a huge amount of production dependency (I know it does for us). You can spend the time retooling your product, and introduce the one-way upgrade in a new release, but that trickles down to your customers, forcing them to spend time updating any collection of Python tools they themselves may have created. Personally, I've not seen anything in Python 3.x that is sexy enough to make me want to put forth the effort. I have yet to run into something I cannot accomplish using 2.7.x that 3.x makes possible (which is likely another reason that the transition is so slow). ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
[python-win32] pycon 2014
https://www.youtube.com/results?search_query=pycon+2014 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] Audio file playback solution
Will definitely look into/play with that part of it a bit, and, main thing, for now anyway, is that at least it lets me compile this into an executable, along with the implementation/use of a wxPython GUI...smile Stay well Jacob Kruger Blind Biker Skype: BlindZA Roger Wilco wants to welcome you...to the space janitor's closet... - Original Message - From: Todd Fiske To: python-win32@python.org Sent: Monday, 28 April, 2014 2:25 AM Subject: Re: [python-win32] Audio file playback solution Hi Jacob, The mp3play module is just a wrapper around the Windows Media Control Interface [1]. I use it in a basic (wonky) AudioPlayer module I wrote that combines it with a Tkinter frame. If you dig into it's windows.py module, you'll see that it works by sending command strings with the mciSendStringA Windows API function. My brief reading of the manual for the setaudio command [2] says that it supports separate values for left and right channels. It would take some experimentation but you could work out panning by controlling the left and right volume factors relative to each other. Todd [1] MCI (Windows) http://msdn.microsoft.com/en-us/library/windows/desktop/dd757151%28v=vs.85%29.aspx [2] setaudio command (Windows) http://msdn.microsoft.com/en-us/library/windows/desktop/dd798662%28v=vs.85%29.aspx On Sun, Apr 27, 2014 at 3:29 PM, Jacob Kruger ja...@blindza.co.za wrote: Following module does actually offer exactly what wanted - on windows platform anyway - handles MP3, WMA and WAV file formats, and I got it setup under python 2.7, and it also compiles quite happily, along with wxPython GUI, using cx_freeze - doesn't offer stereo panning, but, that's minor: https://code.google.com/p/mp3play/ 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
[python-win32] Audio file playback solution
Following module does actually offer exactly what wanted - on windows platform anyway - handles MP3, WMA and WAV file formats, and I got it setup under python 2.7, and it also compiles quite happily, along with wxPython GUI, using cx_freeze - doesn't offer stereo panning, but, that's minor: https://code.google.com/p/mp3play/ 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] Passing arguments/values back and forth between separate executables at/during runtime
Cool - will check it out. Could you possibly test the following for me though, in meantime, just to make sure the separate/external app will in fact do what I want/need it to? http://www.blindza.co.za/bzPersonalAssistant/mp3PlaybackTest.zip If you hit enter on tryMe.exe, it should just play back the MP3 file included in that zip file, but anyway. Thanks Jacob Kruger Blind Biker Skype: BlindZA Roger Wilco wants to welcome you...to the space janitor's closet... - Original Message - From: Tim Roberts To: Python-Win32 List Sent: Thursday, 24 April, 2014 12:45 AM Subject: Re: [python-win32] Passing arguments/values back and forth between separate executables at/during runtime Jacob Kruger wrote: ... Alternatively, what would maybe be a better method for passing string/numeric values back and forth between two separate executables in this style/sense? Something like peek/poke back in old days, or something like writing values to windows registry? Don't think that it should really be necessary, and think something as simple as either just passing values back and forth in temporary text files, or sqlite database files, or even just pickled python objects could do the trick, but, what do you guys think? The Google search term you want is interprocess communication. There are a number of ways to do this, although many of them tend to be system-dependent. Windows has the concept of a memory-mapped files -- essentially a chunk of memory pages that can be shared between multiple processes. That's awfully easy, but I don't know if there is a Python mapping. You'd be responsible for wrapping a communication scheme around that. Windows and Linux both have the concept of named pipes, which are very much like network sockets that don't happen to travel across a network. Heck, even a traditional TCP socket would work for your purpose. They are very easy to handle in Python, and it would even let you split your work across several computers. -- 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] Passing arguments/values back and forth between separate executables at/during runtime
Ok, since seem to have issues with compiling executables into workable/running modules using certain distribution tools, if I try to implement certain bits of functionality, but, if I sort of split the pieces up into separate apps, and compile them separately, using different sets of tools, etc., then it's just possible they'll handle their specific bits of functionality, however, will still want to be able to pass sort of arguments/values back and forth during operation/while executing, so am considering something like passing the path to something like a pair of text files to the second app as a command line argument, and then during it's operations, it can check one of them as a sort of status update argument delivery method, and then when it's completed it's operations, it could first generate the second file to thus pass output values back to first app, which could, on it's own sort of monitor for the appearance of that second text file? Alternatively, what would maybe be a better method for passing string/numeric values back and forth between two separate executables in this style/sense? Something like peek/poke back in old days, or something like writing values to windows registry? Don't think that it should really be necessary, and think something as simple as either just passing values back and forth in temporary text files, or sqlite database files, or even just pickled python objects could do the trick, but, what do you guys think? 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] Windows platform audio playback
Quick question - might have asked it in past, but not sure - but, issue is while was quite happy with using sound_lib to handle/implement playback of audio clips of iether MP3, or WAV formats, partly since it could handle minor implementation of audio effects like stereo panning, and pitch/frequency changes easily enough, as well as letting me easily set/get starting points for playback, etc., there, again seems to be an issue with dependencies, or something when I now compile the executables using cx_freeze - here's the info from a person who tested/tried out something for me: ---collected information--- cx_Freeze: Python error in main script --- Traceback (most recent call last): File c:\python27\lib\site-packages\cx_Freeze\initscripts\Console.py, line 27, in module File bzPersonal.py, line 13, in module File C:\pythonScripts\personalAssistant\bzPersonalAudioBooks.py, line 4, in module File c:\python27\lib\site-packages\sound_lib-0.6.2-py2.7.egg\sound_lib\__init__.py, line 3, in module File c:\python27\lib\site-packages\sound_lib-0.6.2-py2.7.egg\sound_lib\main.py, line 1, in module File c:\python27\lib\site-packages\sound_lib-0.6.2-py2.7.egg\sound_lib\external\__init__.py, line 2, in module File c:\python27\lib\site-packages\sound_lib-0.6.2-py2.7.egg\sound_lib\external\pybass_aac.py, line 14, in module File c:\python27\lib\site-packages\sound_lib-0.6.2-py2.7.egg\sound_lib\external\pybass.py, line 62, in module File c:\python27\lib\site-packages\platform_utils-0.24-py2.7.egg\platform_utils\libloader.py, line 32, in load_library File c:\python27\lib\site-packages\platform_utils-0.24-py2.7.egg\platform_utils\libloader.py, line 39, in _do_load File c:\python27\lib\ctypes\__init__.py, line 353, in __init__ WindowsError: [Error 126] The specified module could not be found ---end info--- Seems to me like it's not managing to load some or other external library file, but, am including the sound_lib dependency file folder collected by calling sound_lib.py2exe_datafiles(). Am however now using cx_freeze to handle compilation, since py2exe doesn't seem to handle some of the wx elements am making use of, but, had thought that that function call should still collect relevant files, and thought placing them in the sound_lib folder, in same location as executable should work - and it does on my development machines, as well as a couple of other forms of test machine have here, but, they've both got some development software installed, so not most reliable in terms of end-user testing, and, the above error info is what popped up on an actual end-user's windows7 machine, but anyway. Either way, was just wondering, aside from sorting out this specific issue, what other relatively simple/clean audio playback modules can you guys suggest that would at the very least offer forms of stereo panning, and start/stop positions - in terms of stop, would either prefer to have playback stream run in background by itself, or if really need to, could implement my own threading playback threads, as long as could then stop them when I wanted to, but, main things are stereo panning, and being at the very least able to choose the playback starting position for an audio clip, and, yes, will want tohandle both .MP3 and .wav? 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...smile - 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] 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...smile TIA Jacob Kruger Blind Biker Skype: BlindZA Roger Wilco wants to welcome you...to the space janitor's closet... ÿþ ? x m l v e r s i o n = 1 . 0 e n c o d i n g = U T F - 1 6 ? D A T A B A S E E X E N A M E = b z P e r s o n a l . e x e F I L T E R = G R A B M I _ F I L T E R _ P R I V A C Y M A T C H I N G _ F I L E N A M E = b z P e r s o n a l . e x e S I Z E = 8 9 3 9 8 0 4 C H E C K S U M = 0 x 2 C 5 5 7 D A 5 B I N _ F I L E _ V E R S I O N = 1 . 0 . 0 . 0 B I N _ P R O D U C T _ V E R S I O N = 1 . 0 . 0 . 1 P R O D U C T _ V E R S I O N = 1 . 0 F I L E _ D E S C R I P T I O N = m u l t i p l e d a t a f i e l d s U I P R O D U C T _ N A M E = d a t a f i e l d s F I L E _ V E R S I O N = 1 . 0 O R I G I N A L _ F I L E N A M E = b z P e r s o n a l . e x e V E R F I L E D A T E H I = 0 x 0 V E R F I L E D A T E L O = 0 x 0 V E R F I L E O S = 0 x 4 0 0 0 4 V E R F I L E T Y P E = 0 x 1 M O D U L E _ T Y P E = W I N 3 2 P E _ C H E C K S U M = 0 x 1 3 3 3 4 L I N K E R _ V E R S I O N = 0 x 0 U P T O _ B I N _ F I L E _ V E R S I O N = 1 . 0 . 0 . 0 U P T O _ B I N _ P R O D U C T _ V E R S I O N = 1 . 0 . 0 . 1 L I N K _ D A T E = 1 1 / 1 0 / 2 0 0 8 0 9 : 4 0 : 3 5 U P T O _ L I N K _ D A T E = 1 1 / 1 0 / 2 0 0 8 0 9 : 4 0 : 3 5 V E R _ L A N G U A G E = E n g l i s h ( U n i t e d S t a t e s ) [ 0 x 4 0 9 ] / M A T C H I N G _ F I L E N A M E = w 9 x p o p e n . e x e S I Z E = 4 9 6 6 4 C H E C K S U M = 0 x 4 E 2 9 8 D A 0 M O D U L E _ T Y P E = W I N 3 2 P E _ C H E C K S U M = 0 x 1 1 E 3 E L I N K E R _ V E R S I O N = 0 x 0 L I N K _ D A T E = 0 7 / 0 4 / 2 0 1 0 0 7 : 0 1 : 5 5 U P T O _ L I N K _ D A T E = 0 7 / 0 4 / 2 0 1 0 0 7 : 0 1 : 5 5 / M A T C H I N G _ F I L E N A M E = a c c e s s i b l e _ o u t p u t \ l i b \ d o l a p i . d l l S I Z E = 1 4 4 6 3 2 C H E C K S U M = 0 x C 9 4 1 1 2 8 2 B I N _ F I L E _ V E R S I O N = 0 . 0 . 0 . 1 2 2 8 B I N _ P R O D U C T _ V E R S I O N = 0 . 0 . 0 . 1 2 2 8 P R O D U C T _ V E R S I O N = 1 2 2 8 F I L E _ D E S C R I P T I O N = T h e D o l p h i n A c c e s s S y s t e m A P I C O M P A N Y _ N A M E = D o l p h i n O c e a n i c L t d . P R O D U C T _ N A M E = S u p p o r t M o d u l e D O L A P I F I L E _ V E R S I O N = 1 2 2 8 L E G A L _ C O P Y R I G H T = © 1 9 9 8 - 2 0 1 0 D o l p h i n O c e a n i c L t d . A l l r i g h t s r e s e r v e d . V E R F I L E D A T E H I = 0 x 0 V E R F I L E D A T E L O = 0 x 0 V E R F I L E O S = 0 x 4 0 0 0 4 V E R F I L E T Y P E = 0 x 1 M O D U L E _ T Y P E = W I N 3 2 P E _ C H E C K S U M = 0 x 2 6 4 A 1 L I N K E R _ V E R S I O N = 0 x 0 U P T O _ B I N _ F I L E _ V E R S I O N = 0 . 0 . 0 . 1 2 2 8 U P T O _ B I N _ P R O D U C T _ V E R S I O N = 0 . 0 . 0 . 1 2 2 8 L I N K _ D A T E = 0 4 / 1 4 / 2 0 1 0 1 0 : 2 8 : 2 8 U P T O _ L I N K _ D A T E = 0 4 / 1 4 / 2 0 1 0 1 0 : 2 8 : 2 8 V E R _ L A N G U A G E = E n g l i s h ( U n i t e d K i n g d o m ) [ 0 x 8 0 9 ] / M A T C H I N G _ F I L E N A M E = a c c e s s i b l e _ o u t p u t \ l i b \ j f w a p
[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
[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
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 skippy.hamm...@gmail.com To: Jacob Kruger ja...@blindza.co.za; python-win32@python.org 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] 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] 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
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
[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 module File zipextimporter.pyo, line 82, in load_module File wx\__init__.pyo, line 45, in module File zipextimporter.pyo, line 82, in load_module File wx\_core.pyo, line 125, in module 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 module File zipextimporter.pyo, line 82, in load_module File wx\__init__.pyo, line 45, in module File zipextimporter.pyo, line 82, in load_module File wx\_core.pyo, line 125, in module 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
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 mhysnm1...@gmail.com To: Tim Roberts t...@probo.com Cc: python-win32@python.org 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 t...@probo.com 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] 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...smile 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] 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
[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] 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...smile 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 t...@probo.com To: Python-Win32 List python-win32@python.org 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
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 t...@probo.com To: Python-Win32 List python-win32@python.org 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
[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] 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 jac...@mailzone.co.za To: python-win32@python.org 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 t...@probo.com To: Python-Win32 List python-win32@python.org 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] 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...smile Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: Tim Roberts t...@probo.com To: Python-Win32 List python-win32@python.org 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 t...@probo.com To: Python-Win32 List python-win32@python.org 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] 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 nupur.jh...@gmail.com To: python-win32@python.org 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] 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
[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
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 jac...@mailzone.co.za 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] 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 jac...@mailzone.co.za 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] 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
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 bti...@gmail.com To: python-win32@python.org 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 bti...@gmail.com To: Jacob Kruger jac...@mailzone.co.za 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
[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
[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] 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] 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
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 werner.bru...@free.fr Date: Thu, 25 Aug 2011 17:57:05 +0200 To: jac...@mailzone.co.za Cc: Jacob Kruger blin...@gmail.com, 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...smile 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 jac...@mailzone.co.za Date: Fri, 26 Aug 2011 09:11:06 +0200 To: python-win32@python.org 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 werner.bru...@free.fr Date: Thu, 25 Aug 2011 17:57:05 +0200 To: jac...@mailzone.co.za Cc: Jacob Kruger blin...@gmail.com, 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] 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 werner.bru...@free.fr 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 t...@probo.com To: Python-Win32 List python-win32@python.org 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
[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
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 cappy2...@gmail.com Date: Wed, 17 Aug 2011 06:36:16 -0700 To: python-win32@python.org Cc: bandi...@gmail.com From: Jacob Kruger bandi...@gmail.com To: python-win32@python.org Subject: [python-win32] Trying to make use of pyAudiere Message-ID: PC1760201108161557350376609ccfbb@JacobKruger-PC 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] 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] 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 t...@probo.com To: Python-Win32 List python-win32@python.org 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] 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] 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] 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] 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] 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] 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...smile 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] 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] 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 m...@timgolden.me.uk 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