0

我正在执行一个简单的操作,将字体文件(ttf 扩展名)从下载的位置复制到字体文件夹,但它不起作用,

usrPath = os.environ['USERPROFILE']
src=downloadFont()
print("Downloaded Location:", src)
#dst=usrPath[0]+':\\Windows\\Fonts\\anmollipi.ttf' # this one doesnt
dst="C:\\Users\\Teacher\\Desktop"  # this one works
print("Install location",dst)
copyfont(src,dst)

我希望有人可以调查并帮助我!

4

2 回答 2

0

I don't know what's in the USERPROFILE environment variable since you haven't told us yet, but I doubt very much it should have a ":\" appended to it. That would only make sense for drive letters (e.g. just "C" or "D" without the colon), and USERPROFILE is supposed to be a path.

于 2012-09-18T15:22:11.570 回答
0

确保您对 Fonts 文件夹具有读写访问权限,有时即使您以具有管理员权限的系统上的用户身份登录,您也需要更改文件夹权限才能执行文件写入操作...

于 2012-09-19T13:18:34.523 回答