我想复制通过python脚本生成的文件夹中的特定文件
import numpy as np
import sys
import os
import math
import shutil
import glob
for i in range(2,n):
for j in range(2,n):
dirname="be"+str(i)+"-"+str(j)+"-"+str(i*j)
#print(pth+"/"+dirname)
os.mkdir(pth+"/"+dirname)
os.chdir(pth+"/"+dirname)
# Copy files to dirname
f = ['tree', 'leaf', 'forest']
path = '/onyx/..../'
folders = [g for g in glob.glob(path + "**/")]
for g in folders:
print(g)
for i in f:
shutil.copy(os.path.join('/onyx/.../', i), '/onyx/.../g')
我希望将列表f的项目复制到生成的文件夹dirname中,但是生成的文件夹中没有列表f的字符串