Re: [python-win32] [ANN] pywin32 build 300 released

2020-11-14 Thread Preston Landers
Thank you so much, Mark, and to everyone else who has contributed over the years. The build environment improvements will be especially welcome. regards, -Preston On Sat, Nov 14, 2020 at 12:31 AM Mark Hammond wrote: > > Hi all, >I'm happy to announce the release of pywin32 build 300. > Signi

Re: [python-win32] pure python way to open a file with write deny for others

2020-03-06 Thread Preston Landers
Is advisory file locking an option? Such as the "portalocker" module for Python? You can have your writer process obtain an exclusive lock (and block until it's obtained), while the readers obtain shared locks for the duration of their read. Readers don't block other readers, while writers block

Re: [python-win32] Bug reporting

2018-02-25 Thread Preston Landers
Bob, Is there are reason you can't use PyODBC? https://github.com/mkleehammer/pyodbc/wiki It is more actively maintained and I've used it successfully for years. I'm curious what adodbapi is doing for you that PyODBC can't? Are you using non-SQL data sources? thanks, Preston ___

Re: [python-win32] Python - connexion to serial port

2018-01-11 Thread Preston Landers
You could have a worker thread or process that keeps the serial port open and listens for jobs on some kind of task queue. However it's not clear to me how keeping the serial port open between requests provides assurance of data integrity. On Thu, Jan 11, 2018 at 9:27 AM Schoeni, Yann wrote: >

Re: [python-win32] os.remove not deleting a file

2017-11-05 Thread Preston Landers
Generally, Windows won't let you delete a file if it's open somewhere, whether in the same process or in another process. You said the file becomes delete-able when you kill python, so I'm guessing that another part of your program (not shown) is holding the file open? You can always use something

Re: [python-win32] Equivalence of win32com.client under Linux

2017-03-23 Thread Preston Landers
ral Manager* > belalli...@e-acta.com > Skype : belallioui > Tel : +212535749410 <+212%205357-49410> > Mobile : +212661940077 <+212%20661-940077> > www.e-acta.com > www.actaERP.com > > > 2017-03-23 14:06 GMT+00:00 Preston Landers : > > Python-Win32 is

Re: [python-win32] Inheritable sockets on Windows and multiprocessing

2016-12-08 Thread Preston Landers
. Unfortunately for me, though, the multiprocessing module now calls CreateProcess with bInheritHandles=False. This causes my scenario to fail. Here's a short test script which illustrates this problem: https://gist.github.com/Preston-Landers/712fee10fb557cf0b5592b57561a7c08 If you run with an

[python-win32] Inheritable sockets on Windows and multiprocessing

2016-12-06 Thread Preston Landers
ortunately for me, though, the multiprocessing module now calls CreateProcess with bInheritHandles=False. This causes my scenario to fail. Here's a short test script which illustrates this problem: https://gist.github.com/Preston-Landers/712fee10fb557cf0b5592b57561a7c08 If you run with an unpatched

Re: [python-win32] Tkinter newbie

2015-03-03 Thread Preston Landers
. On Tue, Mar 3, 2015 at 10:59 AM, Tim Golden wrote: > On 03/03/2015 16:50, Preston Landers wrote: > >> It's not unusual for people to think this list is for general discussion >> of Python for Windows people, rather than specifically for the PyWin32 >> package. >

Re: [python-win32] Tkinter newbie

2015-03-03 Thread Preston Landers
It's not unusual for people to think this list is for general discussion of Python for Windows people, rather than specifically for the PyWin32 package. On Tue, Mar 3, 2015 at 10:17 AM, Mark Lawrence wrote: > On 03/03/2015 08:28, John Sampson wrote: > >> I had spent a day trying to find a solut

Re: [python-win32] Using pip to install pywin32

2015-02-20 Thread Preston Landers
Actually that gist wouldn't help much since it uses pywin32, the thing we're trying to install. (derp!) There may be another way though. Possibly related: http://bugs.python.org/issue20641 On Fri, Feb 20, 2015 at 10:31 AM, Preston Landers wrote: > > I don't think pi

Re: [python-win32] Using pip to install pywin32

2015-02-20 Thread Preston Landers
> I don't think pip can run this script (it even needs admin privs!). Is there a reason it couldn't run a script that presents a UAC prompt to elevate the process? Something like this: https://gist.github.com/Preston-Landers/267391562bc96959eb41 I guess for unattended installs y

Re: [python-win32] Failing to email large attachment with Python on Windows XP

2013-02-14 Thread Preston Landers
On Thu, Feb 14, 2013 at 12:06 PM, Tim Roberts wrote: > newtechnologybooks wrote: >> >/I was able to deliver 20mb files with this script, but failed when >> />/trying 100mb files. / >> That's further evidence that you have hit >> a server limit. If you want >> to send 100MB files, you store them on

Re: [python-win32] building pywin32 for python 2.6...

2013-01-30 Thread Preston Landers
I thought you had to have Visual Studio 2008 to build Python 2.6 and extensions. You might want to confirm that VS 2010 is supported for the releases you're using. Failure to find vcvarsall.bat can be caused if you're trying to run this from a regular windows command line. Try launching the Visual

Re: [python-win32] unicode breaks win32com?

2012-10-03 Thread Preston Landers
This is probably not the "correct" answer, but you can see if it helps. At the top of your script try adding this: import sys sys.setdefaultencoding("utf-8") On Wed, Oct 3, 2012 at 4:50 PM, Matt LaPlante wrote: > I'm using win32com to query AD for the adsPath as below. It's come to my > atten

Re: [python-win32] DIR reports file timestamp and size, but os.path.getctime(), os.path.getsize() raise WindowsError [Error 5] Access is denied

2012-05-21 Thread Preston Landers
I'm guessing Microsoft set some unusual ACLs on the files for security reasons. Have you looked at the advanced security options for these files in Windows Explorer? Have you tried running the script as Administrator? If you don't really care about the files you can skip them. If for some reaso

Re: [python-win32] Passing an object to a process

2012-03-14 Thread Preston Landers
On Wed, Mar 14, 2012 at 2:55 PM, Tony Cappellini wrote: > >> >>in which objects can truly move from one process to another is >> >>recreating them in the other process.  Even fork() makes copies of >> >> everything. > > Recreating an object in another process means it's a different object, not a >

Re: [python-win32] Passing an object to a process

2012-03-14 Thread Preston Landers
Without getting into too philosophical of a discussion, the only sense in which objects can truly move from one process to another is recreating them in the other process. Even fork() makes copies of everything. Have you tried pickle or other techniques of serialization? Not sure offhand if the l

Re: [python-win32] share remote drive

2012-02-22 Thread Preston Landers
Your question is sorely lacking in detail and therefore may not draw the kind of responses you are hoping for. What, exactly, are you trying to do? Are you trying to create a Windows Share of a local drive from within Python? Are you trying to mount a remote share from Python? A literal parsing

Re: [python-win32] Issuing a command via subprocess, other methods in Windows 7

2012-02-22 Thread Preston Landers
I thought "start" wasn't an actual executable but rather a builtin command of the cmd.exe shell. Have you tried something like: scope = subprocess.Popen([r'cmd.exe', '/c start SoundRecorder'],shell = True, stdout=subprocess.PIPE) regards, Preston On Wed, Feb 22, 2012 at 1:09 AM, David Hutto wr

Re: [python-win32] encoding decoding for python2.5

2011-09-28 Thread Preston Landers
Hi, I think people might be reluctant to give you an in-depth tutorial here on security and encryption. For one thing it's not really the right place - this is the mailing list for the PyWin32 extensions and related topics, not for the general topic of securing information in databases. Also it'

Re: [python-win32] UnicodeEncodingError when print a doc file

2011-06-14 Thread Preston Landers
I think you'll have to get into the guts of the Document object to do things like that. Here's the official Word 2007 object model documentation. Any tutorials or examples you can find that use other languages like C# or VB.NET would be relevant, you just have to translate them a bit to Python. T

Re: [python-win32] Trying to get py2exe to install/work on my windows7 64 bit machine

2011-06-01 Thread Preston Landers
Looks like you downloaded the 64 bit version of py2exe but are trying to use it with the 32 bit version of Python. Either get the 64 bit version of Python 2.7, or else the 32 bit version of py2exe. good luck, Preston On Wed, Jun 1, 2011 at 11:24 AM, Jacob Kruger wrote: > When I try installin

Re: [python-win32] Python and registry access with UAC enabled

2011-04-26 Thread Preston Landers
Not sure if this solves the actual problem you're having, but I wrote a small script to relaunch a process as an admin using UAC. Hopefully this helps somehow. http://dl.dropbox.com/u/11450437/pyuac.py thanks, -Preston On Mon, Apr 25, 2011 at 8:45 PM, Michael ODonnell wrote: > I have recently

Re: [python-win32] Missing methods from result of Dispatch or EnsureDispatch

2011-02-25 Thread Preston Landers
On Fri, Feb 25, 2011 at 1:14 PM, Parand Tony Darugar wrote: > > - Outside of Ironpython, is there a reasonable way to interaction with .Net > objects/assemblies in Python? > > I haven't worked with it myself, but it looks like this is an option: http://pythonnet.sourceforge.net/ thanks, Preston

Re: [python-win32] How to specify parameters in a query using odbc

2011-02-02 Thread Preston Landers
On Wed, Feb 2, 2011 at 10:42 AM, Mike Driscoll wrote: > > Personally, I use SqlAlchemy for almost all my database work. It takes a > little longer to learn, but I find it easier to use in the long run. > > Yeah I agree with this. And if you feel the need to work with ODBC directly, consider the P

Re: [python-win32] odbc exceptions

2010-12-01 Thread Preston Landers
No, it appears you're getting a different (and expected) error now. "[ODBC Driver Manager] Data source name not found and no default driver specified in LOGIN" That means you didn't give a valid ODBC connection string when you tried to create a connection. Earlier you were getting "TypeError: e

Re: [python-win32] odbc exceptions

2010-11-30 Thread Preston Landers
That's strange. I don't get that under Python 2.6.5 and PyWin32 v214. I get the kind of error one would expect. >>> try: ... odbc.odbc("asdf") ... except: ... raise ... Traceback (most recent call last): File "", line 2, in dbi.opError: [Microsoft][ODBC Driver Manager] Data source name not f

Re: [python-win32] Problem using win32com.client.Dispatch on Win7 64bit

2010-10-15 Thread Preston Landers
The main use I've found for 64 bit Python is for running the Python ISAPI stuff under the IIS web server on 64 bit Windows. I guess technically that falls under using 64 bit COM objects. That and it helps when you need to open >4 GB files and use >2GB memory in a process. regards, -Preston On F

Re: [python-win32] Unexpected delay in printing with win32print

2010-09-16 Thread Preston Landers
Have you considered outputting your raw data to a portable file format like HTML, PDF, etc and then printing these outside of Python? Just a thought. -Preston On Thu, Sep 16, 2010 at 2:29 PM, Jerzy Wolowik wrote: > First, thank a lot for Your attention. Please don't hesitate to put digging > int

Re: [python-win32] PyWin32 sur intel xeon 64-bit

2010-07-20 Thread Preston Landers
On Tue, Jul 20, 2010 at 8:04 AM, Pro wrote: > Hi every body, > > I'm migrating from windows 32bit to 64bit on intel platform. > I wonder if PyWin32 works well on intel 64 bit? > > Is somebody in the same case here? > > > Regards, > > Bruno. > Keep in mind that "PyWin32" is the name of the produ

Re: [python-win32] unable to read mssql varchar(max)

2010-05-27 Thread Preston Landers
varchar(max) columns are like CLOBs, character large objects, and I'm not sure how well that odbc module handles them. I ended up switching to pyODBC which does handle them. Unfortunately it might not be just a drop-in replacement, and pyODBC does have its own issues. But so far it's working pr

Re: [python-win32] problems with subprocess module and env parameter

2010-04-15 Thread Preston Landers
Your PATH is a Unicode string. I'm not sure offhand if that's acceptable or not, but all the rest of the strings appear to be regular (non-unicode) strings. You could also try: import types for k, v in env.iteritems(): if type(v) is not types.StringType: print k, v hope this helps, -Presto

Re: [python-win32] zip of file using python

2010-04-08 Thread Preston Landers
If you plan to do a lot of ZIP file creation from Python, it's usually a whole lot faster, and may produce smaller files, if you call out to an external utility to do the compression instead of doing it from within the Python zipfile module. You can also pass compression arguments like -9 that pr

Re: [python-win32] MSI installer or zip file for pywin32?

2010-04-02 Thread Preston Landers
You can run unzip on the official exe installer to get a directory structure that you can copy into your build. The pywin32_postinstall.py stuff is separated out in the arhcive, and does need to be run to enable all features. Depending on what you're doing you might be able to skip all or most of

Re: [python-win32] I/O error

2010-03-22 Thread Preston Landers
Your indentation is a bit hard to read in this format, but it looks like the "for subkey in uninstall" block needs to be inside the "with open" block. When the "with open" block exits, the file is no longer open. Thus writing to a closed file will fail. On Mon, Mar 22, 2010 at 4:22 PM, travel eu

Re: [python-win32] Problem accessing GetFontData in Windows API

2010-01-22 Thread Preston Landers
> I'm trying to access the following function from the Windows API: > > http://msdn.microsoft.com/en-us/library/dd144885(VS.85).aspx > > I'm sure I'm drastically over simplifying, but I'm testing it like this: > > import win32api > print win32api.GetFontData() > > This of course errors out with

[python-win32] odbc module and Unicode string literals

2010-01-22 Thread Preston Landers
Hello all, I'm curious why the odbc module included in PyWin32 (version 214) is compiled without the Unicode flags/defines. This prevents you from using Unicode string literals in queries. By that I mean the Unicode literals are converted to the 8-bit codepage (cp1252) and any untranslatable cha

Re: [python-win32] python-win32 Digest, Vol 81, Issue 13

2009-12-13 Thread Preston Landers
On Sun, Dec 13, 2009 at 5:00 AM, wrote: > Do you have evidence that your Python code is running in multiple > threads?  I.e. are you sure this isn't just ISAPI running some cleanup > work in another thread? Oh yes. There was no doubt. I used a debugger (pydevd) to put a breakpoint at the start

Re: [python-win32] ISAPI and threading

2009-12-11 Thread Preston Landers
On Mon, Dec 7, 2009 at 5:35 PM, Mark Hammond wrote: > On 8/12/2009 9:45 AM, Preston Landers wrote: >> >> Someone had mentioned needing to restrict the worker pool to a single >> thread but indicated they didn't know how to do that. I searched >> around MSDN and

[python-win32] ISAPI and threading

2009-12-07 Thread Preston Landers
On Tue, Dec 1, 2009 at 5:33 AM, Mark Hammond wrote: > On 1/12/2009 9:13 AM, Preston Landers wrote: >> >> I just thought I'd follow up on my original post about IIS. We >> decided to go ahead and use isapi-wsgi and so far the results are very >> good. It won

Re: [python-win32] Options for running Python under IIS?

2009-11-30 Thread Preston Landers
> On 13/11/2009 4:21 AM, Randy Syring wrote: > > You may be able to use isapi-wsgi with a custom application pool to > > achieve what you are looking for. If you can restrict the application > > pool to only use one thread per process (which I am not sure how to do) > > and then use multiple proces

Re: [python-win32] Options for running Python under IIS?

2009-11-12 Thread Preston Landers
On Thu, Nov 12, 2009 at 6:32 AM, Mark Hammond wrote: > > On 12/11/2009 10:03 AM, Preston Landers wrote: >> >> 4) Use isapi-wsgi:  This seems to be getting more popular but it seems >> to use threads and I'm wondering whether this will break my app in >> subtle

[python-win32] Options for running Python under IIS?

2009-11-11 Thread Preston Landers
e this week) it'd still be awesome if we (Python) could work with the IIS FastCGI plugin with something like a python-cgi.exe. thanks, -Preston Landers - planders at gmail dot com ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32