In this code, I am getting a path that is present in the base path, and it fetches the path correctly but the problem is that I want to save the function in another variable called hi
but whenever I print it, it gives me the result None
import os
def contain(dirname, dPath):
dirfiles = os.listdir(dirname)
fullpaths = map(lambda name: os.path.join(dirname, name), dirfiles)
dirs = []
for file in fullpaths:
if os.path.isdir(file): dirs.append(file)
folder = list(dirs)
watching = [s for s in folder if dPath in s]
copy = str(watching)[2:-2]
print(copy)
def hello():
base = '/home/bilal/Videos/folder1'
destination = '/home/bilal/Videos/folder1/fd'
hi = contain(base, destination)
print(f"This is another time: {hi}")
hello()