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
True if one or more G-code lines were successfully loaded from the file.
False if no lines were loaded (e.g., if the file doesn't exist, the system is not initialized, or the controller is currently running).
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