Jump to content
JGMS

How to get Python functions running in the background (P4D)

Recommended Posts

I want to run python functions in the background, for example like so:

MI_CopyrightAddition.Enabled := false;
TTask.Run( Procedure
begin
 PyForm.Add_Copyright_Using_Python(FotoSerie,CopyRightTeken + String(CopyRightTekst), False);
 TThread.Synchronize(nil, procedure
   begin
     MI_CopyrightAddition.Enabled := TRUE;
   end);
end);



"PyForm.Add_Copyright_Using_Python" is a correctly working Python function, running normally in the main Thread.

But in the above scheme it crashes:
"Project .... raised exception class $C0000005 with message 'c0000005 ACCESS_VIOLATION'."

Is there a way to get this working?

Many thanks for your time.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×