open_file()

Opens a G-Code program from file.

Syntax

planetcnc.open_file(filename)

Parameters

Parameter Type Description
filename str A string specifying the name of the G-code file to be opened.

Return Value

Examples

#! /usr/bin/env python 
 
import planetcnc
 
# Attempt to open a file (for example, "square.nc") using the helper function.
if planetcnc.open_file("square.nc"):
    print("File opened successfully.")
else:
    print("Failed to open file.")

See also

open_file
open_code
start_file
start_code
test_file
test_code