Jump to content

pyscripter

Members
  • Content Count

    920
  • Joined

  • Last visited

  • Days Won

    56

Everything posted by pyscripter

  1. pyscripter

    P4D Android external library

    Also have a look at this sample from https://github.com/Embarcadero/P4D-Data-Sciences/.
  2. pyscripter

    P4D Android external library

    Dependencies: Please make sure the following are installed before installing this library and in the following order: Python4Delphi PythonEnvironments Lightweight-Python-Wrappers Each library depends on the one above it, once these are installed this library will also install
  3. pyscripter

    P4D Android external library

    To automatically deploy python modules you need to use these related projects: Embarcadero/Lightweight-Python-Wrappers: Lightweight Wrappers based on Python4Delphi to make it easy to import Python modules into Delphi components. (github.com) Embarcadero/PythonPackages4Delphi: General collection of Python Packages wrapped for use in Delphi and C++Builder (github.com) Embarcadero/P4D-Data-Sciences: A collection of lightweight Python wrappers based on Python4Delphi simplifying Data Sciences development with Delphi (github.com) The second one already contains the wrapped MoviePy python package.
  4. pyscripter

    Python4Delphi Crash immediately after launch

    You do not need to understand anything, Just place a breakpoint on the Initialize statement and after the debugger stops there, keep pressing F7 (step in) until the error occurs. Anyway, I have downloaded the embedded version of python 3.12.6 64bits from https://github.com/adang1345/PythonWin7, extracted the zip file in a directory and used the following properties in PythonEngine: DllPath C:\python-3.12.6-embed-amd64 PythonEngine.RegVersion : 3.12 PythonEngine.DllName : python312.dll PythonEngine.UseLastKnownVersion : False It seems to work fine on a Windows 11 machine. You can try the same on your windows 7 machine.
  5. pyscripter

    Python4Delphi Crash immediately after launch

    So why don't you step in Initialize?
  6. pyscripter

    Python4Delphi Crash immediately after launch

    Just step into LoadDLL and observe where exactly the error occurs. I am not a magician. As I said, python 3.12 + windows 7 + delphi XE2 is not supported by python and by P4D. If you can come up with a fix I would consider implementing it.
  7. pyscripter

    Python4Delphi Crash immediately after launch

    Possibly. There have been a lot of changes in the last six months. I am afraid support for running unofficial newer versions of python on Windows 7 is outside the scope of the P4D project. It might help though if you debug and report at which exact point the error occurs.
  8. pyscripter

    Python4Delphi Crash immediately after launch

    That's why we debug programs stepping through the code, To know exactly where the error occurs. And what do you mean crash? Cannot you debug and step into LoadDLL? Or set FatalMsgDlg to True and FatalAbort to False. Do you get an error message? Most likely the python dll fails to load. The most common reason: Are you compiling for 64bits? For more details please read FindingPython · pyscripter/python4delphi Wiki (github.com) Also, could you update python to 3.12.3 and see whether it makes a difference? Needless to say that I cannot reproduce the issue here.
  9. pyscripter

    Python4Delphi Crash immediately after launch

    There is no such code in P4D. Instead: PyWideStringList_Append(PWSL, PWCharT(StringToWCharTString(Paths[I]))); Your code sample above makes no sense. SplitString returns a string array. So code like this: writeln(PansiChar(ansistring(ar))); should contain array indices (e.g. ar[1]). And in any case that code is only executed if you try to set the python path and has been around for quite a while. It is not executed for example by any of the demos. With the latest change Demo36 should work without issues. Again please provide a minimal project that produces errors.
  10. pyscripter

    Python4Delphi Crash immediately after launch

    This was not related to the latest revisions. There was an issue in the Demo related to PythonEngine being destroyed before the threads terminated. This is now fixed in version control. Please try with the latest release and report if the issue has been fixed.
  11. pyscripter

    Python4Delphi Crash immediately after launch

    Which version of P4D are you using? Getit or github and if the latte from which repo? Which version of python? Could you post a minimal project that reproduces the crash?
  12. pyscripter

    P4D Android error

    You need to deploy python to the Android device for this to work. Please see: Embarcadero/PythonEnvironments: Components to simplify the deployment for Python environments for Delphi applications using Python4Delphi. (github.com) and PythonEnvironments/samples/environments/deploy/sample_06_SimpleAndroid at main · Embarcadero/PythonEnvironments (github.com)
  13. pyscripter

    TTaskDialogs not working with Delphi Styles

    As mentioned above, 12.2 works correctly at 300%, But maybe there is an issue when running inside a VM.
  14. pyscripter

    How to release memory used by exceptions?

    This was a reference counting bug. This is now fixed in version control. See Memory leak when PyErr_SetObject is used · Issue #485 · pyscripter/python4delphi (github.com). Could you please try with the latest version and report whether the issue is solved.
  15. pyscripter

    How to release memory used by exceptions?

    Could you please post a minimal project (zipped) demonstrating the memory leak?
  16. pyscripter

    TTaskDialogs not working with Delphi Styles

    I am using the Delphi 12 IDE on a 300% display and I am not observing such issues. In PyScripter I am using the SilverpointDev/sptbxlib: SpTBXLib is an expansion package for TB2K Delphi components that adds multiple features including support for styles and custom skins. (github.com) for menus, which I think is still the best Delphi menu components and work really well with VCL styles and Hi-DPI.
  17. pyscripter

    TTaskDialogs not working with Delphi Styles

    Please allow me to disagree. You can produce good-looking flicker-free and DPI-aware applications with recent versions of Delphi. Have you tried PyScripter for instance? The Delphi IDE is also built with VCL Styles.
  18. pyscripter

    TTaskDialogs not working with Delphi Styles

    https://quality.embarcadero.com/browse/RSP-41990 See also EtheaDev/StyledComponents: Components similar to Delphi VCL Buttons, Toolbar, DbNavigator, BindNavigator, ButtonGroup and CategoryButtons with Custom Graphic Styles, and an advanced, full-customizable TaskDialog, also with animations! (github.com). They contain a Task Dialog can be displayed with Vcl Styles (and many others). File dialogs are styled by VCL though. I am not aware of any major issues.
  19. pyscripter

    InputQuery issue..

    Use the overload without the last argument (which cannot be nil): if InputQuery('User Information', ['Enter your name:', 'Enter your age:', 'Enter your city:'], Values) then
  20. pyscripter

    clear a tjsonobject

    There is: function TJSONObject.RemovePair(const PairName: string): TJSONPair; To clear all pairs: JsonObject.SetPairs([]); You could also Free the JsonObject and create a new one.
  21. The following code (from VirtualTrees) raises a new warning in Delphi 12.2: TVirtualTreeColumns = class(TCollection) ... property Items[Index : TColumnIndex] : TVirtualTreeColumn read GetItem write SetItem; default; ... end The warning says: [dcc64 Warning] VirtualTrees.Header.pas(280): W1075 Overloading a similar index type by declaring an array property 'Items' VirtualTrees.Header.pas(280): Related member: property TVirtualTreeColumns.Items[TColumnIndex]: TVirtualTreeColumn; VirtualTrees.Header.pas(280): Related member: property TCollection.Items[Integer]: TCollectionItem; I get quite a few similar warnings in my code base. Clearly the overwriting (and not overloading) is intentional. Any ideas of how to get rid of this warning without suppressing it?
  22. Does anyone recall in which Delphi version TStringHelper was introduced and in particular TStringHelper.Split? Thanks!
  23. pyscripter

    File Open Dialog Preview

    SVG Shell Extensions contains examples of how to create Windows File Explorer extensions, both preview and thumbnail.
×