simetri.helpers.hello
1import tempfile 2import os 3 4import simetri.graphics as sg 5 6def hello(): 7 """Hello world function.""" 8 # Open the default web browser to the Simetri website 9 10 canvas = sg.Canvas() 11 12 canvas.text("Helow from simetri.graphics", (0, 0), font_size=20) 13 14 15 with tempfile.TemporaryDirectory( 16 ignore_cleanup_errors=True, delete=True 17 ) as tmpdirname: 18 file_name = next(tempfile._get_candidate_names()) 19 file_path = os.path.join(tmpdirname, file_name + ".png") 20 print(file_path) 21 canvas.save(file_path, show=True, print_output=False)
def
hello():
7def hello(): 8 """Hello world function.""" 9 # Open the default web browser to the Simetri website 10 11 canvas = sg.Canvas() 12 13 canvas.text("Helow from simetri.graphics", (0, 0), font_size=20) 14 15 16 with tempfile.TemporaryDirectory( 17 ignore_cleanup_errors=True, delete=True 18 ) as tmpdirname: 19 file_name = next(tempfile._get_candidate_names()) 20 file_path = os.path.join(tmpdirname, file_name + ".png") 21 print(file_path) 22 canvas.save(file_path, show=True, print_output=False)
Hello world function.