arpruss / gcodeplot

Use a 3-axis machine as a pen plotter
Other
167 stars 60 forks source link

SyntaxWarning: "is not" with a literal. Did you mean "!="? #25

Closed LazerPlatypus closed 3 years ago

LazerPlatypus commented 3 years ago

The issue is found in parser.py and gcodeplot.py. using the find & replace tool to replace all occurrences of "is not" with "!=" seems to have resolved the problem, but I have not been able to thoroughly test that this is a good solution and that it does not introduce any more bugs. attached are my modified parser.py and gcodeplot.py files. gcodeplot_fix.zip

arpruss commented 3 years ago

I'm usually pretty careful with these things and think about the difference, so if it's in my code, I wouldn't change it.

LazerPlatypus commented 3 years ago

The only reason that I changed it, is because otherwise, the script won't run (it throws that error, and doesn't produce gcode). I would definitely go through and deliberately change what needs to be changed if it was my program, but I'm not familiar with the program, and rarely code in python; thus it got the replace-all treatment.

arpruss commented 3 years ago

But that's a warning, not an error.

LazerPlatypus commented 3 years ago

I just undid my changes and reran the program. this is the warning screen that pops up: image the next bit is a little sporadic: clicking 'OK' or 'x'-ing out of the window results in this error screen: image and doesn't produce any gcode. sometimes, if you try saving it twice, it does work though, still displaying the warning screen, but the error screen doesn't pop up, and gcode is produced. I don't fully understand it.

arpruss commented 3 years ago

Ah, I think that's not my code. :-) Try changing just that one is not to !=

LazerPlatypus commented 3 years ago

doing that, you get the same warning, but this time in gcodeplot.py on line 456

arpruss commented 3 years ago

Can you post your svg file?

LazerPlatypus commented 3 years ago

drawing-2.zip