I would like to cut my code into chunk so I don't have to run everything at once. Can someone point me in the direction as to why this works:
from skimage import io
import numpy as np
filename = input("Enter file name\n")
img = io.imread(f"images/{filename}.tif", as_gray=True)
img = np.array(img).astype(np.float32)
but this doesn't work?
from skimage import io
import numpy as np
def loadfile():
filename = input("Enter file name\n")
img = io.imread(f"images/{filename}.tif", as_gray=True)
img = np.array(img).astype(np.float32)