Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PythonVersions.pas - improved PythonVersionFromPath with a new parameter FindLatestVersion #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
idanmiara wants to merge 2 commits into pyscripter:master from talos-gis:master

Conversation

@idanmiara
Copy link
Contributor

@idanmiara idanmiara commented Oct 15, 2018

I've implemented this feature it as you suggested.

Copy link
Owner

pyscripter commented Oct 15, 2018
edited
Loading

PythonVersionFromPath was meant to be used with the home path of python. So it checks whether python.exe exists in the same folder as the python??.dll. In QGIS is python.exe located in the same folder as the dll? And if there more than one dll's are located in the bin folder to which version python.exe corresponds to?

 // check if same platform
 try
 if {$IFDEF CPUX64}not {$ENDIF}IsEXEx64(DLLPath+'\python.exe') then Exit;
 except
 Exit;
 end;

Copy link
Contributor Author

idanmiara commented Oct 15, 2018 via email

hmm.. I didn't notice that test before. QGIS put the following along with the python dlls in the bin folder: python.exe (for python27.dll); python3.exe (for python36.dll) The libraries are located in separate folders under apps. They don't mix architectures, so technically it would work because all of these would be either x86 or x64 so checking python.exe would be sufficient. We could check the dll architecture instead of the exe but it seems more complicated: https://stackoverflow.com/questions/971689/win32-api-to-tell-whether-a-given-binary-exe-or-dll-is-x86-x64-or-ia64 https://stackoverflow.com/questions/495244/how-can-i-test-a-windows-dll-file-to-determine-if-it-is-32-bit-or-64-bit I don't see a justification for that.
...
On 2018年10月15日 at 14:34, pyscripter ***@***.***> wrote: PythonVersionFromPath was meant to be used with the home path of python. So it checks whether python.exe exists in the same folder as the python??.dll. In QGIS is python.exe located in the same folder as the dll? And if there more than one dll's are located in the bin folder to which version python.exe corresponds to? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#61 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AZIQrXEIB84a5DLDC_sCORfriifOo7L6ks5ulHKwgaJpZM4XcGZ4> .

Copy link
Owner

pyscripter commented Oct 15, 2018
edited
Loading

As mentioned above PythonVersionFromPath was meant to be used with the home path of python and not with another path that just contains dlls and exes. Other PythonVersions functionality will not work (is_venv, is_virtualenv etc.). Also, your version PythonVersionFromPath is much slower than the original, since it uses FileExist for all possible python??.dll.

QGIS folder setup is a special case that you can accomodate in your own code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /