<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Use Python to Log into AGOL in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124072#M9656</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/180774"&gt;Amber&amp;nbsp;&lt;/A&gt;- Python 2.x is old and in the way.&amp;nbsp; Yes there are some notable differences, and yes some of your scripting will need to be edited. If you have millions of lines of code, the transformation will be painful.&amp;nbsp; Even the versions of Python 3.x that ship with ArcGIS Pro are not current (see&amp;nbsp;&lt;A href="https://community.esri.com/thread/257737"&gt;Timeline for python upgrade?&lt;/A&gt;&amp;nbsp;).&amp;nbsp; So what to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Personally, I only use the IDLE (&lt;A href="https://docs.python.org/3/library/idle.html"&gt;Integrated Development and Learning Environment&lt;/A&gt;&lt;SPAN style="color: #222222; background-color: #ffffff;"&gt;) for quick and dirty python scripts, and that's very rare. I prefer a more robust IDE for&amp;nbsp;the heavy lifting and just general script creation.&amp;nbsp;&amp;nbsp;Since you have ArcGIS Pro installed,&amp;nbsp;the default environment will have python 3.x installed.&amp;nbsp; It sounds like you have ArcMap installed as well so in your C drive you have an install directory called Python 2.'something'. (I don't have ArcMap installed anymore).&amp;nbsp; Try this: right click on an existing python script and&amp;nbsp;see if you get the choice to&amp;nbsp;&lt;STRONG&gt;EDIT with IDLE(ArcGISPro).&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;If so, you'll be in the Python 3.x environment and you&amp;nbsp;should be good to go....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff;"&gt;edited to add:&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/arcgis/announcements/how-sunsetting-python-2-affects-arcgis/" title="https://www.esri.com/arcgis-blog/products/arcgis/announcements/how-sunsetting-python-2-affects-arcgis/"&gt;How sunsetting Python 2 affects ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Aug 2020 20:42:44 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2020-08-25T20:42:44Z</dc:date>
    <item>
      <title>How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124066#M9650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have an AGOL&amp;nbsp;Organization account. Every day I run python code in the IDLE (2.7.16) window that automates stuff in ArcMap and uploads it to AGOL. The only problem is that I have to manually go into ArcMap to sign into AGOL. Is there code I can add to my script that will log me in? I've looked into the ArcGIS API for Python and its all a little over my head. I can't get the GIS module to import into&amp;nbsp;&lt;SPAN&gt;IDLE (2.7.16).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2020 17:58:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124066#M9650</guid>
      <dc:creator>AmberTobin</dc:creator>
      <dc:date>2020-08-25T17:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124067#M9651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See&amp;nbsp;&lt;A href="https://community.esri.com/thread/258927"&gt;PYTHON - No Module named gis&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2020 18:05:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124067#M9651</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-08-25T18:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124068#M9652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you wish to use IDLE (2.7.16), there is an old script here: &lt;A _jive_internal="true" href="https://community.esri.com/thread/179027"&gt;how to get token to access a map service or feature service?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2020 19:28:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124068#M9652</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2020-08-25T19:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124069#M9653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Randy, the link just brings me back to my post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2020 19:30:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124069#M9653</guid>
      <dc:creator>AmberTobin</dc:creator>
      <dc:date>2020-08-25T19:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124070#M9654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the link, I was afraid the gis module doesn't work with Python 2.x but it does with Python 3. I have Pro installed, ESRI doesn't recommend downloading python versions that do not come pre-installed with the ArcGIS software. Any idea where I would find version 3 IDLE on my computer and not be Jupyter? Also, from what I read the coding is slightly different for Python 3. I have a lot of code that I don't plan on rewriting .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2020 19:32:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124070#M9654</guid>
      <dc:creator>AmberTobin</dc:creator>
      <dc:date>2020-08-25T19:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124071#M9655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amber,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've recently been on the same path and have developed / scrounged / assembled some functionality for adding data to an ArcGIS Online Group I own.&amp;nbsp; I will provide some Python scripts, BUT you need Python 3 to use the the Python ArcGIS API.&amp;nbsp; So the code to get you going is minimal, but getting a Python 3 environment may be where the heavy mental lifting and possible exacerbation comes in.&amp;nbsp; However, I am no computer genius, I simply installed Arc Pro which will install Python 3.&amp;nbsp; I run my scripts through the command line in Conda environments.&amp;nbsp; If you are not familiar with the Command Line, I can respond with some instructions on getting started there.&amp;nbsp; Here&amp;nbsp;is some code you can save in a script and run(&amp;lt;script_name&amp;gt;.py&amp;nbsp; i.e.&amp;nbsp; add_to_agol.py) or run from Arc Pro Python console (that exists right?).&amp;nbsp; Line 5 is where you access your AGOL account, line 37 adds your zipped shapefiles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; ArcGIS&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os

&lt;SPAN class="comment token"&gt;# username and password are your ArcGIS Online login credentials&lt;/SPAN&gt;
your_gis_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;username &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'your_username'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; password &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'your_password'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Connected to {} as {}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;your_gis_name&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;properties&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;portalHostname&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
                                    your_gis_name&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;users&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;me&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;username&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# the outDir variable is a path to a folder.  The folder will contain one or&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# more folders with zipped shapefiles (i.e. &amp;lt;filename&amp;gt;.shp, &amp;lt;filename&amp;gt;.prj, etc.)&lt;/SPAN&gt;
outDir &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'path/to/parent/folder/with/zipped/dirs&lt;S&gt;'&lt;/S&gt;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# this will create a list of paths to each zipped feature folder&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# if zipped subdirs appear in folder as: agriculture.zip, forests.zip, commercial.zip&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# scandir orders file paths ALPHABETICALLY! So...&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# zipped_dirs = [path/to/agriculture.zip, path/to/commercial.zip and path/to/forests.zip]&lt;/SPAN&gt;
zipped_dirs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;subD&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; subD &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;scandir&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outDir&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Make tags, title, snippet&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# since zipped_dirs will order alphabetically the title, tags and snippets&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# need to be ordered to match zipped dirs as if they were arranged alphabetically&lt;/SPAN&gt;
title &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'agricultural lands'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'commercial_property'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'forests'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# tags can be a list of lists if multiple tags per item or a simple list&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# with strings if just one tag per item&lt;/SPAN&gt;
tags &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'land_project'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'agricultural'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'land_project'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'commercial'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        &lt;SPAN class="string token"&gt;'land_project'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'forests'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# snippets&lt;/SPAN&gt;
snippet &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'some agricultural lands in Kentucky'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'proposed development sites'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
            &lt;SPAN class="string token"&gt;'where forests are classified'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# add items to your ArcGIS Online Content&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; idx&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; shp &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; enumerate&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;zipped_dirs&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    properties_dict &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'title'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;title&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;idx&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                        &lt;SPAN class="string token"&gt;'tags'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;tags&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;idx&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                        &lt;SPAN class="string token"&gt;'snippet'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;snippet&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;idx&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
    fc_item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; your_gis_name&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;add&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;properties_dict&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; shp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a link for setting up Python 3 through the Command Line&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/docs/DOC-12021" target="_blank"&gt;Python and ArcGIS Pro 2.2&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That blog also mentions that many people just use Arc Pro, similar to the Python Console in ArcMap I imagine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan Patterson has dozens of useful blogs on setting up Python, Pro, Conda, etc.&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3116" target="_blank"&gt;Dan Patterson&lt;/A&gt;&amp;nbsp;.&amp;nbsp; Here is one that has multiple links to traverse&amp;nbsp;&lt;A href="https://community.esri.com/blogs/dan_patterson/2018/07/01/arcgis-pro-your-conda-environments" target="_blank"&gt;/blogs/dan_patterson/2018/07/01/arcgis-pro-your-conda-environments&lt;/A&gt;&amp;nbsp;.&amp;nbsp; * Note he recently set up a new username if you need future content *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is the ArcGIS Python API&amp;nbsp;tutorials from which I gleaned those two lines of code using the GIS module&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/using-the-gis/" title="https://developers.arcgis.com/python/guide/using-the-gis/" rel="nofollow noopener noreferrer" target="_blank"&gt;Using the GIS | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&amp;nbsp; Let me know what you find out and where you get hung up...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zach&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:06:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124071#M9655</guid>
      <dc:creator>ZacharyUhlmann</dc:creator>
      <dc:date>2021-12-11T07:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124072#M9656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/180774"&gt;Amber&amp;nbsp;&lt;/A&gt;- Python 2.x is old and in the way.&amp;nbsp; Yes there are some notable differences, and yes some of your scripting will need to be edited. If you have millions of lines of code, the transformation will be painful.&amp;nbsp; Even the versions of Python 3.x that ship with ArcGIS Pro are not current (see&amp;nbsp;&lt;A href="https://community.esri.com/thread/257737"&gt;Timeline for python upgrade?&lt;/A&gt;&amp;nbsp;).&amp;nbsp; So what to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Personally, I only use the IDLE (&lt;A href="https://docs.python.org/3/library/idle.html"&gt;Integrated Development and Learning Environment&lt;/A&gt;&lt;SPAN style="color: #222222; background-color: #ffffff;"&gt;) for quick and dirty python scripts, and that's very rare. I prefer a more robust IDE for&amp;nbsp;the heavy lifting and just general script creation.&amp;nbsp;&amp;nbsp;Since you have ArcGIS Pro installed,&amp;nbsp;the default environment will have python 3.x installed.&amp;nbsp; It sounds like you have ArcMap installed as well so in your C drive you have an install directory called Python 2.'something'. (I don't have ArcMap installed anymore).&amp;nbsp; Try this: right click on an existing python script and&amp;nbsp;see if you get the choice to&amp;nbsp;&lt;STRONG&gt;EDIT with IDLE(ArcGISPro).&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;If so, you'll be in the Python 3.x environment and you&amp;nbsp;should be good to go....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff;"&gt;edited to add:&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/arcgis/announcements/how-sunsetting-python-2-affects-arcgis/" title="https://www.esri.com/arcgis-blog/products/arcgis/announcements/how-sunsetting-python-2-affects-arcgis/"&gt;How sunsetting Python 2 affects ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2020 20:42:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124072#M9656</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-08-25T20:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124073#M9657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I corrected the link.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2020 21:32:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124073#M9657</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2020-08-25T21:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124074#M9658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joe! To be honest with you, my code was made sort of quick and dirty. I used model builder as a base (exported to python) and then modified and added more code in python using the arcpy modules as necessary. I wrote the code a few years ago. I do have a lot code and 4 scripts to run. Most recently I created a script that runs all 4 of my scripts instead of having to run each of them individually.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My main goal is to have the script run when I'm not in the office. Instead of trying to combine the log-in process with my outdated IDLE 2.7 code I could write a second one in a more current platform. I was thinking of setting up a windows scheduler, I would just set-up 2: one to log-in to AGOL and one to run my code that updates the feature service.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've used ArcMap for so long that I've been too stubborn to switch over to Pro, GIS is a small part of my job function so I need to&amp;nbsp;be proficient in other non-GIS software as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In terms of deprecation, from how I comprehend it, the ArcGIS python libraries were downloaded when I downloaded ArcMap. Even if ESRI no longer supports certain libraries, they exist on my C drive so they should run forever as long as I don't delete them and work with an ArcMap version that supports it (for the code that does the ArcMap stuff).&amp;nbsp; I could be totally wrong here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ah ha! I don't know why I've never noticed this but I do see the option to&amp;nbsp;&lt;STRONG style="color: #222222; border: 0px; font-weight: bold;"&gt;EDIT with IDLE(ArcGISPro)! &lt;/STRONG&gt;I'll have to try that out!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2020 13:18:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124074#M9658</guid>
      <dc:creator>AmberTobin</dc:creator>
      <dc:date>2020-08-26T13:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124075#M9659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Zach! My main goal is to have the code run when I'm scheduled off from work. I'm thinking I can have another code that just logs into AGOL. I've looked at the API library before I created this post. It seemed so daunting! I tried to run the gis modules in python 2.7 and then realized that won't work after seeing other posts. As Joe mentioned, I do have python version 3.0 so I can run i can test to see if the gis modules work there. Thanks and good luck in your GIS endeavors!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2020 13:26:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124075#M9659</guid>
      <dc:creator>AmberTobin</dc:creator>
      <dc:date>2020-08-26T13:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124076#M9660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course and...whoops!&amp;nbsp; I got a little carried away and projected my own issues into your question.&amp;nbsp; Basically I answered a completely different question.&amp;nbsp; But those two lines from the Arcgis Python API can be used to log you in programmatically.&amp;nbsp; Sounds like an interesting endeavor scheduling your code to run independently.&amp;nbsp; I know the Airflow software (&lt;A class="link-titled" href="https://airflow.apache.org/docs/stable/scheduler.html" title="https://airflow.apache.org/docs/stable/scheduler.html"&gt;Scheduler — Airflow Documentation&lt;/A&gt;&amp;nbsp;) is popular for scheduling - it's Python and Open Source.&amp;nbsp; No idea its compatibility with Arc stuff.&amp;nbsp; But honestly the ArcGIS API is not that hard - don't be intimidated!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2020 19:03:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124076#M9660</guid>
      <dc:creator>ZacharyUhlmann</dc:creator>
      <dc:date>2020-08-26T19:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Python to Log into AGOL</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124077#M9661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lol, No worries! I found this the other day and thought this should help me in my automation process:&amp;nbsp;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/arcgis-pro/analytics/schedule-a-python-script-or-model-to-run-at-a-prescribed-time-2019-update/" title="https://www.esri.com/arcgis-blog/products/arcgis-pro/analytics/schedule-a-python-script-or-model-to-run-at-a-prescribed-time-2019-update/"&gt;Schedule a Python script or model to run at a prescribed time: 2019 update&lt;/A&gt;.&amp;nbsp;Windows has a task scheduler built-in, I have it set to run tomorrow morning so we'll see what happens. Our ITS department isn't too keen on us downloading random software so I try to work with what I have first.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2020 19:26:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-python-to-log-into-agol/m-p/124077#M9661</guid>
      <dc:creator>AmberTobin</dc:creator>
      <dc:date>2020-08-26T19:26:40Z</dc:date>
    </item>
  </channel>
</rss>

