Answers for "python get user directory"

7

how to get user location in python

import geocoder		# pip install geocoder
g = geocoder.ip('me')
print(g.latlng)
Posted by: Guest on March-08-2021
4

python get user home directory

from os.path import expanduser
home = expanduser("~")
Posted by: Guest on August-11-2020
1

python get user home directory

from pathlib import Path
home = str(Path.home())
Posted by: Guest on August-11-2020

Python Answers by Framework

Browse Popular Code Answers by Language