Can't assign operator error on code that used to compile

Discussion about writing code for Inkscape.
nminkscape
Posts: 5
Joined: Mon Jul 06, 2015 11:56 pm

Can't assign operator error on code that used to compile

Postby nminkscape » Fri Nov 11, 2016 4:18 am

A old script no longer compiles

Code: Select all

INKSCAPE="/C/Program Files/Inkscape/inkscape.exe"
OPTS=--export-background-opacity=0
SVG=My_Icon.svg
DEST=generated_icons
"$INKSCAPE" -w36 $OPTS --export-png=$DEST/android/ic_launcher-ldpi.png $SVG


I get this error on the OPTS line:
can't assign to operator:BinOp[left=BinOp[left=UnaryOp[op=USub, operand=UnaryOp[op=USub, operand=Name[id=export, ctx=Load, reserved=false]]], op=Sub, right=Name[id=background, ctx=Load, reserved=false]], op=Sub, right=Name[id=opacity, ctx=Load, reserved=false]]

Python 2.7

How do I fix this?

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: Can't assign operator error on code that used to compile

Postby v1nce » Fri Nov 11, 2016 5:42 am

OPTS="--export-background-opacity=0" ?
Maybe the equal sign ? (just a guess)

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Can't assign operator error on code that used to compile

Postby Moini » Fri Nov 11, 2016 7:57 am

This isn't a python script... - to me, it looks like bash code. The problem with that is that it's run on Windows... What is this?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Programming”