Skip to content

Conversation

@bentheiii
Copy link

3 changes:

  • GetDllPath moved to public: useful for people who want to make sure they're using the right python environment
  • Option to use latest DLL: needed for machines with both 2.7 and 3.x that want to use 3.x. changes the version search to be reversed (last version is tested first)
  • utf8: The cleaned strings are now convererted to utf8, allowing for strings in other languges in 3.x

@pyscripter
Copy link
Owner

Have a look at PythonVersions.pas. It does all that and more.

@bentheiii
Copy link
Author

bentheiii commented Jun 26, 2018

Noted for the first two points, I don't think it can handle the the third (non-ascii source code).

If it doesn't I will close and re-open with only the utf-8 fix.

@pyscripter
Copy link
Owner

pyscripter commented Jun 28, 2018

You can always encode the text your self before passing it to python. This is what PyScripter does. The thing is that Python 2.x expects ansi and Python 3.x expects utf8. Maybe I can add a function overload that expects utf8. But it would need to be checked for Delphi/FPC compatibility.

@pyscripter
Copy link
Owner

Superceded by #59

@pyscripter pyscripter closed this Oct 9, 2018
@idanmiara
Copy link
Contributor

Please advise how to set python4delphi to choose the newest (and not oldest) available python dll (as currently if two versions are available at the same folder you choose the older one).
If it's not available, we can send you a pull request for this feature again.
Thanks!

@pyscripter
Copy link
Owner

Have a look at PythonVersions.

GetLatestRegisteredPythonVersion(PythonVersion);
PythonVersion.AssignTo(PythonEngine);

See also Demo34

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants