Creating files from code
Is there a way to create a file from code? I've tried using a python script:
then:
but I have been getting this error:
then:
but I have been getting this error:
from python import *
fn create_proj(folder: String) raises:
Python.add_to_path(".")
var file = Python.import_module("createproj")
file.create_proj(folder)def create_proj(path: str):
with open(path + "/main.mojo", "x") as f:
f.write("text goes here")Unhandled exception caught during execution: module 'createproj' has no attribute 'create_proj'
/home/[USERNAME]/pyregl/.magic/envs/default/bin/mojo: error: execution exited with a non-zero result: 1