Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GIMP python script from command line
#7
(12-08-2020, 09:13 AM)ghoul fool Wrote:
(12-08-2020, 07:28 AM)Ofnuts Wrote: Do you get any output from the Python code (print statements)? Otherwise see here for some hints.

PS: I don't see how Gimp or the Python code could change the status of the directory. OTOH IIRC on recent Windows unknown apps are not always allowed to write files, so maybe you need to give Gimp some privileges.

I've reinstalled as Admin, and I'm able to create a script create a folder (yay!  Big Grin)

Code:
def make_dir():

 mainDir = "D:\\temp\\images"
 folder = "spoon"
 fname = os.path.join(mainDir, folder)

 # make a directory
 os.mkdir(fname)

 msg = "Make a " + folder + " directory!! " + "\n"
 gimp.message(msg)

Now the main thing is trying to work out
(a) how to get some sort of error log feedback and (b) which line/s doesn't it like.

You can just type python yourscript in a command line and python will show the most blatant errors (unbalanced quotes/parens, indentation errors, etc...). If you don't get any of these, then you can use the trick expounded in the tutorial thread above to reroute all Python output to file.

Of course, all this is a lot easier on Linux Big Grin
Reply


Messages In This Thread
RE: GIMP python script from command line - by Ofnuts - 12-08-2020, 11:38 PM

Forum Jump: