GregValiant 1,342
As Slashee shows, you are getting a "prefix" on every line but you stated you wanted to add your "log_FILE" between each line.
The list "new_data" has as many items ("layers") as there are lines in the gcode. Essentially each line is a separate layer. That may be causing heartburn in Cura when it gets the "data" back.
Any post-processor that was to run after that one would be likely generate an error as it isn't getting "data" in a form that it expects. The Cura preview may not work at all, or it will show just a single layer with the entire print on it.
if the results you want are more like this...
;TYPE:SKIRT
Log_FILE
G1 F600 Z0.2
Log_FILE
G1 F2100 E0
Log_FILE
G1 F3000 X94.203 Y93.495 E0.0233
Then you will probably want a "+=" rather than an "append".
Recommended Posts
Slashee_the_Cow 410
Runs fine for me ("fine" in that it runs without errors, not that it produces a result worth having). What version of Cura are you using? 5.8 here, but older versions include older Python interpreters which can be more or less forgiving about certain things. And cura.log should include a line saying on what line of the script file the error occurred.
If I had to take a stab in the dark and guess where it might be throwing an error, it would be:
Trying to add a literal to a variable. But as I said, runs fine for me. Although regardless, I'd change it to
because f-strings are so much fun. And it's fun to be able to say "f-string" and it has legitimately nothing to do with swear words.
Although your output isn't much good, at least not yet:
BTW:
The dunder method for class initialisation is:
Difference might be a little hard to see... two underscores around the init (or any other dunder methods you want to implement).
Link to post
Share on other sites