gcode_load()

Loads G-code lines from a file into the program’s G-code line list.

Syntax

planetcnc.gcode_load(filename)

Parameters

Parameter Type Description
filename str A string representing the filename (or file path) from which to load the G-code lines.

Return Value

Examples

#! /usr/bin/env python 
 
import planetcnc
 
# Load G-code lines from a file named "commands.gcode".
if planetcnc.gcode_load("commands.gcode"):
    print("G-code lines loaded successfully.")
else:
    print("Failed to load G-code lines.")

See also

gcode_is_ready
gcode_is_opening
gcode_is_running
gcode_close
gcode_open
gcode_load
gcode_line_add_allowed
gcode_line_add