It is currently Thu Jul 04, 2024 1:32 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: HEELPPP. Python script breaking
PostPosted: Fri Apr 28, 2017 4:40 pm  (#1) 
Offline
New Member

Joined: Apr 28, 2017
Posts: 3
Okay, so I'm trying to add a new black layer as a background, but for some reason this line breaks my script:

bg = pdb.gimp_layer_new(img, img.width, img.height, 3, “BG”, 100, 0)

What am I doing wrong??


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: HEELPPP. Python script breaking
PostPosted: Fri Apr 28, 2017 5:13 pm  (#2) 
Offline
New Member

Joined: Apr 28, 2017
Posts: 3
Hmm even when I comment the line out with #, gimp still doesn't even recognize the plugin. But if I completely delete the line, everything works fine.


Top
 Post subject: Re: HEELPPP. Python script breaking
PostPosted: Fri Apr 28, 2017 7:33 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
I dont think you need the double quotes around BG.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: HEELPPP. Python script breaking
PostPosted: Sat Apr 29, 2017 1:49 am  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
Rod wrote:
I dont think you need the double quotes around BG.

Quotes are necessary, this is a string literal (unless there is a BG variable somewhere).

But the quotes as pasted above are wrong, these are not straight double-quotes ("") but opening/closing double quotes (“”).

Do not use a word processor to write code because it tries to be clever when it shouldn't, use a real programmer's editor (Notepadd++ or else) (which will also do real-time syntax highlighting, help with indentation, etc...

_________________
Image


Top
 Post subject: Re: HEELPPP. Python script breaking
PostPosted: Sat Apr 29, 2017 12:48 pm  (#5) 
Offline
New Member

Joined: Apr 28, 2017
Posts: 3
OMG! I had no idea there were different kinds of double quotes. Thank you!!!


Top
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) My first Python Script for Gimp

7

No new posts .py script not showing under Python-Fu

3

No new posts Attachment(s) Learning to do first Python script

6

No new posts Does anyone have script fu and python plugins that work on 2.99.19?

1

No new posts Can a python script use gimpfu, run from terminal, and create new img?

2



* Login  



Powered by phpBB3 © phpBB Group