Answer the question
In order to leave comments, you need to log in
How to path in Python 3.8.2 to C:\Users\"USERNAME"\Documents?
I have this code:
import urllib.request
print('ShelbyFM: radio station installation...')
url = 'http://d.zaix.ru/iTUp.mp3'
urllib.request.urlretrieve(url, 'C:\\Users\\USERNAME\\Documents\\Rockstar Games\\GTA V\\User Music\\gta.mp3')
Answer the question
In order to leave comments, you need to log in
import os
os.path.expanduser('~/my/path/from/home')
from pathlib import Path
p = Path('~/my/folder').expanduser() # PosixPath('/home/svp/my/folder')
from pathlib import Path
p = Path('~/Documents/Rockstar Games/GTA V/User Music/gta.mp3').expanduser()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question