質問

I am performing a simple operation to copy font file(ttf extension) from a downloaded location to fonts folder, but its not working,

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)

I hope some one can look into and help me out !!!

役に立ちましたか?

解決

make sure you have read write access to Fonts folder, sometimes even if you are logged in as user on a system with Admin rights you need to change the folder permission to perform the file write operation...

他のヒント

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top