How to close gimp with batch command? - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +--- Thread: How to close gimp with batch command? (/Thread-How-to-close-gimp-with-batch-command) |
How to close gimp with batch command? - flixe - 06-19-2017 I have a simple question: When i run a python script via gimp, how can i close the command line window saying "press any key to close"? I'm calling my script like this: "C:\Program Files\GIMP 2\bin\gimp-2.8.exe" -idf --batch-interpreter python-fu-eval -b "import sys;sys.path=['.']+sys.path;import PDF;PDF.process('%1','%2');" -b "pdb.gimp_quit(1)" When i run the command an extra cmd window opens, which belongs to the gimp-2.8.exe process. Now how can i close it automatically? I would have thought pdb.gimp_quit(1) would actually do exactly that but it doesn't! I have also tried gimp.quit() within my python script, but it's not working. Can anyone explain to me what is happening and if there is any way to finally close this stupid command line window? Thanks... RE: How to close gimp with batch command? - Kevin - 06-19-2017 Try using the gimp-console-2.8.exe instead of gimp-2.8.exe RE: How to close gimp with batch command? - flixe - 06-19-2017 Then it just get an error saying "python-eval.py has crashed. The plugin python-eval.py has crashed." This is how i invoke my script: Quote:"C:\Program Files\GIMP 2\bin\gimp-console-2.8.exe" -idf --batch-interpreter python-fu-eval -b "import sys;sys.path=['.']+sys.path;import PDF;PDF.process('%1','%2');" -b "pdb.gimp_quit(1)" This is my script: Code: import os,time,sys,glob,re Please help.... RE: How to close gimp with batch command? - Kevin - 06-19-2017 And what happens if you redirect standard-out and standard-err to a file: Code: "C:\Program Files\GIMP 2\bin\gimp-console-2.8.exe" -idf --batch-interpreter python-fu-eval -b "import sys;sys.path=['.']+sys.path;import PDF;PDF.process('%1','%2');" -b "pdb.gimp_quit(1)" 1>/tmp/gimp_startup.txt 2>&1 RE: How to close gimp with batch command? - flixe - 06-19-2017 (06-19-2017, 01:39 PM)Kevin Wrote: And what happens if you redirect standard-out and standard-err to a file: I tried that and this is the content of gimp_startup.txt: Code: Error processing line 3 of C:\Program Files\GIMP 2\Python\lib\site-packages\pygtk.pth: However: IT WORKS! I don't really understand why but now it is not even opening the other console window, just as it should be! Thank you! RE: How to close gimp with batch command? - Kevin - 06-19-2017 It only opens the console window because it's needing to send things to std-out and std-err, as you're now redirecting them, there's no-need to open the console window. Note that putting print statements into python-fu code on Windows is potentially going to cause problems as they get sent to a buffer which will overflow and hang GIMP. |