Вопрос

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