Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the correct way to close a python batch job?
#1
Hi all,

I've been trying hard to get a batch script converted over from script-fu in Python but I'm struggling to get it to close the process as I can't seem to get it to close GIMP. The script runs but it won't kill the process so is making everything hang. 

I can't seem to find any docs on how to actually do some of this stuff, it seems that those that know, know and I'm not sure how to fill in the gaps in my knowledge. 

Up front I'm new to python but a long in the tooth coder in various other languages.

So my question is, what is the correct way to close GIMP these days?

I'm running GIMP 2.10.18 on Windows 10

This is roughly my command I'm running:

"C:\Program Files\GIMP 2\bin\gimp-console-2.10.exe" -id --batch-interpreter python-fu-eval -b "import sys;sys.path=['.']+sys.path;import mydynamicTextReplace;dynamicTextReplace.process('my_example_param_1')"

So far I've tried (yep I'm in cut and paste "lets see if this works" land at this point):

  1. Adding '-b (gimp-quit 0)' to the end of the command, this was a left over from the script-fu script and I think this fails as I've told it to use the python parser not script-fu?
  2. Adding '-b "pdb.gimp_quit(1)" ' to the end of the command, no luck with this one
  3. Adding '-b "gimp.quit(1)" ' to the end of the command, no luck with this one either
  4. Adding variations of "gimp.quit" and "pdb.quit" to the end of my script that I'm importing but these all seem to have zero effect
Thought and guidance? Are there any docs online about doing this sort of stuff better, it feels way to fumbling around in the dark to me and I've been at this several sessions now.

Many thanks in advance.
Reply


Messages In This Thread
What is the correct way to close a python batch job? - by sethsdad - 03-24-2020, 10:22 PM

Forum Jump: