On 03/02/2015 02:22 PM, Gisle Vanem wrote:
Dave Angel wrote:

When I ran Windows, I had written a simple utility that searched the
PATH for a specified file.
I called it which.bat to match the Linux equivalent.

I've written a similar tool; envtool --path --python python27.dll

Matches in %PATH:
       15 May 2013 - 21:43:38: f:\ProgramFiler\Python27\python27.dll
Matches in Python's sys.path[]:
       15 May 2013 - 21:43:38: f:\programfiler\Python27\python27.dll

(available at http://watt-32.net/misc/#envtool )

You can look to see where the system thinks the Python executable is
located by doing

     ftype .py
and seeing what it shows.  Mine shows Python.File

   Then do
     assoc  Python.File

to see an actual path.

That will give you the path of python.exe. Not pythonXX.dll (as the
OP had problems with).

I just figured it was extra information the OP could use; finding the executable is a useful thing, even though different from finding the DLL.


But by Windows DLL loading rules, it's IMHO safer to have pythonXX.dll
in the directory of python[w].exe. On Windows, ACAICR the Python MSI
installer puts pythonXX.dll in %Windir\system32. So it depends on how
the OP installed his Python.


Doesn't do much good to have the DLL only in the python directory, if you're going to load it in a default way from a C++ program. Python.exe doesn't do much, it mainly parses the commandline and invokes the DLL. Other programs that want to call Python functions don't need the exe, and therefore count on the DLL being on the Windows path.

The OP sent me a private message saying:
   "Python.dll was found in my C:/Windows/SysWOW64 dir"

I responded and intended it to be posted to the list, but messed up. You should see it by now.


--
DaveA
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to