Jump to content

pyscripter

Members
  • Content Count

    781
  • Joined

  • Last visited

  • Days Won

    42

Posts posted by pyscripter


  1. 10 minutes ago, Juan C.Cilleruelo said:

     PyEngine.LoadDll;

          p := PyEngine.PyLong_FromLong(1);
          PyModule.SetVar('QUANTITY', p);
          PyEngine.Py_DecRef(p);

          PyEngine.IO := FPythonIO;

    Set PyEngine.IO before you call LoadDLL

     

    Redirection is setup by TPythonEngine.Initialize, which is called by LoadDLL.


  2. P4D works fine with miniconda distributions.  Read FindingPython · pyscripter/python4delphi Wiki (github.com) for details.

    1 hour ago, superc said:

    I Download embeddable version of Python 3.10.8 and copy *.dll and python310.zip

    There is no need to do that.  If on the other hand you want to deploy python with your application, have a look at this project Embarcadero/PythonEnviroments: Components to simplify the deployment for Python environments for Delphi applications using Python4Delphi. (github.com)

     


  3. 10 minutes ago, programmerdelphi2k said:

    just unchecking "Inherit" (on Event) does not works?

    If you uncheck the event inherit in derived configurations, then you would need to define it again.

    The question is why Delphi replicates an event defined for All Configurations for each configuration and how you can prevent that. 


  4. 20 minutes ago, Uwe Raabe said:

    Which platforms are in that project?

    Win32 and Win64.

     

    The problem was that the following was in the project file:

        <PropertyGroup Condition="'$(Cfg_2)'!=''">
            <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
            <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
        </PropertyGroup>

    which was overriding the platform settings.  I don't know how this got into the project file.  Project Magician was not cleaning it and this was overriding the platform settings.  After deleting the Manifest line in the above, things seem to work as expected.

     

    One more question.  I have a build event defined for all configurations.  Delphi keeps one replicating that for every configuration:

        <PropertyGroup Condition="'$(Config)'=='Debug' And '$(Platform)'=='Win32'">
            <PreBuildEvent/>
            <PreBuildEventIgnoreExitCode>False</PreBuildEventIgnoreExitCode>
            <PreLinkEvent/>
            <PreLinkEventIgnoreExitCode>False</PreLinkEventIgnoreExitCode>
            <PostBuildEvent>copy "$(BDS)\Redist\$(Platform)\WebView2Loader.dll" $(OUTPUTDIR) </PostBuildEvent>
            <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode>
        </PropertyGroup>

    The above is replicated for all configurations.   Even when I manually delete the above from the project file manually, Delphi recreates it.  Any idea why?  Could that be cleaned up?


     

     


  5. 57 minutes ago, Uwe Raabe said:

    Correct! That is the setting that allows to set the custom manifest for all configurations.

    In Project Magician options "Clear Application Settings" is set on by default.

    But I still cannot set Manifest options for all configurations.   How do I do that?

     

    Update:  RTDS  

    "All application settings in child configurations are removed and the base settings put in charge again. This effects the Icons, Manifest File, Output Settings and Appearance. Application settings are always platform based and thus the settings in the platform base configuration are the ones to be kept."

     

    I need to set them for each platform.

     


  6. Project Magician by @Uwe Raabe is such a great idea, but somehow every time I decide to use it, I end up regretting it.

    This time the issue relates to custom manifest files.  My project had one, but after activating Project Magician, saving and building my project this custom manifest file was not included.  My application was released with a wrong manifest file.:classic_angry:

    I went to Project Options, set it again, save my project, close, open again, the setting disappeared.

    What am I doing wrong?  Delphi does not allow me to set the custom manifest for all configurations.  It has to be set for each configuration individually.

     


  7. Is this a failure to load the python DLL or an error when executing python scripts?

    Are you using the latest sources from the Github repo?

     

    Also check out the following:

    FindingPython · pyscripter/python4delphi Wiki (github.com)

    MaskFPUExceptions · pyscripter/python4delphi Wiki (github.com)

     

    If you are using python version 3.11.1 then please try with  version 3.11.0 or earlier.   There is a change related to the loading of dynamic libraries (dll) in 3.11.1, that I am looking into.  See regression with latest Python 3.11.1 and _socket not found · Issue #100171 · python/cpython (github.com)


  8. I have just noticed that Ctrl+F does not work in my Desktop Delphi 11.2 help files.  (Windows 11 22H2).   But it works in my laptop, which is also Windows 11 22H2.  Strangely Ctrl+F does not work with PyScripter help on either the Desktop or the Laptop.   Weird.


  9. Please post questions regarding P4D to the Third Party P4D support forum.

     

    What is this InitThread?

     

    Using python threads requires deep knowledge of the Python API and the complexities of GIL.

    If do have to use threads, please study Demo  11  and the related posts in the P4D forum Showing results for 'Py_Begin_Allow_Threads'. - Delphi-PRAXiS [en] (delphipraxis.net)  


  10. 5 hours ago, programmerdelphi2k said:

    here Ctrl+F works

    Which Delphi version?

    Which Windows version?

     

    Could you please try using the Delphi way?

    • Add   Vcl.HTMLHelpViewer to the dpr uses clause
    • Set Application.HelpFile = to your chm file
    • Use the Application Help commands to invoke help (e.g. Application.HelpShowTableOfContents. Application.HelpContext etc.)

  11. 20 minutes ago, programmerdelphi2k said:

    it would be because "Ctrl+F" is a "Search on Editor-code"?

    Thanks for responding.  No, it is not that.   I have tested with a new minimal app, just a form and a button to open the help file, and the issue still exists.  I think it used to work with earlier versions of Windows/Delphi.


  12. In my Delphi apps, I use the dated CHM Html Help format to provide user help.   When help is invoked from the Delphi app using the Application help commands, Ctrl+F to search within a help page does not work.  However, if open the same chm file outside the Delphi app, Ctrl+F works fine.  Any clues as to what causes this issue?

     

    Note: The Delphi app is compiled with Alexandria (v11) and I am testing on Windows 11. 

×