In an ArcGIS Pro Python environment, you can directly access the currently connected ArcGIS Online or ArcGIS Enterprise instance. For this, you simply use the keyword 'home'. The ArcGIS API for Python uses arcpy in an ArcGIS Pro Python environment. However, if you use a Python environment without arcpy, you will be rewarded with a stack trace.<\/P>
from arcgis.gis import GIS
# Uses the current login of the ArcGIS Pro environment
# e.g. ArcGIS Pro authorized ArcGIS identity, needs arcpy
gis = GIS('home')
gis.users.me<\/code><\/pre> <\/P>In a Jupyter notebook, my profile appears, and what about yours?<\/P>