Re: [python-win32] Recommended web server implementation to actively run multiple flask web apps on a windows machine

2023-09-07 Thread Vernon D. Cole
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


Re: [python-win32] How to search Windows file structure (with existing indexes)

2023-08-09 Thread Vernon D. Cole
For reading file directories I recommend using pathlib from the Python
standard library.

On Wed, Aug 9, 2023 at 12:40 PM Vernon D. Cole 
wrote:

> Because pywin32 is required for adodbapi to operate, it was merged into
> pywin32 several years ago. Installing a current version of pywin32 will
> install adodbapi as part of it. It will appear as a separate module in the
> Python site-packages library tree.
>
> I have never tried accessing the Windows file directory, which I think
> might be what you refer to, but I have accessed some Active Directory
> information as tables using adodbapi.
>
> In short, anything for which you can find a connection string and a driver
> ought to give you tabular data.
>
> On Tue, Aug 8, 2023 at 9:55 AM Dolezal, Vojtech 
> wrote:
>
>> Good afternoon,
>>
>> is it possible to search Windows file structure with use of indexes where
>> available?
>>
>> There seems to be package named adodbapi which supposedly allowed for
>> this, but according to its SourceForge page (
>> https://sourceforge.net/projects/adodbapi/) it is now part of pywin32.
>> However I didn't find any information about this in the pywin32
>> documentation, and I am unable to install the adodbapi package itself.
>>
>> Best regards,
>>
>> Vojtěch Doležal
>> ___
>> 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] How to search Windows file structure (with existing indexes)

2023-08-09 Thread Vernon D. Cole
Because pywin32 is required for adodbapi to operate, it was merged into
pywin32 several years ago. Installing a current version of pywin32 will
install adodbapi as part of it. It will appear as a separate module in the
Python site-packages library tree.

I have never tried accessing the Windows file directory, which I think
might be what you refer to, but I have accessed some Active Directory
information as tables using adodbapi.

In short, anything for which you can find a connection string and a driver
ought to give you tabular data.

On Tue, Aug 8, 2023 at 9:55 AM Dolezal, Vojtech 
wrote:

> Good afternoon,
>
> is it possible to search Windows file structure with use of indexes where
> available?
>
> There seems to be package named adodbapi which supposedly allowed for
> this, but according to its SourceForge page (
> https://sourceforge.net/projects/adodbapi/) it is now part of pywin32.
> However I didn't find any information about this in the pywin32
> documentation, and I am unable to install the adodbapi package itself.
>
> Best regards,
>
> Vojtěch Doležal
> ___
> 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] pywin32 Documentation

2022-12-06 Thread Vernon D. Cole
Brian:

I did not see your entry before writing mine.

Fantastic work on the adodbapi calling interfaces!

I think that there is still a need for something like the quick_reference,
so that there can be discussion about things like the extensions. The
ability to switch between paramstyles is probably still unique. There was
discussion in the dbapi community that it was impossible to do. Sometimes
that sort of thing is best presented in paragraph format.

I still have the original source for *Python Programming on Win32* (thank
you, Mark) but O'Reilly was not interested in publishing a second edition
several years ago. Perhaps it is time to ask them again.

On Tue, Dec 6, 2022 at 3:02 AM Brian Johnson  wrote:

> Hi Mark.
>
> Thank you for the feedback. My responses in-line below. Also...
>
> *Example of reformatted narrative doc*:
> Quick Start to Client side COM and Python — pywin32 305 documentation
> (brian3johnson.github.io)
> 
> *Example of api docs generated from .py docstring*:
> adodbapi package — pywin32 305 documentation (brian3johnson.github.io)
> 
> *Note: the TOC sidebar still needs work.*
>
> Thanks for your interest. I probably should have written more about
> this earlier. From my POV, the main considerations I have are:
>
> 1) Much of the documentation is inside the c++ source formatted via
> "autoduck" style comments. I really don't want to abandon this
> documentation, but I don't think it's helpful in a sphinx-based world?
>
>
> BJ > I would not want to abandon this either. I don't know much about
> Autoduck apart from gathering that it generates documentation from the C++
> source. There may be an approach using SWIG with some modifications within
> the C++ source code:
> https://www.swig.org/Doc4.1/Python.html#Python_nn65
>
> 2) There's no where near as much docs embedded in the .py code, which is
> something that we can address. However, some work has started on
> https://github.com/mhammond/pywin32/issues/1913, which hopes to add type
> annotations - see also yesterday's mail to this list on this topic.
> While I'm not quite sure exactly what approach is being suggested for
> that, it seems possible it will have at least *some* overlap here?
>
>
> BJ > Yes, I saw the email about this yesterday. Good news is that those
> type hints/annotations can be used by sphinx to generate the api docs. In
> fact, this is something I would have done as part of this documentation
> effort.
>
> 3) Working out a good layout in the repo for docs is also important, but
> I don't forsee any real obstacles here - as you mention, a TOC etc are
> important. .rst seems like a perfectly reasonable format for
> hand-written docs, and given there aren't really that many hand-written
> docs in the tree which remain relevant, hand-converting them to largely
> unformatted markdown seems reasonable in the first instance. There's
> always going to be a bit of tension between keeping the docs organized
> and trying to keep the docs fairly close to the implementation they are
> documenting, but we can manage that.
>
>
> BJ> Agreed.
>
> 4) I'd want to kill the existing tooling entirely as it's just going
> stale. Eg, the way https://mhammond.github.io/pywin32/ is built is
> interesting (it decompiles the .chm!) but that seems like a dead-end - I
> suspect that at some point it will end up extremely difficult to build
> that .chm in the first place - finding the Windows HTML Help compiler
> today is difficult enough.
>
>
> BJ> I agree with this as well. In fact, sphinx can generate HTMLHelp for
> compiling to CHM if you still want to have a CHM file available.
>
> So really, the big unknowns for me that need answering are:
>
> * How exactly do the autoduck comments get handled as they change?
>
>
> BJ> Maybe via SWIG. More research needed.
>
> * How does adding docs to the .py files overlap with adding type hints?
>
>
> BJ> Overlaps perfectly.
>
> * Does it replace the existing system rather than adding yet more
> complexity to it?
>
>
> BJ> Replaces
>
> I'll look a little more at your repo over the next week or so, but I'm
> currently a bit short on time, but really am interested in improving the
> docs, so thanks!
>
>
> BJ> Sounds good! Thanks!
>
> ___
> 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] pywin32 Documentation

2022-12-06 Thread Vernon D. Cole
The most important document for adodbapi is in Markdown. (That's an
improvement - - I wrote it in .odt) so if that helps the decision, I would
say lean toward that direction.
It needs to be linked / indexed in where people can actually find it.
adodbapi/quick_reference.md
 If
we make an actual .docs directory, it should move there.

It also needs an edit pass to get rid of obsolete references to Python 2
and to check that the external links still work and so forth. I'll add that
to my to-do list.



On Mon, Dec 5, 2022 at 6:57 PM Brian Johnson  wrote:

> Hi.
>
> I took a stab at upgrading and "untangling" the documentation. I am
> willing to work on this documentation "untangling" project. Before I put
> more effort into it, I would like to get feedback from Mark and other
> contributors on what I'm proposing. If so, I'll log an Issue and/or pull
> request.
>
> *Motivation*: I need to work with a COM server application and want to
> use python. I found it challenging to find documentation and examples.
> Also, Mark mentioned this in the repo README: *"Lots of that is very old,
> but some is auto-generated and current. Would love help untangling the
> docs!"*
>
> *Where*: The current iteration is hosted on my forked repo at Python for
> Windows Extensions — pywin32 305 documentation (brian3johnson.github.io)
> . If this effort
> moves forward, I'll pull it down once it's built and posted from mhammond's
> repo.
>
> *How*: I am building the documentation with sphinx Welcome — Sphinx
> documentation (sphinx-doc.org)  to
> update the narrative docs and automate or semi-automate the pywin32 API
> reference. I am using the default theme. I'm using reStructuredText (.rst)
> for the docs.
>
> *What*: I included all the existing narrative documentation from the CHM.
> Most of it remains unformatted, except for a couple of docs. I added a Home
> page, Installation, Support, and Resources pages, and the start of a
> Getting Started Tutorial.
>
> *Proposed Next Steps*:
>
> 1. Confirm if I move forward with sphinx. If so, confirm if we use
> reStructuredText (reStructuredText — Sphinx documentation (sphinx-doc.org)
> )
> or Markdown (Markdown — Sphinx documentation (sphinx-doc.org)
> ) for narrative
> documents.
> 2. Finish formatting the existing narrative docs per rst or md.
> 3. Add docstrings to .py source files to generate API docs.
> 4. Convert some of the "samples" embedded in the source files to "How-tos".
>
> I have more ideas and suggestions, which I can share in an Issue, PR, or
> on this mailing list.
>
> I look forward to hearing what you think.
>
> Sincerely,
> Brian
> ___
> 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] Package giving Error while deploying to windows container

2022-05-19 Thread Vernon D. Cole
Django also runs on Windows, and I have operated it there for testing
purposes, but it is most at home in a Linux environment.
I have never (personally) run it in a container. I prefer the better
performance and ease of use when installed directly on the server.
Containers may deploy more quickly, but you pay a penalty for the rest of
the life of the system.
I cannot imagine why one would want to run * anything * in a Windows
container. That is adding complexity on top of difficulty.
My suggestion is to eliminate Windows from your thinking and run django
directly on Linux.
Use Windows for desktops or laptops, use Linux for servers.
(full disclosure: this message is being typed on an Ubuntu Linux desktop.)


On Wed, May 18, 2022 at 3:49 PM Ankit Sharma 
wrote:

> Hi Team,
>
> Hope this mail finds you well!
>
> The issue with Pywin32 library is , it is getting deployed successfully to
> window container, However, once we try to use Export file function from the
> library , we get following error:
>
> "Environment:
>
>
> Request Method: GET
> Request URL:
> http://globalinnovationfitdjango-window.azurewebsites.net/export_report?projectId=2538
>
> Django Version: 3.0.5
> Python Version: 3.8.10
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'django.contrib.sites',
>  'corsheaders',
>  'rest_framework',
>  'projects',
>  'channels_menu']
> Installed Middleware:
> ['corsheaders.middleware.CorsMiddleware',
>  'django.middleware.security.SecurityMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>
>
>
> Traceback (most recent call last):
>   File "C:\Python\lib\site-packages\win32com\client\dynamic.py", line 86,
> in _GetGoodDispatch
> IDispatch = pythoncom.connect(IDispatch)
>
> During handling of the above exception ((-2147221005, 'Invalid class
> string', None, None)), another exception occurred:
>   File "C:\Python\lib\site-packages\django\core\handlers\exception.py",
> line 34, in inner
> response = get_response(request)
>   File "C:\Python\lib\site-packages\django\core\handlers\base.py", line
> 115, in _get_response
> response = self.process_exception_by_middleware(e, request)
>   File "C:\Python\lib\site-packages\django\core\handlers\base.py", line
> 113, in _get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File "C:\Python\lib\site-packages\django\views\decorators\csrf.py", line
> 54, in wrapped_view
> return view_func(*args, **kwargs)
>   File "C:\Python\lib\site-packages\django\views\generic\base.py", line
> 71, in view
> return self.dispatch(request, *args, **kwargs)
>   File "C:\Python\lib\site-packages\rest_framework\views.py", line 505, in
> dispatch
> response = self.handle_exception(exc)
>   File "C:\Python\lib\site-packages\rest_framework\views.py", line 465, in
> handle_exception
> self.raise_uncaught_exception(exc)
>   File "C:\Python\lib\site-packages\rest_framework\views.py", line 476, in
> raise_uncaught_exception
> raise exc
>   File "C:\Python\lib\site-packages\rest_framework\views.py", line 502, in
> dispatch
> response = handler(request, *args, **kwargs)
>   File "C:\Python\lib\site-packages\rest_framework\decorators.py", line
> 50, in handler
> return func(*args, **kwargs)
>   File "C:\app\backend\manage_products\products.py", line 17683, in
> export_report
> main()
>   File "C:\app\backend\manage_products\products.py", line 17854, in main
> run_excel(f_path, f_name, sheet_name)
>   File "C:\app\backend\manage_products\products.py", line 17751, in
> run_excel
> excel = win32.gencache.EnsureDispatch('Excel.Application')
>   File "C:\Python\lib\site-packages\win32com\client\gencache.py", line
> 618, in EnsureDispatch
> disp = win32com.client.Dispatch(prog_id)
>   File "C:\Python\lib\site-packages\win32com\client\__init__.py", line
> 117, in Dispatch
> dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,
> userName, clsctx)
>   File "C:\Python\lib\site-packages\win32com\client\dynamic.py", line 106,
> in _GetGoodDispatchAndUserName
> return (_GetGoodDispatch(IDispatch, clsctx), userName)
>   File "C:\Python\lib\site-packages\win32com\client\dynamic.py", line 88,
> in _GetGoodDispatch
> IDispatch = pythoncom.CoCreateInstance(
>
> Exception Type: com_error at /export_report
> Exception Value: (-2147221005, 'Invalid class string', None, None)
> "
>
>
> This is the log that we can not rectify even after updating our python
> version and changing container from Linux based environment to Windows
> Based environment.
>
>
> Can you please help us out in figuring this 

Re: [python-win32] Outlook Add-In Demo Question ... A runtime error occurred during the loading of the com add-in

2021-12-08 Thread Vernon D. Cole
Thanks, Tim.

Your depth of knowledge is appreciated.
I have never understood the "magic" which happens when you make a COM call.
Now it all makes sense why 32 and 64 bit COM are mutually incompatible.


On Wed, Dec 8, 2021 at 1:52 PM Tim Roberts  wrote:

> Vernon D. Cole wrote:
> > Most likely, you are running a 64  bit version of Python.
> > Due to Windows restrictions, only 32 bit programs can talk to each other.
>
> That comment demands clarification, because as stated it is quite
> misleading.
>
> The issue here is that a 32-bit application can only load 32-bit DLLs.
> Outlook 2016 is a 32-bit application, so when it as a COM client tries
> to load an in-process COM server (that is, his add-in), the COM server
> DLL must also be 32-bit.
>
> There are many, many ways that 32-bit and 64-bit programs can talk to
> each other.  This is a very specific instance.
>
> --
> 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] Outlook Add-In Demo Question ... A runtime error occurred during the loading of the com add-in

2021-12-08 Thread Vernon D. Cole
Most likely, you are running a 64  bit version of Python.
Due to Windows restrictions, only 32 bit programs can talk to each other.
If you download and install a 32 bit version of Python, you may find
success.
PyCharm and Windows will happily allow multiple versions of Python to work
alongside each other.
Select your Python version under File --> Settings --> Project --> Python
Interpreter


On Tue, Dec 7, 2021 at 8:30 PM Dan Moisan  wrote:

> I apologize in advance for the basic question, but I have spent about 40
> hours researching how to make the demo "outlookAddin.py" load on my Outlook
> 2016 32 bit application. I am running Python version 3.7 and I can
> successfully run the outlookAddin.py script from PyCharm. But then when I
> open outlook, I always receive the message "... not loaded. a runtime error
> occurred during the loading of the com add-in".
>
> I am sure that I missing a very basic step to make this run, but I can't
> seem to find anything online. Do I need to do something to compile the
> outlookAddin.py script before or after I run it? Or should the add-in load
> after it is registered? I'm so sorry for such a basic question.
>
> Thank you!
>
> Dan
> ___
> 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] Very unimportant bug report.

2020-06-18 Thread Vernon D. Cole
I am testing the installation of our newest version 228 of pywin32.

When attempting to install pywidn32 on the 32-bit version of Python
3.8 on *Windows
7 *32 bit, I get the following error: "The procedure entry point
ucrtbase.terminate could not be located in the dynamic link library
api-ms-win-crt-runtime-l1-1-0.dll."

If anyone loses any sleep over this particular problem, I will say that
they are delusional. The very idea that anything works at all on this old
platform is amazing. The installation of pywin32 was at least partially
successful, as I was able to run a rudimentary test of adodbapi.

The Python 2.7 installation was clean and appears to work. Since 2.7
applications are much more likely targets, I would say that our bases are
covered pretty well.

My real reason for this posting is actually to say: "well done, team!"
--
Vernon Cole
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] How to install pywin32 for Text only/TTY, excluding all GUI components

2020-05-26 Thread Vernon D. Cole
Tim:
  I don't understand.  If I include pywin32 as a pip requirement, then I
get the whole thing, I think. How can I "ship a package" without carrying
the unneeded parts around?


On Sun, May 24, 2020 at 12:28 AM Tim Roberts  wrote:

> On May 23, 2020, at 4:27 AM, Markus Kramer 
> wrote:
>
>
> Hello,
> I would like to discuss and contribute to an alternative pip package
> without GUI:
> - pip install pywin32   continues as is, e.g. includes Pythonwin.
> - pip install pywin32nogui  would contain no GUI components, e.g. MFC.dll.
> What are your thoughts?
>
>
> What is the point?  Installing a package does not mean you are required to
> use all of it.  If you ship a package that doesn’t need the UI components,
> then your package will not include the components.
> —
> 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] Seemingly incomplete installation

2020-03-04 Thread Vernon D. Cole
Do not expect Start Menu tools. If you select the installation option to
add Python to your path, then the scripts directory is also added to the
path, which will make all the tools work -- from the command line.  Having
said that, adding them to the start menu would be pointless, because they
are designed to run with arguments typed on the command line. Just running
them without arguments does not do anything but print usage information..
Perhaps some day someone will make a GUI tool interface, but that does not
exit yet, as far as I know.

For myself, on a new Windows system, I always right-click on "Windows
System-->Command Prompt" and pin it to the start menu. Then I right-click
on the resulting start menu panel and pin it to the task bar. That gives me
one-click to bring up a command windows so I can type the command I need.

Because I run multiple versions of Python, I rarely use tool commands
directly. I use the Python Launcher for Windows so that I can select which
Python version is used. So, rather than "pip install xxx" I tend to use
something like "py -3.6 -m pip install xxx". That command works even where
Python is not added to the path.

On Wed, Mar 4, 2020 at 5:09 AM Boylan, Ross  wrote:

> After downloading and installing pywin32-227.win-amd64-py3.8.exe I can
> access the libraries, but there don't seem to be any links from the start
> menu to any of the tools or documentation.  The installation log just shows
> a lot of files being copied to C:\Program Files\Python38\Lib\site-packages,
> including at least some of the tools (e.g., regedit.py).
>
> Reinstallation made no difference.
>
> Are my expectations incorrect?  What can I do?
>
> Environment: VM running Win 10 Enterprise, just upgraded to 1809. Then I
> installed python-3.8.2-amd64.exe, and then pywin32.  Windows, Python,
> Office 2016 all 64 bit.  I elected customized installations of python and
> pywin32 and elevated privileges to install for all users.
> ___
> 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] Announcement: adodbapi source code moved to pywin32/adodbapi

2019-11-25 Thread Vernon D. Cole
(adodbapi is a pure-Python PEP-249 compliant SQL interface for Windows
using Microsoft ADO. It can access numerous database engines using ADO
providers or ODBC drivers, and features such leading-edge enhancements as
named-column data retrieval and user-selected query parameter styles.)

For anyone who cares:
  As of today, the definitive source code for the adodbapi project is now
the adodbapi sub-directory in the pywin32 source repo. That should keep
version creep and file inconsistencies from becoming a problem, which
fouled up the installation of adodbapi which shipped with the last few
releases of pywin32.

The pypi and sourceforge distributions have been updated to version 2.6.2.0,
which will be part of the next pywin32 release.

My apologies for the long delay in making this happen. My day job is now
centered in software QA for many Linux / PostgreSQL systems, so I don't get
on Windows very often. A younger volunteer to take over regular maintenance
of the adodbapi subsystem would be very welcome.
--
Vernon Cole
see:
https://github.com/mhammond/pywin32
http://adodbapi.sourceforge.net/
quick_reference.md

___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


[python-win32] almost there -- running "py -2 setup.py install"

2019-03-27 Thread Vernon D. Cole
I have been working for a while on writing a script to provision a machine
to be able to build pywin32 using downloadable components, the most
important of which is the VCforPython27 compiler package.

It seems that in packaging that compiler, at least one header file needed
to build pywin32 was left out. Here is where my last attempt failed: ...

> C:\Users\vagrant\pywin32>py -2 setup.py install
> Building pywin32 2.7.224.1
> running install
> running build
> running build_py
> running build_ext
> Skipping mapi: The header 'edkmdb.h' can not be located.
> Skipping exchange: The header 'edkmdb.h' can not be located.
> Skipping exchdapi: No 64-bit library for utility functions available.
> building 'win32ui' extension
> c:\Program Files (x86)\Common Files\Microsoft\Visual C++ for
> Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /W3 /GS- /DNDEBUG /MD
> -DDISTUTILS_BUILD -D_CRT_SECURE_NO_WARNINGS -Icom/win32com/src/include
> -Iwin32/src -IC:\Python27\include -IC:\Python27\PC "-IC:\Program Files
> (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows
> Kits\8.1\include\shared" /TpPythonwin/dbgthread.cpp
> /Fobuild\temp.win-amd64-2.7\Release\Pythonwin/dbgthread.obj -DBUILD_PYW
> -D_AFXDLL -D_AFXEXT -D_MBCS /Zi
> /Fdbuild\temp.win-amd64-2.7\Release\win32ui_vc.pdb /EHsc /wd4163
> dbgthread.cpp
> c:\users\vagrant\pywin32\pythonwin\stdafx.h(18) : fatal error C1083:
> Cannot open include file: 'afxwin.h': No such file or directory
> error: command 'c:\\Program Files (x86)\\Common Files\\Microsoft\\Visual
> C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
>
> The offending file is  pythonwin/stdafx.h which calls for several afx*.h
files.

Can these headers safely be ignored and skipped over, like the edk* ones
are? If not, can someone refer me to a suitable source for the definitions?

There is a folder with the missing library names in Visual Studio 2017
Build Tools, but I suspect that it would not have the correct values for
version 9, would it?
--
Vernon Cole
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] runas analog

2019-03-18 Thread Vernon D. Cole
Perhaps ShellExecuteEx will do what you are wishing for?
I found a good formula for starting a process as an administrator and it is
packaged in
a small module

tries to emulate a "sudo" command. You might look at the code around line
76.

Starting a subprocess in Windows is somewhat of a black art, I fear.



On Mon, Mar 18, 2019 at 7:16 PM Kuree Kafir  wrote:

> Hello,
>
> I am trying to implement something similar to the runas /netonly command
> in python.
>
> handle = win32security.LogonUser(userName, domain, password,
> win32con.LOGON32_LOGON_NEW_CREDENTIALS, win32con.LOGON32_PROVIDER_DEFAULT)
> win32security.ImpersonateLoggedOnUser(handle)
>
> These two commands succeed, and I can see the credentials in memory, but
> when I attempt to call something like os.system("cmd.exe") and attempt to
> authenticate, the security context previous created is not presented, and
> authentication fails.
>
> How do I correctly call CreateProcess using the impersonation session that
> I just created?
>
> kuree
> ___
> 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] Do we need dotnet 3.5?

2019-03-15 Thread Vernon D. Cole
Thanks for the link. That method did not seem to work on Windows Server
2016.
I have found a solution that seems to work correctly, if not very
efficiently, on Windows 10.
Since I doubt that Windows Server machines will be called on very often to
build pywin32, I am leaving the script with a little message telling the
unfortunate user to install dotNET 3.5 manually.

Still I wonder what part of our build system requires something so obsolete.

On Thu, Mar 14, 2019 at 1:55 PM Denis Akhiyarov 
wrote:

> Have you looked at this?
> https://stackoverflow.com/questions/23631675/install-net-3-5-framework-on-windows-server-2012-without-dvd
>
> On Thu, Mar 14, 2019 at 1:29 PM Vernon D. Cole 
> wrote:
>
>> I am trying to build a build machine (actually a script to build build
>> machines) capable of creating a pywin32 distribution. (I need to test the
>> distribution I am trying to fix.)
>>
>> Somewhere in there it seems that I need to have .net3.5 installed. I have
>> been struggling with this all morning, and have come to the conclusion that
>> I cannot install it on a Windows server operating system without having the
>> distribution media mounted on a CD drive.
>>
>> That seems like a bad idea.
>>
>> Is the package actually needed for some reason?
>> --
>> Vernon Cole
>>
>> ___
>> 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] Do we need dotnet 3.5?

2019-03-14 Thread Vernon D. Cole
I am trying to build a build machine (actually a script to build build
machines) capable of creating a pywin32 distribution. (I need to test the
distribution I am trying to fix.)

Somewhere in there it seems that I need to have .net3.5 installed. I have
been struggling with this all morning, and have come to the conclusion that
I cannot install it on a Windows server operating system without having the
distribution media mounted on a CD drive.

That seems like a bad idea.

Is the package actually needed for some reason?
--
Vernon Cole
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] adodbapi: paramstyle 'named' doesn't work as expected

2019-02-25 Thread Vernon D. Cole
Sibyille:
  Thanks for the report and the excellent analysis.  I was afraid no one
would ever use "named" paramstyle.

Dennis:
  Any code suggestion would be very welcome. Would you be able to suggest a
patch?
--
Vernon Cole



On Sat, Feb 23, 2019 at 7:30 AM Sibylle Koczian 
wrote:

> Am 21.02.2019 um 16:26 schrieb Dennis Lee Bieber:
> >
> >   If I were coding something, I'd likely use the native style to
> reduce
> > the cost of conversion overhead. Relatively speaking, that name
> extraction
> > code is /slow/ -- it splits the query on :, then loops over each
> character
> > looking for something (non-alphanumeric and not _) on which to terminate
> > the resulting name... and that loop is done at Python source code level
> (it
> > doesn't even use a
> >
> >   for i,c in enumerate(chunk):
> >
> > which would exit the loop on the end of the chunk; instead it manually
> > increments the counter to be "next character" [which fails when there is
> no
> > next character].
> >
> >
>
> Well - I started to write my application without much thought about
> execution speed, because the database tables concerned are small to very
> small. If I can use a dictionary for query parameters then the function
> producing the parameters doesn't need to know much about the SQL query
> using them. That's why I like pyformat and named. Looking at the apibase
> code I think pyformat might be a little bit faster?
>
> But when I saw things didn't work as expected that had to be cleared up
> in any case.
>
> Greetings
> Sibylle
> ___
> 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 3.7: difficulties importing adodbapi after installation

2018-08-17 Thread Vernon D. Cole
The hassle is because I have not fulfilled my responsibility to keep
adodbapi maintained properly for these last few years. I now work in a
Linux shop and have almost nothing to do with databases, so my work on
Windows database software keeps taking a back seat to other
responsibilities.  This weekend, I will finally have some time.

  That said: this is an open invitation for someone to step in and help out.

On Fri, Aug 17, 2018 at 8:10 AM Sibylle Koczian 
wrote:

> Fresh install of Python 3.7 on Windows 10.
>
> Installed pywin32-223.win-amd64.py3.7.exe (from python.org) without
> error messages, but the adodbapi directory didn't contain apibase.py and
> so adodbapi couldn't be imported.
>
> Next step: "pip install adodbapi --upgrade" again seemed to work
> normally, but now 4 files contained line endings "\r\r\n":
> apibase.py
> is64bit.py
> process_connect_string.py
> server.py
> This caused an IndentationError at the first line continuation in
> apibase.py (whitespace after the \):
> line 249, pythonDateTimeConverter.DateObjectFromCOMDate,
>  dte=datetime.datetime.fromordinal(integerPart +
> self._ordinal_1899_12_31) \
>  + datetime.timedelta(milliseconds=floatpart*8640)
>
> I couldn't find differences to the module version in my Python 3.6
> installation, other than the line endings, so I copied the 4 files from
> there.
>
> Last problem: now adodbapi missed
> ...\python37\lib\site-packages\win32com\gen_py\dicts.dat. The second
> exception in the traceback said something about missing rights, so I
> opened a Python shell as administrator and imported adodbapi there. That
> created the file.
>
> Now everything works as it should, but why the hassle?
>
> Greetings
> Sibylle
> ___
> 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] Dispatching something that requires elevation

2018-06-09 Thread Vernon D. Cole
look in github.com/salt-bevy/sudo.py

for a module which will request elevated privileges for a Python script
running as a normal user.
Perhaps that can help create a solution for your use case.

There is a sample call for it in bootstrap_bevy_member_here.py or you can
just run it from the command line with the script you want to run as
administrator as its arguments.



On Fri, Jun 8, 2018 at 11:11 PM, Simon McConnell 
wrote:

> Hi,
>
> I am trying to dispatch a COM interface of a program that is set to "Run
> as Administrator" in the Compatibility Settings of its properties.  Running
> the script w/o elevation results in a 'requires elevation' error.  Running
> the script with elevation results in a 'server execution failed' error,
> which I understand to be "I can't find that thing".  Removing the "Run as
> Administrator" from the Compatibility settings and running the script w/o
> elevation works, but unfortunately, this program needs to be run as
> administrator.  When opening the program manually I have to accept the UAC
> popup and cannot turn it off thanks to Group Policy.  Any clues?
>
> import win32com.client
> o = win32com.client.Dispatch("CimplicityME.Application")
>
>
> gives the error:
>
>
> Traceback (most recent call last):
>   File "C:\Users\smcconnell\PycharmProjects\proficy\venv\
> lib\site-packages\win32com\client\dynamic.py", line 89, in
> _GetGoodDispatch
> IDispatch = pythoncom.connect(IDispatch)
> pywintypes.com_error: (-2147221021, 'Operation unavailable', None, None)
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "C:\Users\smcconnell\PycharmProjects\proficy\src\proficy.py", line
> 5, in 
> o = win32com.client.Dispatch("CimplicityME.Application")
>   File "C:\Users\smcconnell\PycharmProjects\proficy\venv\
> lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
> dispatch, userName = dynamic._GetGoodDispatchAndUserName(
> dispatch,userName,clsctx)
>   File "C:\Users\smcconnell\PycharmProjects\proficy\venv\
> lib\site-packages\win32com\client\dynamic.py", line 114, in
> _GetGoodDispatchAndUserName
> return (_GetGoodDispatch(IDispatch, clsctx), userName)
>   File "C:\Users\smcconnell\PycharmProjects\proficy\venv\
> lib\site-packages\win32com\client\dynamic.py", line 91, in
> _GetGoodDispatch
> IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
> pythoncom.IID_IDispatch)
> pywintypes.com_error: (-2147024156, 'The requested operation requires
> elevation.', None, None)
>
>
>
> If I run the script as administrator I get the following error:
>
>
> Traceback (most recent call last):
>   File "C:\Users\smcconnell\PycharmProjects\proficy\venv\
> lib\site-packages\win32com\client\dynamic.py", line 89, in
> _GetGoodDispatch
> IDispatch = pythoncom.connect(IDispatch)
> pywintypes.com_error: (-2147221021, 'Operation unavailable', None, None)
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "C:\Users\smcconnell\PycharmProjects\proficy\src\proficy.py", line
> 5, in 
> o = win32com.client.Dispatch("CimplicityME.Application")
>   File "C:\Users\smcconnell\PycharmProjects\proficy\venv\
> lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
> dispatch, userName = dynamic._GetGoodDispatchAndUserName(
> dispatch,userName,clsctx)
>   File "C:\Users\smcconnell\PycharmProjects\proficy\venv\
> lib\site-packages\win32com\client\dynamic.py", line 114, in
> _GetGoodDispatchAndUserName
> return (_GetGoodDispatch(IDispatch, clsctx), userName)
>   File "C:\Users\smcconnell\PycharmProjects\proficy\venv\
> lib\site-packages\win32com\client\dynamic.py", line 91, in
> _GetGoodDispatch
> IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
> pythoncom.IID_IDispatch)
> pywintypes.com_error: (-2146959355, 'Server execution failed', None, None)
>
>
> ___
> 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] Bug reporting

2018-03-04 Thread Vernon D. Cole
I decided to meditate for a few days rather than answer immediately and
poorly.

After I took over maintenance of adodbapi in about 2003, I was struggling
with how to properly document
that most users (CPython) had to install pywin32 as a prerequisite. At that
time the odbc sub-module had a couple of bugs,
and ADO seemed to be all the future. Also pywin32's odbc module follows the
api 1.0 version.
I asked, and received a green light, to bundle adodbapi with pywin32.

When you (Mark) gave that okay, you had one stipulation: that the module
get "some support".

During the last few years I have failed to provide that support. That fact
causes me daily regret.
I want the opportunity to correct my failure. I also want to enable someone
else to be able to support the package
should the need arise, like if I have a stroke or something. I have already
survived cancer.
I understand that pywin32 support is "largely" just you, but adodbapi
support is _only_ just me -- a critical difference.

Here is what I propose:

1) This time, rather than copy a selected (major) part of the adodbapi
source files over to their pywin32 directory,
I would copy _all_ of the files.

2) Adjust adodbapi/MANIFEST.in and setup.py to create a proper PyPi
submission from that directory.

3) Adjust the pywin32 MANIFEST.in to include a subset of adodbapi files
that actually works.

4) Put a simple go/no-go test of adodbapi (perhaps ACCESS database only)
into the pywin32 test suite.

5) document in SourceForge that future updates will take place in the
pywin32 repo.
--
Vernon


On Mon, Feb 26, 2018 at 5:53 PM, Mark Hammond <mhamm...@skippinet.com.au>
wrote:

> On 27/02/2018 5:40 am, Vernon D. Cole wrote:
>
>> Second: the effective "bus size" of the adodbapi repo is *one*. The other
>> three authorized maintainers are inactive.  Indeed, the way I got approved
>> as a maintainer 15 years ago (has it really been that long?) was to
>> document to SourceForge that the then-existing two maintainers were
>> unresponsive. Moving the working source into the pywin32 repo would solve
>> that problem.
>>
>
> It's not immediately clear that it would though. pywin32 itself has the
> exact same issue (ie, it's largely just me), and I don't use or know much
> about adodbapi - so it seems somewhat likely you'd have the same "bus size"
> - just on a different bus :)
>
> My research this morning suggests that by suitable editing of the
>> MANIFEST.in file in the pywin32 root, and the  /adodbapi/MANIFEST.in and
>> ./setup.py we could effectively send two seemingly independent (but source
>> locked) versions of adodbapi to PyPi.  That should keep both
>> CPython/pywin32 and IronPython use cases covered.  Should I pursue that?
>>
>
> When building pywin32 I don't send *any* versions of adodbapi to pypi, so
> I'm really not sure what that means. I'm reluctant to agree that building
> pywin32 will create many discrete wheels - I already need to upload wheels
> for each python version supported and for 64 and 32 bits and making the
> build and release process more convoluted doesn't sound like a win for me.
>
> So can you please explain in more detail what is being proposed here, and
> why it would be preferred to splitting adodbapi into its own repo on
> github, possibly including removal of it from pywin32 if the duplication
> causes problems?
>
> Cheers,
>
> Mark
>
> --
>> Vernon
>>
>>
>> I spent the morning reviewing the documentation for setuptools and wheels
>> and such.
>>
>>
>>
>> On Sun, Feb 25, 2018 at 7:35 PM, Bob Kline <bkl...@rksystems.com > bkl...@rksystems.com>> wrote:
>>
>> On Sun, Feb 25, 2018 at 6:18 PM, Mark Hammond
>> <mhamm...@skippinet.com.au <mailto:mhamm...@skippinet.com.au>> wrote:
>>
>> > 1) There's a relatively easy fix that can be made to the copy of
>> adodbapi
>> > which is inside pywin32.
>>
>> Right. Basically, I think what needs to happen is for the fork on
>> GitHub to be brought in sync with the working code on SF. I'm going to
>> guess it's not quite as simple as that, because we'd want to be
>> careful to preserve any patches which got applied on GitHub, but
>> didn't make it to the original repo. Don't know for sure that there
>> are any, but we should check.
>>
>> > 2) There's a concern regarding some IronPython bindings for
>> adodbapi which
>> > aren't in pywin32 and Vernon was asking something whether they
>> should also
>> > be included in pywin32.
>>
>> As I understand it, the code to support IronPython is already included
>> in what's on Git

Re: [python-win32] Bug reporting

2018-02-26 Thread Vernon D. Cole
There are two problems with the existing SourceForge repo of adodbapi.

First, the manual copy of updates to the pywin32 code base can easily fail
-- as it did several years ago and I missed the resulting error which
remained unfixed for several releases of pywin32. That problem was
exacerbated by me moving to a new job where I never used Windows at all,
along with my test platform dying.

Second: the effective "bus size" of the adodbapi repo is *one*. The other
three authorized maintainers are inactive.  Indeed, the way I got approved
as a maintainer 15 years ago (has it really been that long?) was to
document to SourceForge that the then-existing two maintainers were
unresponsive. Moving the working source into the pywin32 repo would solve
that problem.

So, it looks to me like moving the development copy of adodbapi source to
the pywin32 GitHub repo would be a Good Idea. But could that be easily done?

My research this morning suggests that by suitable editing of the
MANIFEST.in file in the pywin32 root, and the  /adodbapi/MANIFEST.in and
./setup.py we could effectively send two seemingly independent (but source
locked) versions of adodbapi to PyPi.  That should keep both
CPython/pywin32 and IronPython use cases covered.  Should I pursue that?
--
Vernon


I spent the morning reviewing the documentation for setuptools and wheels
and such.



On Sun, Feb 25, 2018 at 7:35 PM, Bob Kline  wrote:

> On Sun, Feb 25, 2018 at 6:18 PM, Mark Hammond 
> wrote:
>
> > 1) There's a relatively easy fix that can be made to the copy of adodbapi
> > which is inside pywin32.
>
> Right. Basically, I think what needs to happen is for the fork on
> GitHub to be brought in sync with the working code on SF. I'm going to
> guess it's not quite as simple as that, because we'd want to be
> careful to preserve any patches which got applied on GitHub, but
> didn't make it to the original repo. Don't know for sure that there
> are any, but we should check.
>
> > 2) There's a concern regarding some IronPython bindings for adodbapi
> which
> > aren't in pywin32 and Vernon was asking something whether they should
> also
> > be included in pywin32.
>
> As I understand it, the code to support IronPython is already included
> in what's on GitHub. I think Vernon's hoping that there's a way to
> script an export of just the adodbapi portion of your GitHub repo for
> the use of the IronPython users (who, as you correctly point out, have
> no use for the pywin32 bits). If that's possible (and I can't see why
> it wouldn't be, as GitHub is pretty easy to script), he would be able
> to avoid the tedium and risks involved in having to maintain the same
> code base in two different places. It would also eliminate the "where
> am I supposed to file bugs" confusion, as well as make it easier to
> persuade others to assist with maintenance of the code. Most of the
> adodbapi code is common for IronPython and CPython users, and I don't
> see that the presence of "if IronPython: ..." code in the
> mhammond/pywin32 repo does any harm (after all, it's already there and
> I'll bet no one has noticed).
>
> I hope that makes things a little clearer. But this explanation is
> speculation on my part, and I should really let Vernon say what he
> means for #2.
>
> Regards,
> Bob
>
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Bug reporting

2018-02-21 Thread Vernon D. Cole
Ummm ... "I'm buried under a project right now, and I won't be able to get
back to you until next Friday." My day job has been burning up a lot of
time, and we had an important Family Occasion on Saturday that ate the
entire weekend. Sorry.  I will try to do better at context switching.

You are heading in exactly the correct direction with the test suite.

As for a single copy of the source -- would it work to keep the stand-alone
(Iron Python) distribution in the /adodbapi directory on GitHub, and just
ignore the extra files (for the big distribution) by not putting them in
the main manifest?  @Mark -- please chime in here...

> On Mon, Feb 19, 2018 at 11:59 AM, Bob Kline <bkl...@rksystems.com> wrote:

> >> On Mon, Feb 19, 2018 at 11:18 AM, Vernon D. Cole <vernondc...@gmail.com>
> wrote:
> >>
> >>> Sounds like a good plan.
> >>
> >> As in, "yes, let's consolidate the project in one place (under pywin
> >> on GitHub)"? Or did you mean "yes, I agree we should have the
> >> discussion about whether we have to maintain the package in more than
> >> one place"? If the former, I'll be happy to get the ball rolling by
> >> starting the analysis for topping up the GitHub repo from the
> >> SourceForge oledbapi repo. If the latter, I guess the first step in
> >> that discussion would be for you to lay out the reason(s) why it
> >> wouldn't work to maintain the project just on GitHub (under pywin). Or
> >> perhaps you intended some third interpretation of "good plan."
> >>
> >> Cheers,
> >> Bob
> >>
>
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Bug reporting

2018-02-19 Thread Vernon D. Cole
Sounds like a good plan.

On Feb 19, 2018 04:57, "Bob Kline" <bkl...@rksystems.com> wrote:

> On Mon, Feb 19, 2018 at 2:25 AM, Vernon D. Cole <vernondc...@gmail.com>
> wrote:
>
> > I will try to clear this up as much as I can...
>
> Thanks very much for your reply, Vernon.
>
> > Adodbapi lives in two places, as a stand-alone project on Sourceforge,
> and
> > integrated with PyWin32.
>
> Well, I wouldn't go so far as saying it "lives" in the GitHub project;
> more like it's on life support. :-) As far as I can tell, it's never
> actually been usable from that repo, as the required apibase.py file
> didn't make it to the party.
>
> > The Sourceforge project is needed for Iron Python, and has more
> > documentation, and, originally, a faster upgrade cycle.
>
> I see, however, that the code to support IronPython is in both places,
> documentation can easily be enhanced, and (as you acknowledge) the
> upgrade cycle for the SourceForge project has gone walkabout. It would
> seem ideal (if nothing else, from the perspective of the attempt to
> attract more maintainers) if we didn't have to maintain two separate
> code bases.
>
> > The SF code was copied to pywin32 for easier installation and more
> > convenience, but the file layout is slightly different. I did not have
> the
> > capability to test the pywin32 installation so was unaware of the problem
> > until too late. Then I went to work for another company which did not use
> > Windows at all, so everything got kind of lost.
> >
> > The move of pywin32 to GitHub, along with improved testing there will
> help
> > to fix things.  I am also building an SQL server test bench which I hope
> > will be permanent. A patch has been submitted to fix the "missing file"
> > problem, and I have changed my SF notifications to a different email
> address
> > that I check more frequently.
> >
> > The python-win project is the preferred maintenance place.
>
> Perhaps a note on the SourceForge page to that effect would be appropriate.
>
> > Meanwhile ... I am not getting any younger and an active back-up
> maintainer
> > for the home adodbapi project would be very welcome if someone were
> willing
> > to help out. At the present moment the "bus size" is one -- which is a
> bad
> > thing.
>
> I'm happy to do what I can, though as I pointed out in an earlier
> thread, you're younger than I am. :-)
>
> If you provide instructions for getting the regression tests running,
> I'll try to replicate them here.
>
> Let's first decide the question of how many places we're going to
> maintain the package. I vote for one (on GitHub). If (for whatever
> reason) it's necessary to maintain it in two places, let's (a) decide
> whether it's possible to keep the two places synchronized so they
> don't drift into forks of each other; (b) figure out how such
> synchronization will be accomplished; and most important (c) make it
> very clear in both locations what the relationship is between the two
> repositories, telling everyone which one should be used in which
> situation, where to file issue tracking tickets, etc.
>
> Thanks again for your willingness to bring this project back to life.
>
> --
> Bob Kline
> http://www.rksystems.com
> mailto:bkl...@rksystems.com
>
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


[python-win32] sudo.py -- publish to pypi or gist?

2018-02-16 Thread Vernon D. Cole
I finished work on a new module today -- it is called "sudo.py" and does
pretty much what you would expect.

If executed as a main program, on Linux or MacOS, it just runs "sudo" which
is not very exciting. On Windows, it requests elevation and runs a command
as an Administrator, which is a capability I have been wanting for years.

Or you can call it at the beginning of a Python program like this:
>>> import sudo
>>> sudo.run_elevated()  # run this script as an Administrator
which creates a new window (on Windows) and runs the script (from the top)
with elevated privileges.

Of course it requires PyWin32 to perform all this magic on Windows.

I want to publish it -- but in what form?
If you care, please respond to this poll.

--
Vernon Cole
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] datetime values in adodbapi

2017-11-07 Thread Vernon D. Cole
The real question here is where the significance gets lost.  It's hard to
get a handle on what is really in the tables. Also, the time conversion
routines (both in and out of the database) are a mass of confusion.
Obviously Bob has found a where a value an internal form blows up when fed
directly back into an INSERT. I suspect that if his row.date value was run
through a real datetime object that things would magically work
differently. This code has been around since long before datetime was
invented, and tries to handle every possible format. Washing everything
through datetime internally is probably not the answer, either, since
datetime is _really_ slow -- at least it was last time I did performance
tests.

The code resorts to falling back to handling time values as ISO strings in
some cases -- depending on a guess of how the underlying database engine
will accept them. Remember that this module needs to work with *any*
database engine, not just the two sold by Microsoft. Data may be lost in
the conversion between COM dates, datetime dates, whatever the database
stores internally, and human readable dates.  I have never examined where
small amounts of precision might be lost. The unit tests are loose.  Tests
for time.time() are even worse -- if a test worked for me in US Mountain
Standard zone it was sure to fail for Mark in Australia. Ugh! But I
digress. This will take some really detailed debugging. My thanks go out to
whomever tackles it.
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] datetime values in adodbapi

2017-11-06 Thread Vernon D. Cole
Y

On Sat, Nov 4, 2017 at 6:27 AM, Bob Kline  wrote:

> The adodbapi package does not seem to handle datetime values appropriately.
>
> import adodbapi
> print(adodbapi.version)
> cursor = adodbapi.connect(...)
> cursor.execute("CREATE TABLE #t (i INT, d DATETIME)")
> cursor.execute("INSERT INTO #t VALUES (42, GETDATE())")
> cursor.execute("SELECT * FROM #t")
> row = cursor.fetchone()
> print("d={}".format(row.d))
> cursor.execute("INSERT INTO #t VALUES (?, ?)", (43, row.d))
> cursor.execute("SELECT * FROM #t WHERE i = 43")
> row = cursor.fetchone()
> print("d={}".format(row.d))
>
> When running under Python 2.7.13, the first print statement shows that
> the datetime value has been correctly retrieved, preserving the
> precision:
>
> d=2017-11-04 07:52:18.11
>
> but then when the second INSERT is executed an exception is raised:
>
> pywintypes.com_error: (-2147352567, 'Exception occurred.', (0,
> u'ADODB.Parameter', u'Application uses a value of the wrong type for
> the current operation.', u'C:\\WINDOWS\\HELP\\ADO270.CHM', 1240652,
> -2146824867), None)
>
> So the package isn't allowing the script to use the same value it was
> given as a valid value for the d column by the package itself.
>
> When the script is run under Python 3.6.0, the exception is not
> raised, but that's only because the datetime precision has been
> discarded:
>
> d=2017-11-04 08:15:37
> d=2017-11-04 08:15:37
>
> I get the same behavior with adodbapi 2.6.0.6 (which I downloaded from
> the link which indicated (http://adodbapi.sourceforge.net/index.html)
> that this is the latest version) and on 2.6.0.7, which is what pip
> installed.
>
> I would like to help get both of these behaviors corrected (failure to
> store datetime values with microsecond precision in Python 2.x, as
> well as failure to preserve sub-second precision in retrieved values
> in Python 3.x). Before I dig in to do the work, though, I want to
> check in here to make sure patches are accepted so I don't spend time
> on something that's not wanted.
>
> Thanks!
>
> --
> Bob Kline
> http://www.rksystems.com
> mailto:bkl...@rksystems.com
> ___
> 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] Multiple versions of Python

2017-10-08 Thread Vernon D. Cole
Damine:

The answer provided by Denis was correct, but is most helpful only in
environments where you are developing projects with different prerequisite
requirements. For that, you will want to use the Python virtual environment
package, aided by virtualenvwrappor.
I also highly
recommend PyCharm  which has built-in
support for both. If you already have a license for Visual Studio, PTVS
works too.

But in the general case, you may not need all that.  The tool to do what
you ask is built in an ships with all recent versions of Python3 for
windows.
It is the excellent Python louncher for Windows.
You
install all the versions of Python you want side-by-side in the normal
manner. If you are running Jython or IronPython you will need to edit a
configuration file, but for any version of CPython, it just works.

If I recall correctly (I am typing this from my Ubuntu machine) the command
to run pip for your Python 2.6 installation would be...

> py 2.6 -m pip install romanclass


On Sun, Oct 8, 2017 at 9:02 AM, Denis Akhiyarov 
wrote:

> This is pywin32 mailing list, but generally you can use virtualenv or
> conda environments to manage your multiple Python versions from the
> command-line. Note that PTVS provides convenient ways to add multiple
> environments to the same Python project from Visual Studio user interface.
> In essence all these tools rely on "shadowing" the inactive Python paths
> by prepending active Python paths to the %PATH% environment variable.
>
> On Sun, Oct 8, 2017 at 9:43 AM, Damien Sykes-Lindley <
> dam...@dcpendleton.plus.com> wrote:
>
>> Hi,
>> Is there any documentation I need to look at if I intend to use Python 2
>> and 3 on the same Windows machine? Specifically, how to switch versions,
>> how to install things with Pip without causing conflicts etc.
>> I can find such notes describing its use on a Linux system, but nothing
>> for Windows.
>> I understand they can at least coexist on the same machine without issues
>> (thanks to different pathnames etc), but beyond that I haven’t a clue.
>> Cheers.
>> Damien.
>>
>> ___
>> 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] To connect to a remote DB2(AS400) over Python, in any case do we have to pay to IBM for the driver?

2017-06-23 Thread Vernon D. Cole
This forum is appropriate.

It has been a number of years since I looked at the code I used for what
you ask (perhaps I have an old copy of source laying around) but if I
recall correctly, I used the OLE DB Provider.  I am not aware of any
licensing issues -- perhaps the company already had some kind of license I
did not know about. Anybody who can afford to run an AS-400 should not
shrink from the cost of a license to actually access the data that it
hosts, I suppose.

My best source for finding how to connect with anything is
https://www.connectionstrings.com/.  Since C-Python cannot run .NET code,
you cannot use any of the .NET connection methods.
I think the method you want will be based on
https://www.connectionstrings.com/ibm-client-access-ole-db-provider/


Pull and install the zip file from http://sourceforge.net/projects/adodbapi
which has some documentation and samples that don't get shipped with
pywin32. (The PIP install from pypi is the same thing,too.) The SQL-Server
and ACCESS examples both use OLE-DB providers so get your ideas from them.
The samples and the quickstart document ought to get you going. If not,
feel free to email me directly.

Of course, you will have to get DB-2 provider software from IBM or
somewhere.  (That may be where they get you with a license fee.) Also, be
aware that the OLE-DB provider is complete/y different from the ODBC
driver. You can use either one from adodbapi, but the connection string is
completely different.

Once you have all of the correct software installed and permissions and
passwords set up, the database manipulation itself is very straight
forward, and adodbapi has enhancements to eliminate some of the worst
problems with SQL, such as argument counting.  DB-2 hums along quite
nicely.  In my best production application, I was pulling customer data
from a distant AS-400 and combining it with local GIS data.  Having the
geographical data on a Microsoft SQL Server turned out to be a severe
bottleneck. But, since everything was written using the Python DB-API, it
was easy to convert to using MySQL locally (which worked quite well) and
then to sqlite3, which became the final solution. Note that (even though
adodbapi can do some magic) you are still talking in the SQL dialect of the
target database engine. Don't expect to send Microsoft T-SQL commands to a
DB-2 server.

Good luck.


On Thu, Jun 22, 2017 at 10:20 PM, Gugu Rama 
wrote:

> Hi everybody, I am new here and need an answer, if you can help I will be
> really happy...
>
> I just wonder a point about connecting to an AS400 DB2 over Python.. To
> connect to a DB2 of a remote AS400 over any one of the Python DB API
> interfaces (ibm_db, pyodbc, pyDB2 or any other one) from Python on
> Windows10, in any case do we have to pay for the license of the IBM ODBC
> driver? I tried ibm_db and it seems its for free to connect to a DB2 on
> Windows, but due to pay for a license to connect to a remote AS400.. Is
> there any other way of connecting to a remote AS400 without IBM licensing
> "solutions", from Python3.x?...
>
> BTW if here is not the proper email list to ask this kind of a question,
> would you please lead me to another one if its more fitting for such a
> question.. for I am new in Python, I try to learn proper community grounds
> for Q as well..
>
> Thank you in advance..
>
> ___
> 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] adodbapi changing autocommit

2016-10-25 Thread Vernon D. Cole
Please file a bug report at https://sourceforge.net/p/adodbapi/bugs/ .  I
will rebuild my test environment which has gradually evaporated over time.
Make sure to specify which database engine were you running to find the bug.


On Tue, Oct 25, 2016 at 2:53 PM, Max Slimmer <maxslim...@gmail.com> wrote:

> Vernon,
> Yes, that is what I'm saying, I just didn't want to come out shouting
> "bug". I tried setting up the package test at one point but got stuck
> somewhere so I'm not sure I'm the person to file the PR (or whatever the
> process is). But, I'd be happy to file it using whatever the appropriate
> procedure is (if where we're at isn't enough :)).
>
> On Mon, Oct 24, 2016 at 2:57 PM, Vernon D. Cole <vernondc...@gmail.com>
> wrote:
>
>> Wait a bit...  Did I just hear that there is a difference in operation
>> between starting a connection with autocommit=false and turning autocommit
>> off during a session?  If so, I think that's a bug.  PEP-249 has no hook
>> for explicitly starting a transaction, so adodbapi needs to always have
>> done BeginTrans before any meaningful operation.  Am I missing something?
>> --
>> Vernon Cole
>>
>>
>> On Mon, Oct 24, 2016 at 11:10 AM, Tim Roberts <t...@probo.com> wrote:
>>
>>> Max Slimmer wrote:
>>> > The adodbapi documentation and code implies that with autocommit =
>>> > False I should only have to call commit (and possibly rollback) and if
>>> > using the connection as a context manager not even those are required.
>>> > If autocommit = False is passed on the initial connect the __init__ of
>>> > the connector handles BeginTrans and subsequent commit and rollbacks
>>> > also leave me with an open trans.
>>>
>>> Ah, I missed that subtle distinction.  Your modification seems
>>> reasonable.
>>>
>>> --
>>> Tim Roberts, t...@probo.com
>>> Providenza & Boekelheide, Inc.
>>>
>>> ___
>>> python-win32 mailing list
>>> python-win32@python.org
>>> https://mail.python.org/mailman/listinfo/python-win32
>>>
>>
>>
>
>
> --
> --Max III
>
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] adodbapi changing autocommit

2016-10-24 Thread Vernon D. Cole
Wait a bit...  Did I just hear that there is a difference in operation
between starting a connection with autocommit=false and turning autocommit
off during a session?  If so, I think that's a bug.  PEP-249 has no hook
for explicitly starting a transaction, so adodbapi needs to always have
done BeginTrans before any meaningful operation.  Am I missing something?
--
Vernon Cole


On Mon, Oct 24, 2016 at 11:10 AM, Tim Roberts  wrote:

> Max Slimmer wrote:
> > The adodbapi documentation and code implies that with autocommit =
> > False I should only have to call commit (and possibly rollback) and if
> > using the connection as a context manager not even those are required.
> > If autocommit = False is passed on the initial connect the __init__ of
> > the connector handles BeginTrans and subsequent commit and rollbacks
> > also leave me with an open trans.
>
> Ah, I missed that subtle distinction.  Your modification seems reasonable.
>
> --
> 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] shell_view.py folder not browsable

2016-07-06 Thread Vernon D. Cole
I seem to be suffering from a lack of context...
What example are you referring to?


On Wed, Jul 6, 2016 at 5:42 PM, Kurt Eilander 
wrote:

> Hey all,
>>
>> I was hoping to create my own IShellFolder in python, but there seems to
>> be something wrong with the example on my system.
>> (Win7 64bit, Python 2.7)
>>
>> The folder shows up on the desktop, but I cannot open it.  I saw an
>> earlier thread where the solution was to right-click and select
>> 'explore', but that doesn't even work for me.  The context menu only has
>> Cut, Create Shortcut, and Delete.
>>
>> Not seeing any errors in the syslogs.
>>
>> Any fixes or suggestions would be most appreciated!
>>
>> Thanks in advance,
>> -Kurt
>>
>
> Today I decided to try it on Vista 32-bit, SP2.  Also, this was pristine
> code right off the Anaconda bundle.
>
> This time when I right-click, open on "Python Path Shell Browser" I see a
> brief blip, like it wanted to draw the window frame but decided not to.
> This was the only visible difference (and I think even that could be
> accounted for by the slower speed of the machine).
>
> Again, I run mmc and look at the syslogs.  Nothing.
>
> That's a pretty old system.  Just curious, when was the last time anybody
> has tried this example?  Its starting to feel like the non-workingness may
> have been around for a long time.
>
> -Kurt
>
> ___
> 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] dbi.interalError

2016-05-05 Thread Vernon D. Cole
More information about your program would be helpful. There are at least
three ways that connections to SQL Server might be obtained in Python. In
general, it would seem that the version of Python may have changed. The
bit-width of the SQL Server server should not affect a data client.


On Thu, May 5, 2016 at 3:18 AM, Robin Becker  wrote:

> A client has changed database and now receives this error
>
>
> dbi.internalError: [Microsoft][ODBC Driver Manager] The specified DSN
> contains an architecture mismatch between the Driver and Application in
> LOGIN
>
>
> I suspect that this is due to something related to
>
>
> https://social.msdn.microsoft.com/Forums/sqlserver/en-US/702f0d9b-6cb9-49cf-9953-80d059711e60/the-specified-dsn-contains-an-architecture-mismatch-between-the-driver-and-application?forum=sqlgetstarted
>
> but can anyone explain what should be done to fix this?
>
> I have asked concerning the db machine 32/64bit etc etc and whether the
> python software is running on 32/64 bit python.
> --
> Robin Becker
> ___
> 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] pywin32 build 220 adodbapi loads incorrectly on Python3.

2016-02-20 Thread Vernon D. Cole
The error I made in the manifest files for adodbapi in the former
release has been corrected, so adodbapi now installs correctly in
Python 2.  However, the conversion to Python 3 is in error.  I shall
track down that foul-up in due course.

After installing build 220 on Python3, you will need to separately
install adodbapi -- on my test bed, this worked:...

  py -3 -m pip install adodbapi
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] pip not running in windows 64

2015-12-26 Thread Vernon D. Cole
Dear Erick:

I assume that you do not usually use the Python programming language. That
will make it more difficult for people to help you, since we may not be
communicating using the same vocabulary.  A few things you should know:...

1) this (Python-win32) is not a group for the discussion of Python (in
general) on Windows platforms.  It is for discussion of a specific toolkit
(pywin32) which aids programmers in using Python to perform detailed
Windows tasks.  Your problem has nothing to do with pywin32. (At least, I
think not.)

2) someone from the Blender group may be able to provide more help -- but
perhaps not, because your problem is not really with Blender either.

3) The software installation which you are attempting to run is very
complex.  A hundred different things could be wrong.

I have access to an old Windows 7 computer which has never had Python
installed and I will try to see if I can duplicate your problem. This may
take me a day or two.  I will contact you directly (not through the group)
when I have more information.  You could help by letting me know what
exactly you mean by: "I just set the var path".
-- 
Vernon Cole


On Fri, Dec 25, 2015 at 9:47 AM, Erick Blender 
wrote:

> Hi there, first time, here I m on windows 7 i m trying to build a manual
> (http://blender.org/manual/about/install/windows.html) when i run
> C:\Python34\Scripts\pip install -r requirements.txt in the cmd,
> The cmd hangs and doesn't respond. I just set the var path, can i get some
> help?
>
> ___
> 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] adodbapi: Connection with 'WINCCOLEDBProvider.1' fails

2015-09-08 Thread Vernon D. Cole
On Mon, Sep 7, 2015 at 5:48 AM, Stefan Fuchs  wrote:

> 'WINCCOLEDBProvider.1'



Your patch looks like the perfect answer.  It has been included in the
official source.
--
Vernon Cole
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] remote database changed causing odbc error

2015-09-02 Thread Vernon D. Cole
There are two different modules which you might be using to connect to an
SQL Server database.

The odbc module is very basic, written in C, and follows the db-api version
1 api.

The adodbapi module is more complex, written in Python, and follows the
db-api version 2 specification (PEP 249, with many proposed "version 3"
extensions).

Unfortunately, due to my error, some parts of adodbapi are missing from the
current release of  pywin32, so you must install adodbapi separately from
http://sourceforge.net/projects/adodbapi or from pypi
. The separate download
gives you more examples and documentation, and is necessary for Linux and
IronPython users. Other than that, all pywin32 extensions are loaded
together, if you have anything, you should have everything.

Assuming that you are using a recent version of adodbapi...

> >>> from adodbapi import is64bit
> >>> is64bit.Python()
> True
> >>> is64bit.os()
> True
> >>>
>

I added these two functions as an aid for a programmer who is trying to
automatically determine a working connection string, since 32 bit and 64
bit versions use different drivers.  This is briefly discussed in the
documentation, and complex working examples can be found in the test
directory. A copy of the documentation is also at
http://adodbapi.sourceforge.net/quick_reference.pdf.

After a connection to the database has been established, you can determine
the database engine and version you have been connected to...

> import adodbapi
> import adodbapi.is64bit as is64bit
>
> databasename = "test.mdb"
>
> if is64bit.Python():
> driver = "Microsoft.ACE.OLEDB.12.0"
> else:
> driver = "Microsoft.Jet.OLEDB.4.0"
> constr = "Provider=%s;Data Source=%s" % (driver, databasename)
>
> #create the connection
> con = adodbapi.connect(constr)
>
> print('dbms_name=', con.dbms_name, '  dbms_version=', con.dbms_version)
>

The above code is untested.  I just "upgraded" to Windows 10, and it seems
that the ACE driver is now broken. YMMV.
--
Vernon Cole

On Wed, Sep 2, 2015 at 10:14 AM, Robin Becker  wrote:

> A user reports the following error
>
> dbi.internalError: [Microsoft][ODBC Driver Manager] The specified DSN
> contains
> an architecture mismatch between the Driver and Application in LOGIN.
>
> trying to connect to a new database source because they migrated the
> windows server to a new machine with a supported windows version.
> Apparently the sql server version changed from SQL Server version 2005 to
> 2012.
>
> The client machine is 64 bit with python 2.7, I am trying to determine the
> version of python +32/64 etc etc and the win32 extensions that are
> installed.
>
> Has anyone any advice on what the problem is here?
> --
> Robin Becker
> ___
> 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] adodbapi 2.6.0.7 question

2015-08-20 Thread Vernon D. Cole
Andrey:

   Good catch.  I have added the following to the quickref documentation
for the connection class:

.timeout # supply a value for CommandTimeout. Note: the timeout
 connection value is stored in this attribute, and is used as the connection
 timeout. It is then re-used as the command timeout. The user may overcome
 this rather goofy feature by supplying a different value to this
 attribute after the connection is made. The value is in seconds, and will
 be used for all subsequent SQL commands.



On Thu, Aug 20, 2015 at 1:20 PM, Andrey Glozman agloz...@ellington.com
wrote:

 Please disregard.

 We found a way to change timeout on the “connection” object.



 Thank you,

   Andrey Glozman

Ellington Management Group, LLC

53 Forest Avenue, Old Greenwich, CT 06870

*P*: 203.409.3574, *M*:203.912.7099  *F*: 203.698.0869



 *From:* Andrey Glozman
 *Sent:* Thursday, August 20, 2015 12:46 PM
 *To:* 'python-win32@python.org'
 *Subject:* adodbapi 2.6.0.7 question



 Greetings,

 We are trying to use the adodbapi 2.6.0.7 and unable to change ADO
 CommandTimeout after connection is established. Would you be able to help
 us understand the best way to do it?



 Based on the adodbapi code – the only “timeout” parameter a user can
 provide is at the connection object instantiation. That timeout value is
 being used as a ConnectionTimeout (to connect to a server) and a
 CommandTimeout (to execute statement).

 Also, it is not clear how one can change CommandTimeout in between
 queries.



 Example case scenario:

 1)  Connect to a server (here we need ConnectionTimeout). Typically
 default 30 seconds is acceptable

 2)  Run Query1  - it might be some sort of a ping / database
 availability / user permissions / etc. (Here we need CommandTimeout). In
 many cases default 30 seconds is too much.

 3)  Run Query2 – it might be a job / report / process - (here we need
 different CommandTimeout than above). In some cases it takes minutes to run.



 Again, it seems that with existing implementation the above use case
 scenario is not possible.



 Thank you in advance,

   Andrey Glozman

Ellington Management Group, LLC

53 Forest Avenue, Old Greenwich, CT 06870

*P*: 203.409.3574, *M*:203.912.7099  *F*: 203.698.0869




 =
 Email transmissions can not be guaranteed to be secure or error-free, as
 information could be intercepted, corrupted, lost, destroyed, arrive late
 or incomplete, or contain viruses. The sender therefore does not accept
 liability for any errors or omissions in the contents of this message which
 arise as a result of email transmission. In addition, the information
 contained in this email message is intended only for use of the individual
 or entity named above. If the reader of this message is not the intended
 recipient, or the employee or agent responsible to deliver it to the
 intended recipient, you are hereby notified that any dissemination,
 distribution,or copying of this communication, disclosure of the parties to
 it, or any action taken or omitted to be taken in reliance on it, is
 strictly prohibited, and may be unlawful. If you are not the intended
 recipient please delete this email message.
 ==
   ­­

 ___
 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] Issue with refresh of ODBC linked table and submitting credentials in excel using Python

2015-06-22 Thread Vernon D. Cole
I think you are saying that you have an Excel spreadsheet which imports
data from an ODBC data source, as talked about in Overview of connecting to
(importing) data
https://support.office.com/en-ca/article/Overview-of-connecting-to-importing-data-c0ad7aec-ff1a-4e48-9c21-dc18a102433f
.

If that is correct, then my suggestion would be to eliminate Excel from the
picture, and manipulate the database directly using Python and SQL.
Unfortunately, the version of adodbapi which ships with the present latest
version of pywin32 is broken, so you will have to download directly from
http://sf.net/projects/adodbapi until the next release. Using ADO you can
write SQL commands to manipulate data in any ODBC data source, or in an
ACCESS database, or in an Excel spreadsheet.


On Mon, Jun 22, 2015 at 2:56 PM, Carl E. Evans carl.evan...@gmail.com
wrote:

 I have the following code:

 import win32com.clientimport os


 file1= r'C:\\Users\file.xlxm'
 def refresher():
 if os.path.exists(file1):
 xl = win32com.client.DispatchEx(Excel.Application)
 xl.Workbooks.Open(Filename=file1,ReadOnly=1)
 xl.Visible = 1



 xl.Workbooks(1).Close(SaveChanges=1)
 xl.Application.Quit()
 del xl
 refresher()

 Which gets me into the file, but I am unsure of how to refresh a ODBC
 connected table that requires a simple form submission of user credentials.
 The current settings dont allow me to save credentials so a script seems to
 be the only solution. Any suggestions?

 This will allow me to quickly update my models without have to do it
 manually in excel.

 Thanks!

 --
 -

 Carl E. Evans | Economist



 ___
 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] Adodbapi date param error with MS access

2015-05-05 Thread Vernon D. Cole
Thanks for bringing this to attention.  That exception was in the code (in
a slightly different form) when I inherited it many years ago. There was
once a note to the effect that it was needed to work around a bug in
Access. It is very likely that the Jet database engine has been improved in
the last decade and the workaround is no longer necessary.  Perhaps we can
get rid of it.

What version of the Jet provider are you using?

Do you feel confident that your testing to determine that this works was
extensive enough to release the patch generally?
--
Vernon Cole
(adodbapi maintainer)

On Tue, May 5, 2015 at 1:13 AM, Adrián Panella adrianpane...@hotmail.com
wrote:

 Hi, I'am trying to use adodbapi to wrap a connection to an .accdb MS
 Access database and I'm getting an error when executing a query with a date
 parameter.
 For what I could deduce the problem is that it converts to COMDate only if
 settings_known is set, which seems not to be the case for Access querys,
 and defaults to assuming that the parameter is a string even if it is a
 datetime object.

 I have solved the problem changing the following lines of code in
 adodbapi.py (in function _configure_parameter):

  195   elif type(value) in dateconverter.types:
  196 (old) #if settings_known and adotype in api.adoDateTimeTypes:
  196 (new) if adotype in api.adoDateTimeTypes:
  197   p.Value = dateconverter.COMDate(value)
  198   else: #probably a string

 This works but it is not very portable as it requires to change library
 code on each installation.

 Any suggestions?

 I have also tried running it as a stored procedure (with callproc), but in
 that case it tries to retrieve paramenter information
 (cmd.Parameters.Refresh). Which it does without error but getting all
 blanks. So it doesn´t work either.

 Thanks




 ___
 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] Opening Access (mdb) database: ADODB.Connection - Der Provider kann nicht gefunden werden

2015-04-20 Thread Vernon D. Cole
I also cannot read German, and also I guess that you do not have the
correct provider. There are numerous difficulties with 64 vs 32  bit
providers for Access (Jet) databases.

More information about providers can be found on the links in
http://adodbapi.sourceforge.net/quick_reference.pdf

I in reviewing my answer, I find that the link to the hacked 12.0
versions of the provider at http://shares.digvil.info/redis/ was broken, so
I repaired the site.
--
Vernon Cole


On Mon, Apr 20, 2015 at 8:15 AM, Rod Person rodper...@rodperson.com wrote:

  On 04/20/2015 9:49 AM, Niemann, Hartmut wrote:

  this is the source

 

 try:

 print Open ADOB.Connection

 ado = win32com.client.Dispatch(ADODB.Connection)

 connectionstring = Provider=Microsoft.Jet.OLEDB.4.0; Data
 Source=\%s\ % filename   # Access 2003

 #connectionstring = Provider=Microsoft.ACE.OLEDB.12.0;Data
 Source=\%s\ % filename   # Access 2007

 print Open ADOB.Connection with '%s' % connectionstring

 ado.Open(connectionstring)

 except pythoncom.com_error, (hr, msg, exc, arg):  # pylint:
 disable=E1101

 print The Access call failed with code %d: %s % (hr, msg)

 if exc is None:

 print There is no extended error information

 else:

 wcode, source, text, helpFile, helpId, scode = exc

 print The source of the error is, source

 print The error message is, text

 print More info can be found in %s (id=%d) % (helpFile,
 helpId)

 raise

 return ado

 

 This is the result

 --

 Open ADOB.Connection with 'Provider=Microsoft.Jet.OLEDB.4.0; Data
 Source=out\Stoermeld-B97.mdb'

 The Access call failed with code -2147352567: Ausnahmefehler aufgetreten.

 The source of the error is ADODB.Connection

 The error message is Der Provider kann nicht gefunden werden.
 Möglicherweise ist er nicht richtig installiert worden.


 I don't read or speak German so my thought on what this error says could
 be wrong but, it looks like it is saying that the Data Provider is
 missing.  If so, you need Jet.OLEDB.4.0 providers install on the machine.
 They should be install with Access 2000 but am assume you just have the mdb
 file.   Might want to check the MS site to see if you can download the
 provider without Access 2000.

 --
 Rod

 “Times are bad. Children no longer obey their parents, and everyone is 
 writing a book.”
   -- Marcus Tullius Cicero(106 BC - 43 BC)




 ___
 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] Opening Access (mdb) database: ADODB.Connection - Der Provider kann nicht gefunden werden

2015-04-20 Thread Vernon D. Cole
On Mon, Apr 20, 2015 at 7:49 AM, Niemann, Hartmut 
hartmut.niem...@siemens.com wrote:

  [...]

 Is this the best way to access an mdb database from python (2.7) or what
 would

 be preferred?



Rather than programming ADO by COM interface, you might find it easier or
more convenient to use the standard Python db-api interface provided by
sourceforge.net/projects/adodbapi .  It uses the same providers that you
are struggling with now (it calls the ADO COM interface for you) so it will
not help with your existing problem, unfortunately.
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Oldest Python version for pywin32?

2015-04-15 Thread Vernon D. Cole
I concur.  I am one of the 100 downloads of 2.5 -- and the only reason I
download it is to test it, not to use it in production.  How many of the
other downloaders are like me? Most, I would bet. Dropping 2.5 would allow
use of many Python3 features, since 2.6 has the backports for them (print
function, {}.format(), byte literals, and especially except ... as). It
would simplify the Python code in the library.

On Wed, Apr 15, 2015 at 4:25 AM, Tim Golden m...@timgolden.me.uk wrote:

 On 15/04/2015 10:11, Mark Hammond wrote:
  Hi Tim,
I still build for 2.5 and 3.1, but really only because they do still
  build. If there's a reasonable reason to drop support for some I doubt
  it will hurt many people - the sourceforge page should show you download
  stats, but last I looked 2.5 was rarely used then, and that was some
  time ago!


 FWIW the sf page for build 219 shows less than 100 downloads for 2.5/6
 and 3.1/2.

 Unsuprisingly 2.7 dominates with 3,000 downloads at 32-bit (2,000 at
 64-bit).

 3.3 comes in just over 100 and 3.4/5 each a few hundreds.

 So I feel no particular compunction about dropping forward support for
 2.6 and lower and 3.2 and lower. (Could say 2.5/3.1 but it's the same
 SDK level I think).

 TJG
 ___
 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] Transfer Access 2010 query results to python script for ArcGIS geoprocessing actions

2015-04-15 Thread Vernon D. Cole
You will probably need the help of an experienced Python programmer to do
what you wish, but the tools are all available, and you came to the correct
place to find them.  [ -- almost -- Normally, adodbapi is included in
pywin32, but Mark and I had a communications failure with the current
release, so you will have to download from
http://sourceforge.net/projects/adodbapi until the next pywin32 release.]

The good news is that using the adodbapi module, you can read and write
data from from an Access database using SQL, almost as if it were on a real
database server -- and you do not need to have Access on your computer to
do it.

The bad news is that some Geoprocessing tools you may want for your
application only work if you use the Python which is built in to ArcGis --
and it might be a bit tricky to install pywin32 in it -- since they install
it in a non-standard location.

The better news is that there are also third-party libraries of
Geoprocessing tools for Python that can used outside of ArcGis that might
do what you need, assuming that your Geographic database is served on a
capable server like PostgreSQL (PostGIS) or Microsoft SQL Server (both of
which are also supported by adodbapi.)

Feel free to contact me offline if you want some references.
--
Vernon Cole

On Wed, Apr 15, 2015 at 9:53 AM, Access Newbie accessnew...@gmail.com
wrote:

 Is it possible to transfer the results of an Access 2010 query (accdb
 extension) to a python script with the click of a button? Information will
 be used as variables within the script.

 Prefer to click button from Access data entry form to execute script but
 it can be from another GUI if necessary.

 Data getting transferred (anywhere from 20-50 fields) will be contact
 information, shapefile name and directory location, and arcpy parameters
 such as buffer distances for various geoprocessing applications. Script can
 be run from the command line and does not require ArcMap to be open to run.

 I am not sure where to begin and am not really a programmer so the really
 complicated stuff will probably confuse me unless explained in easy to
 understand language.

 Thank you for any and all guidance

 ___
 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] Using pip to install pywin32

2015-02-20 Thread Vernon D. Cole
Pywin32 is mostly written in C, and has lots of dependencies and weird
build requirements.  In order to compile it, you must have the same C
compiler that your release of Python was built with. For older Python
versions (like 2.7) that compiler is obsolete and hard to find, so installs
from source are pretty nearly impossible.

  Would a binary wheel be able to do all of the crazy set up that the
Windows installer does?
The project is open source, and patches are happily accepted.



On Thu, Feb 19, 2015 at 11:39 PM, Kevin Horn kevin.h...@gmail.com wrote:

 check out this bug:
 http://sourceforge.net/p/pywin32/bugs/669/

 There's been some interest, but the pywin32 developers themselves don't
 seem to have gotten involved.

 I'm not sure why.  It would be really nice to have pywin32 be
 pip-installable.



 On Thu, Feb 19, 2015 at 4:23 AM, Chris Angelico ros...@gmail.com wrote:

 Has anyone successfully pip installed the pywin32 package? I'm having
 some trouble with it at the moment. In theory, it should be easier to
 instruct people to type pip install pywin32 than go to the
 sourceforge download page, pick the right installer, and run it; but
 the installer is currently failing.

 Full log is available if people want it, but what I'm seeing in it is
 a number of lines like:

 Analyzing links from page
 http://sourceforge.net/projects/pywin32/files/pywin32/

 It never gets to the point of searching the build-specific pages, eg:

 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/

 Is there a way to tell pip how to find the file?

 All advice gratefully received!

 ChrisA
 ___
 python-win32 mailing list
 python-win32@python.org
 https://mail.python.org/mailman/listinfo/python-win32




 --
 --
 Kevin Horn

 ___
 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] Resetting passwords

2015-01-19 Thread Vernon D. Cole
As an aside to the recent discussion on storing passwords...

Is there a way to (re)set Windows passwords using a pre-computed hash?

I can use win32net.NetUserSetInfo() to reset a password, if I use the plain
text of the password. My goal is to remotely set passwords on an arbitrary
group of Windows computers, without storing the plain text of the
passwords. If I store the hash values, the control system would be much
less insecure than if I store the plain text.

[Explanation: My goal is to add password-setting capability for Windows in
saltstack
http://docs.saltstack.com/en/latest/ref/states/all/salt.states.user.html#module-salt.states.user.
It can now be done only in Linux, BSD, and Solaris. Of course I would need
to provide a different hash for Windows. If it worked only on recent
version of Windows that would be okay. ]
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] adodbapi transaction counter

2014-11-13 Thread Vernon D. Cole
On Wed, Nov 12, 2014 at 7:32 AM, Jure Erznožnik jure.erznoz...@perftech.si
wrote:

 if self.transaction_level == 0 *or self.transaction_level is None*


Rats! That's what I get for copying code that I don't really understand. My
simple tests passed this as okay.

I have changed the test to if not self.transaction_level: in order to fix
the bug and avoid the or operation at the same time. That's pretty
obscure, so I use your version as the comment. This bug fix will define
version 2.6.1.2 -- to be pushed to pypi after testing.
--
Vernon
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Error R6034 when I import uuid

2014-10-17 Thread Vernon D. Cole
Which version of Python are you running?
32 or 64 bit?
Which version of pywin32?
Which version of Windows?
Can you make a small test case that will demonstrate the error?


On Thu, Oct 16, 2014 at 7:47 PM, Blair Hall blairdh...@gmail.com wrote:

 I have a small python COM server that worked fine with Excel until I
 decided to import the standard Python 'uuid' module.

 Now I get the Windows Runtime error R6034 An application has made an
 attempt to load the C runtime library incorrectly

 I there anything that I can do to fix this?

 ___
 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] pip not working?

2014-09-21 Thread Vernon D. Cole
Patrick:
  I am very sorry, but you are asking this question on the wrong list.
This list is for Python for Windows Extension. You may find more productive
answers on a list which specializes in either mac OS, or the lxml package.



On Sun, Sep 21, 2014 at 9:26 AM, Patrick Asselman icebl...@chello.nl
wrote:

 Can somebody please shed some light on what is going on here?

 $ pip freeze
 lxml==3.4.0
 $ python3
 Python 3.4.0 (v3.4.0:04f714765c13, Mar 15 2014, 23:02:41)
 [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
 Type help, copyright, credits or license for more information.
  import lxml
 Traceback (most recent call last):
   File stdin, line 1, in module
 ImportError: No module named 'lxml'
 

 Also help('modules') doesn't show lxml in the list.

 This is on OSX 10.9.5

 Before this, I install py34-lxml through macports and it said Installing
 py34-lxml @3.3.5_0, which made me think it was installing an older
 version, so I chose to uninstall and use pip instead. Pip completes the
 installation succesfully, but the module cannot be found by Python.

 Best regards,
 Patrick


 ___
 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] Interactive Code to Script File

2014-09-16 Thread Vernon D. Cole
Dear D.J.:
   First, let me mention that you violated several of the unwritten rules
of asking for help.
For example, the code you typed into for email is not the same as the code
in the picture
you sent as an attachment (using a proprietary format).
Code samples should be cut-and-paste, not retyped.
The unwritten rules have been summarized at
http://www.catb.org/~esr/faqs/smart-questions.html
https://www.linkedin.com/redirect?url=http%3A%2F%2Fwww%2Ecatb%2Eorg%2F%7Eesr%2Ffaqs%2Fsmart-questions%2Ehtmlurlhash=VCfv_t=tracking_disc
This helps us help you.

Now to answer your question:

The code you typed in has an incorrect URL, but it reliably opens a browser
which informs me of that
fact when run as a script from the command line using Python versions from
2.3 to 3.4.

The only error in the code pictured in your attachment is the
over-specification of the Python version
in your #! line.  It is correct to specify the version to the second level,
like

 #!python2.7

 but specifying the third level is an error in the Python Launcher for
Windows (which you were not using.)
As a practical matter, your code is not at all version sensitive, so you
should simply use:

 #!/usr/bin/python


After I removed the offending .8 that version of the program also
operated as expected in all versions tested.
I tried running it from the pythonwin IDE (as you were doing in the screen
capture) and it worked correctly
in Python 2.7 and 3.4.

This leads me to believe that the problem lies in your specific
installation of Python. In what way might your installation be unusual?
Might it, perhaps, have been installed without administrative privileges,
or  for only your user (not all users)?


On Tue, Sep 16, 2014 at 7:13 PM, DJ Webre d_we...@yahoo.com.dmarc.invalid
wrote:

 I am trying to convert a program from interactive to script file.

 The program consists of the following 2 lines:

 import webbrowser
 webbrowser.open_new('http://www.google')

 When I run it interactively, it works but if I run it as a scrip file, it
 produces an error unless I import webbrowser interactively.

 What am I doing wrong?

 Thanks in advance for any assistance.

 D. J.

 ___
 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] Build 219, adodbapi: no module apibase

2014-09-10 Thread Vernon D. Cole
Dear Edward:

  I feel your pain.  The whole idea of including adodbapi as part of
pywin32 was to eliminate having to download and install it as a separate
product. Having it broken in this release sadly means a trip back in time
to the bad old days.  Here are the steps I took to attempt to reproduce
your problem:
  1) create an new Windaws 8.1 virtual machine on Azure
  2) install Python 2.7.8 32 bit from python.org using msi.
  3) instal pywin32 v 219 for 32 bit Python 2.7 from
http://sourceforge.net/projects/pywin32
  4) put a python command on the search path using the method of my choice
  5) download adodbapi from http://sourceforge.net/projects/adodbapi
  6) unzip adodbapi
  7) running *as an administrator*,in the unzipped directory, python
setup.py install

 C:\Users\vernonc:\python27\python.exe
 Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)]
 on win
 32
 Type help, copyright, credits or license for more information.
  import adodbapi
  adodbapi.version
 'adodbapi v2.6.0.6'

 exit()


And that should do it.


On Tue, Sep 9, 2014 at 7:11 PM, Irwin, Edward edward.ir...@loudoun.gov
wrote:

  Vernon,



 Any update on a new compiled version of pywin that includes all the
 adodbapi components?



 If not, how should I go about making my system work?  I want to document
 the exact steps so our sys admin can replicate on other systems that are
 running PyWin.  So far I have identified that apibase.py and
 process_connect_string.py are missing.  I first tried to run
 adodbapi-2.6.0.7\setup.py to repair it, but that did not resolve my
 issues.  Next, I manually copied the files to site-packages\adodbapi and
 everything seemed to work.  How should I be patching my site-package of
 adodbapi?  Is there another option?



 Sys.version '2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
 (Intel)]'





 Thanks



 Ed

 ___
 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] save chart from an existing xlsx as an image

2014-06-20 Thread Vernon D. Cole
It might be possible to run some older versions of Excel on Linux using wine
https://winehq.org/ or crossover https://codeweavers.com/products/, but
I do not think that you will be able to control them using COM.  Python 2.7
(32 bit) for Windows and pywin32 can be installed using Wine, but many
features do not work. (I tried using Ubuntu 14.04).

It might be better to try opening your spreadsheet using libreoffice
http://www.libreoffice.org/, which has the ability to export .pdf files
(and works on both Linux and Windows).

Otherwise, you might only be able to make screen shots of your Excel window
using a Windows computer.



On Fri, Jun 20, 2014 at 8:23 AM, Weijie Wu -X (weijwu - YI JIN XIN XI FU
WU(SU ZHOU)YOU XIAN GONG SI at Cisco) wei...@cisco.com wrote:

  Hi, guys



 I know win32com is working on windows for python, and I’ve question:

 I want to save chart from demo.xlsx as an image.  I also found some code
 as below:



 *from win32com.client import Dispatch*

 *xlsApp = Dispatch(Excel.Application) *

 *xlsWB = xlsApp.Workbooks.Open(r'/tmp/test/demo.xlsx') *

 *xlsSheet = xlsWB.Sheets(sheet1) *

 *mychart = XlsSheet.Charts(1)  #'1' is the index of the chart object in
 the wb*

 *mychart.Export(Filename=r'/tmp/test/MyExportedChart.png')*





 is there anyway I can run this code on linux ?



 or is there anyway I can save chart from an existing xlsx as an image?



 It drives me crazy.





 Thanks

 Wiley





 ___
 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] Build 219, adodbapi: no module apibase

2014-05-29 Thread Vernon D. Cole
Arrgh!  You are quite correct.

After completely removing and re-installing python 3.4, I get exactly the
same result. It would appear that my changes in the layout of adodbapi were
not updated in pywin32's distribution setup, but that error was masked in
my testing by pre-existing files on my test system.  I will communicate
with Mark off-line about how I can fix this so that testing is more
reliable.

You can get the other files you need from the adodbapi package in PyPi or
sourceforge...

(in Python 3.4)
py -3 -m pip install adodbapi

(if you have pip installed)
pip install adodbapi --upgrade

(otherwise)
http://sourceforge.net/projects/adodbapi/files/latest/download?source=dlp

Note that there is no difference between adodbapi 2.6.0.6 and 2.6.0.7,
except that the latter will download directly from pypi and not try using
the (broken) url link.

My profound apologies.
Vernon






On Wed, May 28, 2014 at 4:12 PM, Sibylle Koczian nulla.epist...@web.dewrote:

 Hello,

 I just installed Python 3.4.1 and pywin32, using
 pywin32-219.win-amd64-py3.4.exe. No problems, no error messages during
 installation.

 When I try to use adodbapi, I get an ImportError:

 Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:45:13) [MSC v.1600 64
 bit (AMD64)] on win32
 Type copyright, credits or license() for more information.
  import adodbapi
 Traceback (most recent call last):
   File pyshell#0, line 1, in module
 import adodbapi
   File C:\Python34\lib\site-packages\adodbapi\__init__.py, line 16, in
 module
 from .apibase import apilevel, threadsafety, paramstyle
 ImportError: No module named 'adodbapi.apibase'
 

 In fact there is no file called apibase in my Python34 directory.

 What can I do?

 Thank you,
 Sibylle
 ___
 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] Build 219, adodbapi: no module apibase

2014-05-29 Thread Vernon D. Cole
Ado is called using COM.  adodbapi makes heavy use of the COM interface
capabilities of pywin32 when running on CPython, or the built-in COM
interface on IronPython.  It requires one of the two.



On Thu, May 29, 2014 at 11:02 AM, Sibylle Koczian nulla.epist...@web.dewrote:

 Am 29.05.2014 11:33, schrieb Vernon D. Cole:

  (if you have pip installed)
 pip install adodbapi --upgrade


 Worked, thank you very much. This looks as if I could install adodbapi
 without the rest of the windows extensions - right or wrong?

 Greetings,

 Sibylle

 ___
 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] Fwd: Re: Python 3.4: adodbapi.connect(..) crashes

2014-04-25 Thread Vernon D. Cole
Just updating eveyone...

There is something weird going on with Python 3.4 and Windows 8.  Roger
Upole is working on it.

Meanwhile, after numerous remove-and-try-again passes, I have Python 3.4(64
bit) and pywin32 running on my new Windows 8.1 development machine. My
current development version of adodbapi (on the hg repository at
http://sourceforge.net/projects/adodbapihttp://sourceforge.net/p/adodbapi/code/ci/default/tree/)
is passing tests with ACCESS and SQL Server databases.

Do not give up hope.



On Sat, Mar 22, 2014 at 5:35 AM, Sibylle Koczian nulla.epist...@web.dewrote:

 Sorry, this should have gone to the list!

 Sibylle

  Original-Nachricht 
 Betreff: Re: [python-win32] Python 3.4: adodbapi.connect(..) crashes
 Datum: Fri, 21 Mar 2014 20:39:43 +0100
 Von: Sibylle Koczian nulla.epist...@web.de
 An: Vernon D. Cole vernondc...@gmail.com


 Am 21.03.2014 09:35, schrieb Vernon D. Cole:

 Argh!  I personally had not gotten around to trying Python 3.4 yet.  The
 pythoncom package is widely used and I can't imagine that the lack of it
 got past our normal QA tests. I will check on this as soon as I get off
 work.

   In the meantime, you should be able to have many versions of python
 loaded in parallel on your machine (I have around 7, usually) so you can
 reload 3.3 and use the /Python Launcher for Windows/ to switch between
 versions. Use...

 py -3 myprogram.py  # runs the highest numbered Python 3

 or...

 py -3.3 myprogram.py  # runs version 3.3


 Did that, but now it gets crazy. I installed Python 3.3.5 and, first,
 pywin32-217.win-amd64-py3.3.exe (fresh from the download page), because
 that was the version I had before. First I got this message at the end
 of the installation:

 Traceback (most recent call last):
   File string, line 612, in module
   File string, line 322, in install
   File string, line 160, in LoadSystemModule
   File C:\Python33\lib\imp.py, line 186, in load_module
 return load_dynamic(name, filename, opened_file)
 ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.
 (The specified module could not be found.)

 I've used pywin32 for years and never got such a message.

 Using Python 3.3 I could import adodbapi in spite of this, but trying to
 connect to an Access database I got exactly the same exception as before
 with Python 3.4 and build 218.

 So this begins to look like something local to my PC, but what can it
 be? Last week this worked. Moreover I tried to install the windows
 extensions on another machine running Windows 8.1, Python 3.3.3, and got
 the same error message at installation.

 Sadly, using something reasonable in place of Access is no option in
 this case, it's not my database.

 Regards
 Sibylle
 ___
 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] Link to source code missing.

2014-04-21 Thread Vernon D. Cole
On the sourceforge.net/projects/pywin32 web page, the Code tab, and all
pointers and links to the hg repository seem to have disappeared.  I a
change of some kind in the works?  (or announced and my Alzheimer's is
kicking in?)
  [Fortunately, I happen to have an old repo lying around which still
remembers the link, but others may not be so equipped.]
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Global ActiveScripting object not visible

2014-04-15 Thread Vernon D. Cole
The message means that no one has defined a meaning for the name DOpus to
Python.

You, as a programmer, must define that name.  If you say:
DOpus = Spam and Eggs
then you have defined it as a character string which contains three English
words.

If you say:
from win32com.client import Dispatch
DOpus = Dispatch(Wscript.Network)
then you will have defined it as a Windows COM dispatch object which will
do things (but not the things _you_ are interested in).  You must discover
which tool and what name to use to get Directory Opus 11.

After you have defined it correctly, then you can use it.

You might find the information in chapter
21http://www.icodeguru.com/WebServer/Python-Programming-on-Win32/ch21.htm
 helpful.




On Tue, Apr 15, 2014 at 11:17 AM, Łukasz Jakubowski luka...@onet.pl wrote:


 Hello,

 I have a problem with a file manager called Directory Opus 11. It supports
 ActiveScripting languages, but in case of python, its global objects are
 not visible in global namespace.
 Python packages (python-3.4.0, pywin32-218.win32-py3.4) seem to be
 installed correctly (fe. WScript object is visible in .pys scripts), and
 ActiveScripting engine is actually called by Directory Opus.
 Where should I start debugging? Are there some possible flags not set or
 attributes not presented by the Directory Opus objects that could be
 checked? Any namespaces to be searched?

 The exact error message is as follows:
 DOpus.OpenOutputWindow()
 ^
 Traceback (most recent call last):
   File Script Block , line 6, in module
 DOpus.OpenOutputWindow()
 NameError: name 'DOpus' is not defined
  (0x80020009)

 TIA  Regards,
 Łukasz
 ___
 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 3.4 and pywin32

2014-03-24 Thread Vernon D. Cole
So why is _mine_ broken, too?  What exactly did you clean up?



On Mon, Mar 24, 2014 at 10:38 AM, Thomas Heller thel...@ctypes.org wrote:

 Am 21.03.2014 21:22, schrieb Thomas Heller:

  [this has also been sent to the python-dev mailing list]

 With python 3.4 and pywin32 version 218 it is only possible
 to import win32com or win32api when pywintypes has been imported before.


 False alarm: after cleaning everything up and installing again this
 works now. Sorry for the noise.


 Thomas


 ___
 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] win32api on Windows 8

2014-03-11 Thread Vernon D. Cole
I updated the Python version on my Windows 8.1 box to match yours exactly,
and here is what I see:

Microsoft Windows [Version 6.3.9600]
 (c) 2013 Microsoft Corporation. All rights reserved.

 C:\Users\vernonpy
 Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]
 on win32
 Type help, copyright, credits or license for more information.
  import win32api
  win32api.GetVersion()
 602931718
 

 The difference I see is that my Python says on win32 but yours does not,
so there is some difference in the installations.
I used the Python x86 msi installer, UAC on, installed for all users from
an administrator account, taking all defaults.
I am running on an administrator account.

How might your installation be different?
--
Vernon Cole

On Tue, Mar 11, 2014 at 6:17 PM, Werner werner...@gmx.ch wrote:

 Hi,

 I sent this to pywin32-b...@lists.sourceforge.net a while ago but it
 doesn't show up in the archive, so I try here.

 I just started working with Windows 8.1 and run into problems with above.

 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]
 Python Type help, copyright, credits or license for more
 information.
 import win32api
 Traceback (most recent call last):
   File string, line 1, in fragment
 ImportError: DLL load failed: %1 is not a valid Win32 application.

 I tried both pywin32-218.win32-py2.7.exe and
 pywin32-216.win32-py2.7.exe.

 I had no problems with pywin32 on Windows 7.

 Appreciate any tip on how to fix this.

 Werner
 ___
 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] optimizing code to read serial port

2014-02-15 Thread Vernon D. Cole
Tony:

  Don't do it!

Do not attempt to make your data transfer faster while using this
 defective hardware design!  Trust me on this.  I have been doing serial
port data transfer since 300 baud was fast.

The problem with your data transfer speed is not your program optimization.
It is contained in the sentence:  The serial port on the device we are
dumping data from has a 2-wire interface (no handshaking).  This means
that the program servicing the serial port must be scheduled at time
intervals less than the time needed to fill your FIFO buffer.  Using
Windows, you cannot guarantee that with any degree of certainty --
particularly not at higher data rates -- because you have no control over
the hardware-level interface drivers.

If you really want higher data rates, you must use a dedicated device to
receive the data. May I humbly suggest that an hour of your programming
time would purchase a single board computer with a Python engine? Look at
http://www.raspberrypi.org/.  Let the SBC collect the data.  Transfer
blocks from it to the Windows environment using a more reliable protocol.

Consider that none of the new Windows boxes I saw on my last shopping trip
had serial ports.  You will soon need to be using another solution anyway.







On Sat, Feb 15, 2014 at 3:01 AM, Tony Cappellini cappy2...@gmail.comwrote:


 python-win32@python.org

 Regarding an in-house python program we use for dumping diagnostic data
 over a serial port on Windows 7 ...


 I'm trying to determine if it's possible optimize the python code so that
 dumping the data will occur faster. Currently, it takes ~25 minutes at 9600
 baud to dump 8-15 MB of data. Going to higher baud rates does reduce this
 time, but depending on which PC is running the program, going to higher
 baud rates often results in ill-formed data. The serial port on the device
 we are dumping data from has a 2-wire interface (no handshaking). Sometimes
 115200 baud works fine, other times the data gets all jumbled. We've
 decided to default to 9600 to avoid getting jumbled data.

 Compared to an openly available terminal program (Tera Term Pro) written
 in a compiled language, our Python version is much slower, but easier to
 program. Tera Term's scripting language isn't as easy to script with as
 Python.

 At the lowest level of the Python app, the last call in python is
 win32file.ReadFile( comport, bytes_, None ). I believe execution goes to a
 PyWin32 extension module at this point.

 By default, 1 is passed in for the number of bytes to read. I thought this
 was very inefficient,
 so I've experimented with values like 2,4,8,16. I didn't want to go higher
 than 16 because the serial port FIFO on many PCs isn't any larger than 16.

 While using cProfile, I could see that the number of function calls
 executed was cut in half,
 each time the # of bytes read doubled. Normally this would be a win, but
 the total time to dump the same amount of data over the serial port would
 almost double also.

 While this may not be strictly a Python-specific issue, the performance
 issue may be related to the Python-Win32 interface. For example, are there
 more efficient ways to read data from a serial port using Python, than
 calling win32file.ReadFile() ?

 I would also expect reading more 8-16 bytes at a time to be more efficient
 than reading 1 byte.
 I do expect that buffering weighs in heavily here, but I have no control
 over what the serial hardware does nor how windows interacts with it.

 Having read several of the Python optimization tips, I've already
 eliminated string concatenation, replaced globals variables with locals,
 and eliminated several dot references that are inside of loops.There
 doesn't seem to be any places I can use calls to map() or replace for loops
 with list/gen comps.

 There is too much code in the app to post here. I know it's difficult to
 comment on code that you can't see.

 The Python app is a single-threaded console app running on Python 2.7, but
 we've seen the same performance issues as far back as Python 2.3 on Windows
 XP.  I've finally decided to investigate this because users of the program
 are complaining about the time to dump the data.

 I would appreciate your thoughts on this issue.

 thanks

 ___
 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] optimizing code to read serial port

2014-02-15 Thread Vernon D. Cole
 I second the suggestion to try pySerial.  I have used it for years to
control RS-232 equipment -- don't know why I did not think of that.
Like Terra-Term, pySerial will use device-level, rather than
file-level APIs to talk to the UART.

Of course, your success will depend a great deal on the skill of the
programmer who wrote the driver for your USB-serial device. The
important part of the work is done in the driver when it processes
interrupts in Kernel mode. The USB adapter I tried -- well, lets just
say it's still sitting in a box of loose parts. That's why I have been
contemplating a Raspberry Pi purchase myself.   Perhaps we should take
this discussion off line and compare notes.


 On Sat, Feb 15, 2014 at 9:40 AM, RayS r...@blue-cove.com wrote:

 At 08:14 AM 2/15/2014, you wrote:

 Vernon

 Your suggestion is interesting but not practical for our needs.


 Have you profiled pySerial? http://pyserial.sourceforge.net/examples.html
 I use it in my LX200 serial telescope package
 http://rjs.org/Python/LX200/LXSerial.py/LXSerial.html
 http://rjs.org/Python/LX200.zip

 - Ray


___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] how to access SHOpenFolderAndSelectItems() by ctypes

2013-12-13 Thread Vernon D. Cole
Right.  You can't call a Windows service unless you are on Windows.

You will want to build a shim function which you call with a generic name.

It looks at what operating system it is running on, and then calls the
appropriate operating system specific code to perform the operation.  The
import of the operating system specific routines is done by that inner
routine. (I will use dots to replace spaces below.)

import sys
def launch_file_explorer(foo, bar):
..if sys.platform == 'linux2':
launch_linux_explorer(foo, bar)
..else:
launch_win_explorer(foo, bar)

def launch_win_explorer(foo, bar):
..from win32.com import shell, shelcon
..# etcetera

Remember that import is an executable statement.  It is not like the
include compiler directive you may be used to from a C like language.
It does not look for the imported module until you tell it to at run time.
If you never execute the import statement, no one cares whether the
module is actually present or whether it works.  Have you ever tried typing
import antigravity at a Python command prompt?  I think that is the sort
of action you want.

Look at the standard library source (it is in your Python distribution
folders) and read 'antigravity.py'  which in turn calls 'webbrowser.py' and
see how the experts do it.  Happy coding.
--
Vernon Cole



On Fri, Dec 13, 2013 at 1:02 PM, iMath 2281570...@qq.com wrote:

 I want to build a cross-platform application ,I used a windows API called
 SHOpenFolderAndSelectItems()http://msdn.microsoft.com/en-us/library/windows/desktop/bb762232%28v=vs.85%29.aspx.
 Although I found example called it by pywin32,but pywin32 is not available
 on Linux , I don't want to call a Windows API on linux,just don't want to
 make another code version for Linux,so I wonder how to access it by ctypes?
 yes,this API cannot be called on Linux ,I just want to make it silent in
 the code so that I can freeze the Python scripts into executables by
 cx_Freeze without pywin32 module-missing error happend .

 from win32com.shell import shell, shellconimport osdef 
 launch_file_explorer(path, files):
  '''
  Given a absolute base path and names of its children (no path), open
  up one File Explorer window with all the child files selected
  '''
  folder_pidl = shell.SHILCreateFromPath(path,0)[0]
  desktop = shell.SHGetDesktopFolder()
  shell_folder = desktop.BindToObject(folder_pidl, 
 None,shell.IID_IShellFolder)
  name_to_item_mapping = dict([(desktop.GetDisplayNameOf(item, 
 shellcon.SHGDN_FORPARSING|shellcon.SHGDN_INFOLDER), item) for item in 
 shell_folder])
  print(name_to_item_mapping)
  to_show = []
  for file in files:
  if file in name_to_item_mapping:
  to_show.append(name_to_item_mapping[file])
  # else:
  # raise Exception('File: %s not found in %s' % (file, path))


  shell.SHOpenFolderAndSelectItems(folder_pidl, to_show, 0)






 p=r'E:\aa'print(os.listdir(p))
 launch_file_explorer(p, os.listdir(p))



 ___
 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] Issues with service startup

2013-10-08 Thread Vernon D. Cole
This answer is a bandage, not a cure, but perhaps it will be enough in your
case...

The first moments of operation when a system (especially a server) is
booting up are replete with programs demanding resources which may not be
available yet. I found that simply adding a Python time.sleep() call near
the beginning of my program made the difference in reliability.

If you feel that package initialization may be part of the problem,
remember that in Python  import is an executed statement. We often treat
it as if it were a compiler declaration, but it is not.  So if you...
import time
print('Waiting for system to settle down...')
time.sleep(30)
import big_package
then big_package will not be imported until after things settle down.

I hope you find out what is *really* causing your problem, but until then,
try the quick and dirty work-around.
--
Vernon

On Mon, Oct 7, 2013 at 3:08 PM, Stan s...@vtwireless.com wrote:

 Has anyone dealt with Python based Windows Services not starting properly
 at system boot?  They start immediately after boot, but not at boot.
  Attempting to use various dependencies to make it start up later in the
 process hasn't seemed to help.

 I have to separate codebases that exhibit this issue, their commonality is
 they both connect to a PostgreSQL database on the machine, and use
 multiprocessing and threading.

 I don't have the issue narrowed down to a test case that exhibits the
 issue, but it occurs on some systems every single time, and on others only
 intermittently.

 For one of the two, delaying at service startup (sleep...) before
 importing wmi and pythoncom libraries seemed to cause it to stop failing at
 startup.  The other does not seem to use wmi/pythoncom directly.

 Event Type: Error
 Event Source: Service Control Manager
 Event Category: None
 Event ID: 7009
 Date: 10/5/2013
 Time: 2:35:49 PM
 User: N/A
 Computer: WINDOWSTEST1
 Description:
 Timeout (3 milliseconds) waiting for the MyTestApp1 service to connect.

 For more information, see Help and Support Center at
 http://go.microsoft.com/fwlink/events.asp.

 Event Type: Error
 Event Source: Service Control Manager
 Event Category: None
 Event ID: 7000
 Date: 10/5/2013
 Time: 2:35:49 PM
 User: N/A
 Computer: WINDOWSTEST1
 Description:
 The MyTestApp1 service failed to start due to the following error:
 The service did not respond to the start or control request in a timely
 fashion.

 For more information, see Help and Support Center at
 http://go.microsoft.com/fwlink/events.asp.


 ___
 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] embedded python can't import win32api

2013-09-04 Thread Vernon D. Cole
Dear David:
   Perhaps someone on this list can give a better answer than the one I am
about to give -- because I don't like what I am going to say...

ActiveState repackages Python, pywin32, and several other products in order
to make it easier to install all of them together, and they call their
package Active Python.  We here in the pywin32 community don't really know
what they may have done with their installer which might be contributing to
your problem.  Obviously, the .dll files are not where the loader expects
them to be (or are incorrectly protected) but where they are, and how to
fix the problem, we don't know. At least, I do not.

May I suggest that you try ActiveState support at
http://community.activestate.com/forum ?  They also have commercial support
and you could surely find help that way.

Again, I apologise for giving such an unhelpful answer.
--
Vernon Cole



On Wed, Sep 4, 2013 at 4:53 PM, David M. Cotter d...@kjams.com wrote:

 I'm embedding Python27 in my app. I have users install ActivePython27 in
 order to take advantage of python in my app, so the python installation
 can't be touched as it's on the end user's machine.

 When I attempt to do:
 import win32api

 i get this:
 Traceback (most recent call last):
  File startup.py, line 5, in
 ImportError: DLL load failed: The specified module could not be found.

 I someone suggested i manually load the dependent libraries in the correct
 order, like this:

 import pywintypes
 import pythoncom
 import win32api

 but then i get this:
 Traceback (most recent call last):
  File startup.py, line 3, in
  File C:\Python27\lib\site-packages\win32\lib\pywintypes.py, line 124,
 in
  __import_pywin32_system_module__(pywintypes, globals())
  File C:\Python27\lib\site-packages\win32\lib\pywintypes.py, line 64,
 in __import_pywin32_system_module__
  import _win32sysloader
 ImportError: DLL load failed: The specified module could not be found.

 the ultimate goal here is actually to do this:
 from win32com.client.gencache import EnsureDispatch

 which currently yields:
 Traceback (most recent call last):
  File startup.py, line 3, in
  File C:\Python27\lib\site-packages\win32com\__init__.py, line 5, in
  import win32api, sys, os
 ImportError: DLL load failed: The specified module could not be found.

 So, if anyone has any idea, that would be super duper great. thanks so
 much!

 notes:
 my paths are definitely set correctly, as i used the activepython installer
 when i run my script the first thing i see in the output window is:

  'kJams 2 Debug.exe': Loaded
 'C:\Python27\Lib\site-packages\win32\win32api.pyd'
  'kJams 2 Debug.exe': Loaded 'C:\Windows\SysWOW64\pywintypes27.dll'
  'kJams 2 Debug.exe': Unloaded
 'C:\Python27\Lib\site-packages\win32\win32api.pyd'
  'kJams 2 Debug.exe': Unloaded 'C:\Windows\SysWOW64\pywintypes27.dll'

 so i know it is finding those libraries

 i've searched the intertubes and found many, many people with this
 problem, over the years, but no real solutions. reinstall they say, well,
 i've done that several times. anyone know why this is?

 ___
 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] Passing string[] parameters to c# .NET function

2013-07-19 Thread Vernon D. Cole
Reaching to a .NET assembly from traditional (non managed) code such as
CPython is not easy.  Have you looked at IronPython?  It is true Python,
but is an implementation written in .NET, so it interacts with .NET
assemblies much more easily.
(Unfortunately, it has no ability to talk to Pywin32 functions.)

There is also a Python .NET project to call .NET routines from CPython --
but I don't personally know anything about it.
--


On Thu, Jul 18, 2013 at 11:14 AM, Tim Roberts t...@probo.com wrote:

 Aishwarya Sivakumar wrote:
   I tried [true], [[true]], and some more combinations of tuples but
 everything gave type mismatch error.

 Unfortunately, in COM there are several ways to declare an array of
 strings, and not all of those ways are easy to generate in Python. Are
 you able to run makepy on this class?  If so, you could look at the
 generated Python wrapper and tells us the type codes it discovered.
 That might help some of the Python COM experts come up with a recipe.

 --
 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] adodbapi and .hgeol

2013-06-14 Thread Vernon D. Cole
I found the following on [pywin32-checkins] this morning:

diff -r 4ded0a838f8c -r 1594b8c27383 .hgeol
 --- a/.hgeolMon Apr 29 10:01:40 2013 -0400
 +++ b/.hgeolThu Jun 13 18:29:09 2013 +1000
 @@ -2,4 +2,8 @@
 **.dsp = CRLF
 **.dsw = CRLF
 **.vbp = CRLF
 +# adodbapi appears to have been checked in with windows line endings
 +# and without the 'eol' extension enabled, so we say it's binary to stop
 +# hg continually thinking it has changed.
 +path:adodbapi = bin
 ** = native
 diff -r 4ded0a838f8c -r 1594b8c27383 CHANGES.txt
 --- a/CHANGES.txtMon Apr 29 10:01:40 2013 -0400
 +++ b/CHANGES.txtThu Jun 13 18:29:09 2013 +1000


No matter how old you get (I just turned 63) you still have new things to
learn. Until today, I have been completely unaware of an .hgeol file.

Since adodbapi now also runs on Linux, I had better make sure the line
endings stay right. Python does not care, nor does the Pythonwin IDE
editor, but I have not been consistant about what editor I use, which may
be the cause of this problem.

My quick reading of the documentation for .hgeol leads me to believe that
setting the entire adodbapi path to =bin is not the correct way to handle
this.  I will adapt my other mercurial repository to match this -- but I
want to do it right this time.  What line ending style are my Python and
.txt files supposed to have?  I will adapt my source.
--
Vernon Cole
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Notice: Restriction on use of adodbapi remote server with Pyro4 version 2.20

2013-06-13 Thread Vernon D. Cole
Pywin 32 users:

Anyone trying the new ADO remote/proxy feature of adodbapi:

Pyro 2.20 (just released) uses a new serializer which does not handle
decimal or datetime data types.  If you update your Pyro4, you need to
switch back to the old pickle serializer by defining the environment
variable
PYRO_SERIALIZER=pickle
--
Vernon Cole
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] adodbapi versions and Python 2.4 -- a status report.

2013-06-04 Thread Vernon D. Cole
I have just released an upgraded version (2.5.0) of adodbapi on its
sourceforge site.  http://sf.net/projects/adodbapi

( I suppose that I should say here, for the benefit on new readers, that
adodbapi is a PEP 249 compliant database api module which ships as part of
pywin32, as well as being available separately for IronPython users.)

Version 2.5 adds several new features, the most important of which is a
server module which can be used to enable a Windows computer to act as a
proxy so that a Linux (or Windows) client can use it to read an ADO data
source.  This version is a key part of an update to django-mssql which I am
now working on.

There are other new features which would be handy to Windows users in
general.  Connection strings can be built using keyword arguments, and can
be used to switch the default paramstyle and autocommit features of the
connection.

Because the remote and server modules use Pyro4 to communicate, and since
Pyro4 requires Python 2.5 or later, I have made use of Python 2.5 features
in the new version.  [ Relax, everyone.  The old way of connecting works
just like it always has -- you only need Pyro if you import the new
modules. ]

This means that there is now a version mismatch between the adodbapi in
pywin32 and the one on sourceforge.  There is nothing dangerous about that,
it only makes things a bit inconvenient for users who want the new
features.  I cannot upgrade the module here until the decision has been
made to drop Python 2.4 support.  The version in pywin32 (adodbapi v 2.4.3)
has been updated with the latest support requests and patches.
--
Vernon Cole
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] com proxy

2013-05-10 Thread Vernon D. Cole
Eric:
  Interesting timing. I assume you and your fellow bunch of crips are
motion impaired.  I happen to be in Africa just now working on the polio
vaccination effort in an attempt to reduce additions to your group.  My
mother-in-law (a polio victim) was quadriplegic and used breathing
assistance, and ran a telephone answering service for 17 years. Her voice
was her world. I wish she had something as nice as a computer that could
understand speech.
  Now to the subject... As we speak I am frantically crunching on a Python
proxy to bridge a COM link to the Linux environment.
   The specific COM link I am fighting with (and for) is the COM interface
to the ADO database engine.  I am attempting to build a remote ADO module
which talks to a Windows host which performs the COM calls to talk to a
database server.  I am getting pretty close -- close enough that the django
test routine running on Ubuntu can create and load a database and start
running tests against it -- before it runs into some kind of timeout or
thread exhaustion error.  I am trying to use Pyro4 as the network
communication layer.
  Is this something you can use?  Not yet, but it may be a starting point.
Stay in touch, please.
--
Vernon Cole



On Fri, May 10, 2013 at 1:27 PM, Mye Nyme ynotlayab...@gmail.com wrote:

 hopefully, someone here can either help or point me in the right direction.

 As some of you know, I used speech recognition in order to be able to work
 with computers. I'm looking for a way to direct the action of speech
 recognition onto a Linux machine. There are two components speech and
 commands. The way many of us create commands is via a NaturallySpeaking
 Python link. That link is created by a com interface. The first step in
 making action show up in a Linux environment is to move this
 NaturallySpeaking Python link to the Linux side. In order to do this, I
 would need a proxy to bridge the COM interface to the Linux environment.

 one) does that kind of bridge exists?
 Two) if not, is it possible to build it?
 3) (and you knew this was coming) feel like helping a bunch of crips?
 3a)  there are some political benefits nfpc.

  I'm thinking about operating in a Windows host Linux virtual machine
 environment. Not over any great extent of network. I choose the window
 hosts because that way we get the best performance out of speech
 recognition and if it's just running a virtual machine, it's pretty stable
 and safe from attack.

 --- eric
 __**_
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/**mailman/listinfo/python-win32http://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] announcing Beta test of adodbapi v2.5 with Linux remote from Windows server data access

2013-04-28 Thread Vernon D. Cole
I have tested this with Python 2.5 and up to 3.3. It tests well, but I
would like to have a few other people look at it before committing to
pywin32 release. This involved major re-factoring, so I may have missed
something that the unit tests do not catch.
Use of the server or remote sub-modules require Pyro4. Base module does not.
--
Beta test is now available for adodbapi version 2.5
--
ADO is Microsoft's update for ODBC, and can be used to open
almost any tabular data source in existance. I have personally
used adodbapi to read tables from: SQL Server, PostgreSQL, MySQL,
Jet (a.k.a. ACCESS), IBM DB2, Active Directory, and Excel.

Dozens of other sources are possible.  Since ADO is proprietary,
this requires the user to be running Windows.  I have added a new
remote module which will run on a Linux computer, and allow a
Windows computer to act as a proxy to make these data sources
available using a db-api version 2 interface on Linux.  The remote
client has almost the same interface as the local adodbapi --
except that custom error handlers and custom variant conversions
are not supported from the remote.

In order to make this work, I had to do major surgery on the way
adodbapi processes connection strings. (The complexity of a
connection string is the price you pay for the power of the ADO
connection engine.) I am happy to say that you can now follow the
PEP-249 suggestion using the USER, PASSWORD, HOST, and DATABASE
keywords (along with any others you wish to define) as arguments
to the .connect() method.

There are also connection keyword macros. Since the remote computer
may not be aware of whether the server is running 64 bit or 32 bit
Python (which require different ADO Providers) the remote may send
a macro to the server, allowing the server to choose the correct one.

There are also connection keywords for PARAMSTYLE, AUTOCOMMIT, and
TIMEOUT, which allow you to override those defaults at connection time.

There is a new method for the connection object:
.get_table_names() which returns a list of all the table names in your
database. This works pretty much everywhere, and will even
list the worksheets in a remote Excel spreadsheet.

The beta will be available in a source zip file from
https://sourceforge.net/projects/adodbapi/files/adodbapi/2.5.0/

A rough draft of documentation is supplied as an .odt file.

Please, several people try this and look it over.  If all goes well, in
a few weeks it will be part of django-mssql.
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Dropping support for Python 2.3?

2013-04-28 Thread Vernon D. Cole
2.5 is still good. I am suggesting (begging) that we drop 2.4 .
On Apr 28, 2013 11:31 PM, Andreas Holtz a.ho...@gmx.net wrote:

 I'm bound to Python 2.5.
 I make heavy usage of 4Suite which is not supported for Python 2.6+ so I
 can not upgrade :(
 Or does anyone know a good XML lib that support xpath?

 Regards

 Andreas

 schrieb Michael Manfre am 26.03.2013 14:08:

 Anyone running a no longer supported version of Python on Windows has
 already made the conscious decision that upgrading their code to newer
 versions is not worth the cost. No point in shifting that cost to pywin32
 maintenance. +1 on dropping all code from any version of Python
 that no longer receives security updates.

 Regards,
 Michael Manfre

 On Tue, Mar 26, 2013 at 8:44 AM, Kris Hardy k...@rhs.com mailto:
 k...@rhs.com wrote:

 +1

 Mark Hammond skippy.hamm...@gmail.com mailto:skippy.hammond@gmail.*
 *com skippy.hamm...@gmail.com wrote:

 I've been happy to drop support for a couple of years, but while
 it kept
 working I kept building it :) I can't recall if 2.4 is built with
 vc6
 too - if so, we might as well kill that too.

 Cheers,

 Mark.

 On 26/03/2013 8:33 PM, Vernon D. Cole wrote:

 Perhaps it is time...

 I found a copy of Python 2.3 to load onto a new computer in
 order to
 test my software, but it was not easy. It is in the small
 print about
 four pages down from the download page on python.org 
 http://python.org
 http://python.org. I was one of 432 people who have
 downloaded the
 2.3 installer for pywin32 build 218. Compared with 121,351
 downloaded
 installers fo r Python 3.3 and 2.7 combined, 431 is 0.35
 percent of our
 users. I discounted myself, because the only reason I
 downloaded the
 package was to make sure I have not broken something by using
 a new
 feature. I wonder how many of the others of that 432 are for
 similar
 reasons. Most, I would bet.

 Supporting that zero point three percent is costly, in terms
 of lost
 features. Adodbapi is not a large module, but there are half
 a dozen
 places in it which deal specifically with Python 2.3 -- such
 as import
 win32com.decimal.decimal_23 as decimal for example. There
 are two
 places which work around not having generator expressions,
 and a big
 question in the comments about handling the difference
 between long and
 int integers, and whether that is done correctly. There is
 also a
 confusing code block for float conversion with commas versus
 dots. All
 of that goes away if I simply change the all versions of
 CPython lat er
 than,,, line.

 The important differences in Python 2.4
 * decimal.Decimal
 * generator expressions
 * built in set objects
 * Decorators
 * unified integers
 * locale-independent float/string conversion
 * reverse iteration

 I am starting an informal poll...

 Is it really worthwhile to keep maintaining support for
 Python 2.3,
 which was released in 2005 and has not been updated since
 2008?
 --
 Vernon




 --**
 --**--**
 --**

 python-win32 mailing list
 python-win32@python.org 
 mailto:python-win32@python.**orgpython-win32@python.org
 
 
 http://mail.python.org/**mailman/listinfo/python-win32http://mail.python.org/mailman/listinfo/python-win32



 --**--**
 --**--**
 

 python-win32 mailing list
 python-win32@python.org 
 mailto:python-win32@python.**orgpython-win32@python.org
 
 
 http://mail.python.org/**mailman/listinfo/python-win32http://mail.python.org/mailman/listinfo/python-win32


 --
 Sent from my Android phone with K-9 Mail. Please excuse my brevity.

 __**_
 python-win32 mailing list
 python-win32@python.org 
 mailto:python-win32@python.**orgpython-win32@python.org
 
 
 http://mail.python.org/**mailman/listinfo/python-win32http://mail.python.org/mailman/listinfo/python-win32




 __**_
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/**mailman/listinfo/python-win32http://mail.python.org/mailman/listinfo/python-win32

  __**_
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/**mailman/listinfo/python-win32http

Re: [python-win32] Dropping support for Python 2.3?

2013-04-25 Thread Vernon D. Cole
This has also been discussed in the GUID thread, but I am bringing it back
to this one...

I have basically completed the work of breaking adodbapi up into a package
of smaller modules. It has really helped to make the code more readable.
There is now a remote module, so that a programmer (on Windows or Linux)
can do:

import adodbapi.remote as db
conn = db.connect('some connection string)

and expect the resulting connection to operate pretty much as if it were a
local database connection.

There is also a server module:
C:py -m adodbapi.server host=0.0.0.0

Tearing the old monolithic module apart was key to making those happen.
But now I am having trouble getting the legacy code in the test suite to
handle some obscure cases.

The easiest way out of my problem requires the use of explicit relative
imports -- which were introduced in Python 2.5.

Can we (please) drop 2.4?
--
Vernon

(P.S.: the remote and server modules require Pyro4, which in turn
requires Python 2.6)  I have carefully isolated the prerequisites so that
they do not appear unless you try actually using the new routines.)



On Wed, Mar 27, 2013 at 5:29 PM, Mark Hammond skippy.hamm...@gmail.comwrote:

 On 28/03/2013 5:18 AM, Roger Upole wrote:

 Python 2.4 is VS.Net 2003 (aka VC7).

 If we can drop support for Windows 95/98/ME while we're
 at it, it would eliminate some more maintenance headaches.
 At this point in time, even dropping Windows NT isn't unreasonable.


 Agreed.

 Mark



  Roger

 Mark Hammond skippy.hamm...@gmail.com wrote in message
 news:5151967F.3020006@gmail.**com...

 I've been happy to drop support for a couple of years, but while it kept
 working I kept building it :)  I can't recall if 2.4 is
 built with vc6 too - if so, we might as well kill that too.

 Cheers,

 Mark.




 __**_
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/**mailman/listinfo/python-win32http://mail.python.org/mailman/listinfo/python-win32


 __**_
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/**mailman/listinfo/python-win32http://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] pywin32 and virtualenv

2013-04-25 Thread Vernon D. Cole
Dinesh:

  Unless you plan on modifying the C language code of pywin32, or need to
add C language routines of your own, there is absolutely no advantage in
building pywin32 from source.  In almost all cases you are better off
downloading the pre-built installers.
(( If you ARE one of those rare C programmers, please forgive me for
speaking up. ))
--
Vernon

On Thu, Apr 25, 2013 at 3:59 AM, Dinesh B Vadhia
dineshbvad...@hotmail.comwrote:

 Re: [python-win32] pywin32 and virtualenv
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Dropping support for Python 2.3?

2013-04-25 Thread Vernon D. Cole
My apologies for publishing misinformation:  Pyro4 does not *require*
Python 2.6, it simply does not go out of it's way to support 2.5. In fact,
it does work. I have discovered that the 2.6 dependencies were in my own
code for the server and remote modules  fixed them.  I had to write a main
program to run the server.  It follows in full...

#!python2.5
 Python 2.5 will not run the server using py -2.5 -m adodbapi.server
but will run it this way
import adodbapi.server
adodbapi.server.serve()

So -- I was wrong.  The new features I am adding to adodbapi will work in
Python 2.5, and passed unittest a few minutes ago.  2.4 support is hopeless.
--
Vernon

On Thu, Apr 25, 2013 at 4:09 AM, Vernon D. Cole vernondc...@gmail.comwrote:



 (P.S.: the remote and server modules require Pyro4, which in turn
 requires Python 2.6)  I have carefully isolated the prerequisites so that
 they do not appear unless you try actually using the new routines.)


___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Python 3 -- Can't pickle class 'pywintypes.datetime'

2013-04-18 Thread Vernon D. Cole
Help me, Obiwan Kanobi...

I have been tracking this one down, for two days, and have cleaned by my
data conversion routines and the documentation for them as a result. but I
can't determine the right way to fix this.

This works fine in Python 2,  but in Python 3, the class of a datetime
retrieved from COM is different.  I can send them across a PyRO link in
Python 2,  when I try it in Python 3 I get: the error:

adodbapi.apibase.DatabaseError: Can't pickle class 'pywintypes.datetime':
attribute lookup pywintypes.datetime failed

The conversion code I use is:

def DateObjectFromCOMDate(self,comDate):
if isinstance(comDate,datetime.datetime):
return comDate.replace(tzinfo=None) # make non aware

Which returns a pywintypes.datetime, which, as you see, will not pickle.

Any suggestions?
--
Vernon
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] survey question: should data from database columns of type adGUID be returned as instances of class uuid?

2013-04-15 Thread Vernon D. Cole
I thought Mark approved dropping 2.4.  Did I misunderstand?
--
Vernon


On Mon, Apr 15, 2013 at 10:04 AM, Roger Upole rup...@hotmail.com wrote:

 I think the uuid module was introduced in python 2.5, might want to bear
 that in mind.

 Roger

 Vernon D. Cole vernondc...@gmail.com wrote in message
 news:CAH-ZgAeC9D+=1uybyjrztdob6bedjs8ayehrmqp-iyfwonm...@mail.gmail.com...
 I am doing a major update to adodbapi, and have an ideal opportunity to
 add
  a new feature ... but I want to see whether it is a desirable feature...
 
  When reading data from database columns of decimal or date-time data, I
  return them to the user as Python decimal.decimal or datetime.datetime
  instances.  I could do the same thing when reading of column of UUID data
  -- Windows data type adGUID -- and return it as an instance of the class
  uuid.
 
  Would that be a good idea, or a bad idea?
  --
  Vernon Cole
 



 


  ___
  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] survey question: should data from database columns of type adGUID be returned as instances of class uuid?

2013-04-14 Thread Vernon D. Cole
I am doing a major update to adodbapi, and have an ideal opportunity to add
a new feature ... but I want to see whether it is a desirable feature...

When reading data from database columns of decimal or date-time data, I
return them to the user as Python decimal.decimal or datetime.datetime
instances.  I could do the same thing when reading of column of UUID data
-- Windows data type adGUID -- and return it as an instance of the class
uuid.

Would that be a good idea, or a bad idea?
--
Vernon Cole
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Remote ado: should I use PyRO or DCOM?

2013-04-07 Thread Vernon D. Cole
Dear Gurus:

I have committed to the django community that I would provide a prototype
remote adodbapi function -- so that django running on Linux will be able to
open a MS SQL Server database. This work, if successful, may be expected to
result in SQL Server support becoming part of mainstream django. The major
modifications to adodbapi to support this are complete: you can now use
keyword arguments (like user= and host=) in your .connect() call and have
them inserted into your connection string.

I am trying to create a remote api connection using PyRO to communicate
with a server utility on Windows.  I can actually execute a simple query
now.

It occurred to me this morning that using PyRO to emulate remote COM calls
may not be the smartest design.  Perhaps I should be using DCOM -- that is
what DCOM was designed for after all.  A quick check shows that there are a
number of Linux DCOM implementations out there, from both the WINE and
SAMBA communities, and even a commercial version.  Let me start by saying
that I know absolutely nothing about DCOM, including the level of DCOM
support in pywin32.  (I did not know much about PyRO either, before last
week.)

So I am asking advice on which way to jump:
1) stick with PyRO all the way.
2) drop the PyRO effort immediately and start using DCOM.
3) go ahead and finish a basic remote client using PyRO, but plan on
re-doing it in DCOM for full functionality.
???
Vernon
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Dropping support for Python 2.3?

2013-03-26 Thread Vernon D. Cole
Perhaps it is time...

I found a copy of Python 2.3 to load onto a new computer in order to test
my software, but it was not easy.  It is in the small print about four
pages down from the download page on python.org.  I was one of 432 people
who have downloaded the 2.3 installer for pywin32 build 218.  Compared with
121,351 downloaded installers for Python 3.3 and 2.7 combined, 431 is 0.35
percent of our users. I discounted myself, because the only reason I
downloaded the package was to make sure I have not broken something by
using a new feature.  I wonder how many of the others of that 432 are for
similar reasons.  Most, I would bet.

Supporting that zero point three percent is costly, in terms of lost
features.  Adodbapi is not a large module, but there are half a dozen
places in it which deal specifically with Python 2.3 -- such as import
win32com.decimal.decimal_23 as decimal for example.  There are two places
which work around not having generator expressions, and a big question in
the comments about handling the difference between long and int integers,
and whether that is done correctly. There is also a confusing code block
for float conversion with commas versus dots.  All of that goes away if I
simply change the all versions of CPython later than,,, line.

The important differences in Python 2.4
* decimal.Decimal
* generator expressions
* built in set objects
* Decorators
* unified integers
* locale-independent float/string conversion
* reverse iteration

I am starting an informal poll...

Is it really worthwhile to keep maintaining support for Python 2.3, which
was released in 2005 and has not been updated since 2008?
--
Vernon
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] (only in Python 3) decimal.Decimal cannot be converted to a COM VARIENT

2013-03-25 Thread Vernon D. Cole
Guys:
  I am starting work on an upgrade to adodbapi -- so I set up a new
improved test layout and started
running some baseline tests before changing any application code.  I just
tripped across this one: I don't know whether it is actually new or whether
my new tests exposed something which has been there a long time and never
noticed.  The interesting thing is that this does not occur on Python 2
(whether or not I am running 64 bit Python) -- I only see it on Python 3.3
64 bit.  I have not tried any other Python 3 versions yet.

I am ready to provide more or better (small example) test cases if that
would help, but if one of you can see what's wrong from just this clip, I
will spend my time elsewhere.  What other info would be useful when I
submit the ticket?
--
Vernon Cole

[Note: this is the hg tip from sf.net/projects/adodbapi -- not the copy in
/pywin32.  I don't want to update that until this is completely working. ]

clipped console dump follows
C:\Users\vernon\PycharmProjects\adodbapi\testc:\python33\python.exe
adodbapitest.py
3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64 bit
(AMD64)]
node=z-PC: is64bit.os()= True, is64bit.Python()= True
[...clip...]
ERROR: testDataTypeMoney (__main__.TestADOwithAccessDB)
--
Traceback (most recent call last):
  File
c:\users\vernon\appdata\local\temp\adotest_k0ojue\adodbapi\adodbapi.py,
 line 969, in _buildADOparameterList
_configure_parameter(p, value, self.parameters_known)
  File
c:\users\vernon\appdata\local\temp\adotest_k0ojue\adodbapi\adodbapi.py,
 line 403, in _configure_parameter
p.Value = value
  File c:\python33\lib\site-packages\win32com\client\dynamic.py, line
560, in
__setattr__
self._oleobj_.Invoke(entry.dispid, 0, invoke_type, 0, value)
TypeError: Objects of type 'decimal.Decimal' can not be converted to a COM
VARIANT
/clip
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Makepy for Access on Win7

2013-03-08 Thread Vernon D. Cole
Hartmut:
  If what you are doing is copying data between an ACCESS table and
something else that can be reached from ADO, you might want to consider
doing the entire thing from Python using adodbapi.  You can do that without
even having a copy of Office on your computer.  You can glean the
connection information from your sitepackages/adodbapi/tests folder.
  If, on the other hand, you are controlling ACCESS in some more advanced
manner, then just install the 32 bit versions of Python and pywin32.  They
will work just fine on your 64bit Windows, and will be able to talk to
their 32bit friends via COM.
--
Vernon


On Fri, Mar 8, 2013 at 10:58 AM, Tim Roberts t...@probo.com wrote:

 Niemann, Hartmut wrote:
 
  I had to switch from Windows XP to Windows 7 and redo my python
  installation there.
  I need to generate COM modules for Microsoft products I use.
 
  When running makepy on Windows 7 / Python 2.7.3 (64bit) /
  pywin32-218.win-amd64-py2.7.exe for
  Microsoft Access 12, I get:
  ...
  com_error: (-2147312566, 'Fehler beim Laden der Typbibliothek/DLL.',
  None, None)

 That is 80029C4A, which is TYPE_E_CANTLOADLIBRARY.  You aren't going to
 like this answer.

 It looks like you have 64-bit Python, but 32-bit Office.  You can't load
 a 32-bit DLL into a 64-bit process.  Now, most of the 32-bit Office
 components have a 64-bit proxy available to make that crossover, so you
 can invoke them from 64-bit processes.  For whatever reason, it appears
 that Access does not do this.  Even worse, you can't install 64-bit
 Access if you already have 32-bit Office installed.

 There is some indication that this might help:
 http://www.microsoft.com/en-us/download/details.aspx?id=23734
 but I think you are in for some painful Google time.

 --
 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