Hello,
I am trying to get users Windows login but unable to figure out how.
I created a Python using Jupyter Notebook and "copy and pasted" my python code to AGOL's notebook.
Originally, I used this code:
"import getpass
winuser = getpass.getuser()
print(winuser)"
In AGOL, this will return AGOL user name.
When I try:
"import os
name = os.environ.get('USERNAME')
print(name)"
It returns "None"
Thanks in advance.
try os.getlogin()
I tried it and got:
[Errno 6] No such device or addres
I assume it is because it goes through a website it can't pull the information out.
I will have to try something else that doesn't use windows username.
Thank you!