Skip to content

Instantly share code, notes, and snippets.

@ASRSim13
ASRSim13 / to_marlin_gcode.py
Created January 23, 2023 22:33 — forked from pablinhob/to_marlin_gcode.py
Convert standard CNC Gcode to Marlin 3D printer firmware legible format
#!/usr/bin/python
import re
import os
import sys
try:
sys.argv[1]
sys.argv[2]
except IndexError:
print "usage: ./to_marlin_gcode origin.nc origin_marlin.gcode"
x1=int(input())
y1=int(input())
x2=int(input())
y2=int(input())
if (x2==x1+1 or x2==x1-1 or x2==x1)and(y2==y1+1 or y2==y1-1 or y2==y1):
print('YES')
else:
print('NO')