Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python console
#1
Hi

What exactly can the python console do in gimp and for what do you use it?
Is there any docs?

A small example of its usage would be great!
Reply
#2
I understand it's used for pasting-in python code and error checking it. If there is no error then the code should run OK
Reply
#3
(02-28-2024, 08:37 PM)Tas_mania Wrote: I understand it's used for pasting-in python code and error checking it. If there is no error then the code should run OK

Also a whole plugin written in python because that's what you use python for in GIMP?
It's not clear for me what exactly you can use it for.
Reply
#4
(02-28-2024, 05:29 PM)gimpygirl Wrote: Hi

What exactly can the python console do in gimp and for what do you use it?
Is there any docs?

A small example of its usage would be great!

   

Your big friend is the "Browse..." button. let's you search the API (PDB). Methods/attributes shown above are mostly shorthand to PDB entries so if you can't guess how they work, search for something like-named in the PDB. In the Browser, when you hit Apply, a sample call is pushed in the console input, so the code is almost written for you.

Reply
#5
Hi

I think you're an expert.

Are you not interested maybe in writing a small PDF file that has all these tips and tutorials bundled?
So about the python console, debugging, ...
There is just no information to be found online and as a beginner you don't know what to do.
Even the example above is of great value. I know immediately how it works.

So that's why I ask.
It could become the best resource for plugin developers!

What do you think?

Another question: do I need to restart GIMP for each code change in a plugin?
There is for script-fu a refresh menu-item but not for python-fu

All these tips should be bundled somewhere. It would also save you A LOT of time answering the same questions over and over again :-)
I hope you like the idea of making a PDF file. You can just copy paste the tutorials you already wrote on the forum.
Reply
#6
Experience shows that people hardly read the docs or can't find them on Google, or can't find how the doc apply to their problem. And seasoned coders don't need the same doc as beginners....

(02-28-2024, 11:59 PM)gimpygirl Wrote: Another question: do I need to restart GIMP for each code change in a plugin?
There is for script-fu a refresh menu-item but not for python-fu

No need to restart Gimp, unless the change impacts the registration (adding/changing parameters to the script). When Gimp (re-)starts it checks if the files have changed since the previous registrations and runs them to re-register if so. Usually, I write a script that just register an empty function, and then I add code to the function little by little.

Script-fus are different animals, the script-fu executor has to be told to check for new code versions (hence the refresh) but it can update the registration data without restarting Gimp.
Reply
#7
I'll be honest here, I've looked at both python-fu and script-fu consoles, and hit the browse buttons. And having done so, I'm clueless as to what all those entries are for. Mind you, I haven't researched what either are for or how to use them as I'm still trying to figure out how to get Resynthesizer to work in a GIMP Appimage that is purported to support it, but doesn't.
No idea what a Goat-exercise is either.
Looking at post #4 didn't help, I don't know what any of that means either. Wink
Reply
#8
(02-29-2024, 01:44 AM)Danbor Wrote: I'll be honest here, I've looked at both python-fu and script-fu consoles, and hit the browse buttons. And having done so, I'm clueless as to what all those entries are for. Mind you, I haven't researched what either are for or how to use them as I'm still trying to figure out how to get Resynthesizer to work in a GIMP Appimage that is purported to support it, but doesn't.
  No idea what a Goat-exercise is either.
  Looking at post #4 didn't help, I don't know what any of that means either. Wink

I now want to know what a Goat-exercise  is too!

Isn't GNU using ... GNUs and not goats?  Big Grin Big Grin Big Grin Big Grin

https://en.wikipedia.org/wiki/GNU#/media..._white.svg
Reply
#9
A way from user to coder  Cool
Reply
#10
(02-29-2024, 02:10 AM)gimpygirl Wrote:
(02-29-2024, 01:44 AM)Danbor Wrote: I'll be honest here, I've looked at both python-fu and script-fu consoles, and hit the browse buttons. And having done so, I'm clueless as to what all those entries are for. Mind you, I haven't researched what either are for or how to use them as I'm still trying to figure out how to get Resynthesizer to work in a GIMP Appimage that is purported to support it, but doesn't.
  No idea what a Goat-exercise is either.
  Looking at post #4 didn't help, I don't know what any of that means either. Wink

I now want to know what a Goat-exercise  is too!

Isn't GNU using ... GNUs and not goats?  Big Grin Big Grin Big Grin Big Grin

https://en.wikipedia.org/wiki/GNU#/media..._white.svg

The story behind Goat-exercise:



Reply


Forum Jump: