Some toy scripts demonstrating ESRI Python techniques such as uploading shapefiles.
Note there are two Python libraries for ESRI.
arcgis is a python library that interacts with the ESRI web services. This is how you publish to ArcGIS Online. It does not require ArcGIS Pro to be installed on your computer.
arcpy is for interacting with ArcGIS Pro. This can be used for geospatial analysis, either inside the program or from the command line.