<?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 do you reload a module imported into a Python Toolbox? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560643#M43875</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, by deleting the &lt;/SPAN&gt;&lt;STRONG&gt;pyc&lt;/STRONG&gt;&lt;SPAN&gt; file my tweaks to the source code appeared. BUT! Subsequent tweaks to the source code would not be applied. So I went back into file manager, but there was no&lt;/SPAN&gt;&lt;STRONG&gt; pyc&lt;/STRONG&gt;&lt;SPAN&gt; file to delete! Only when I closed down ArcMap and opened it again would the &lt;/SPAN&gt;&lt;STRONG&gt;pyc&lt;/STRONG&gt;&lt;SPAN&gt; file appear (which would have my latest changes to it).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Surely this is not the development workflow that ESRI intended? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Whilst Caleb's solution is an appreciated clunky work around I still would like to know how one reloads a module as indicated in the desktop help? Could someone show how to reload the module that is importing in the format of "from peaktool import Peak"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jan 2014 14:14:37 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2014-01-23T14:14:37Z</dc:date>
    <item>
      <title>How do you reload a module imported into a Python Toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560641#M43873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Python Gurus,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have downloaded the &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://blogs.esri.com/esri/arcgis/2013/11/26/new-spatial-analyst-supplemental-tools-v1-3/" rel="nofollow noopener noreferrer" target="_blank"&gt;Spatial Analyst Supplemental Tools&lt;/A&gt;&lt;SPAN&gt; which is a Python Toolbox and there appears to be a bug in the Peak tool. I know a little bit of Python and thought I would have a crack at debugging it, primarily to teach myself how to use a Python toolbox. I am use to creating python script tools but not a Python toolbox.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Anyway every time I tweak the code in the Peak tool and try to run it, it's as if the tool has been cached and none of my tweaks run. I looked at help and found this &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Editing_a_Python_toolbox/001500000038000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;page&lt;/A&gt;&lt;SPAN&gt; and in the &lt;/SPAN&gt;&lt;STRONG&gt;tip section&lt;/STRONG&gt;&lt;SPAN&gt; it talks about imported modules needing reloading. I think this is my problem none of my changes are being refreshed. But the import statement is "from peaktool import Peak". If I type reload(peaktool) it says &lt;/SPAN&gt;&lt;SPAN style="font-size: 2;"&gt;"name 'peaktool' is not defined"&lt;/SPAN&gt;&lt;SPAN&gt;. So the help page gives advice but does not explicity show you how to do it!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So my question is how do you reload a module when the importing of it is in the format of "from peaktool import Peak" and where would one put the reload statement in the code? Below is the Python toolbox code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; sys
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
myScripts &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dirname&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;__file__&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Scripts"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
sys&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myScripts&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; dendrogrampdf &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; CreateDendrogram 
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; viewshedalongpath &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; ViewshedAlongPath 
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; maxelevation &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; MaximumUpstreamElevation 
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; drawsig &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; DrawSignatures 
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; filledcontours &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; FilledContours 
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; peaktool &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; Peak 
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; eraserastervalues &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; EraseRasterValues 
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; zonalstatisticsastable02 &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; ZonalStatisticsAsTable02 
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; tabulatearea02 &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; TabulateArea02 
&lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Toolbox&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;object&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;__init__&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"""Define the toolbox (the name of the toolbox is the name of the .pyt file)."""&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;label &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Spatial Analyst Supplemental Tools"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;alias &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"sas"&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# List of tool classes associated with this toolbox&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;tools &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;CreateDendrogram&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; DrawSignatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ViewshedAlongPath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;MaximumUpstreamElevation&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; FilledContours&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Peak&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; EraseRasterValues&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;ZonalStatisticsAsTable02&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;TabulateArea02&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;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;DIV style="display: none;"&gt; &lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Peak is a Class in the peaktools module.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:11:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560641#M43873</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-12T00:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reload a module imported into a Python Toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560642#M43874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Whenever you import a module or particular functions/classes into another module, it gets compiled into byte code and is stored as a .pyc file.&amp;nbsp; This compiled Python file is *supposed* to be updated every time you make a change to the original .py source code file.&amp;nbsp; This is the file that is actually being used when you import into another script.&amp;nbsp; I could be wrong here, but I believe behind the scenes Python is checking the time stamp of the original .py file and the .pyc, and if the .py modification date is newer than the .pyc, it is supposed to recompile a new .pyc file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, in the past, I have had a few (inconsistent) issues with the .pyc not being updated right away.&amp;nbsp; If it truly is not reading the changes you made to peaktool.py, you can always delete the &lt;/SPAN&gt;&lt;STRONG&gt;peaktool.pyc&lt;/STRONG&gt;&lt;SPAN&gt; file and this will force it to recompile next time you run the tool and import the script.&amp;nbsp; This python icon will have a charcoal background as opposed to the white background of a normal .py file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 12:23:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560642#M43874</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-01-23T12:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reload a module imported into a Python Toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560643#M43875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, by deleting the &lt;/SPAN&gt;&lt;STRONG&gt;pyc&lt;/STRONG&gt;&lt;SPAN&gt; file my tweaks to the source code appeared. BUT! Subsequent tweaks to the source code would not be applied. So I went back into file manager, but there was no&lt;/SPAN&gt;&lt;STRONG&gt; pyc&lt;/STRONG&gt;&lt;SPAN&gt; file to delete! Only when I closed down ArcMap and opened it again would the &lt;/SPAN&gt;&lt;STRONG&gt;pyc&lt;/STRONG&gt;&lt;SPAN&gt; file appear (which would have my latest changes to it).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Surely this is not the development workflow that ESRI intended? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Whilst Caleb's solution is an appreciated clunky work around I still would like to know how one reloads a module as indicated in the desktop help? Could someone show how to reload the module that is importing in the format of "from peaktool import Peak"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 14:14:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560643#M43875</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2014-01-23T14:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reload a module imported into a Python Toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560644#M43876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That is truly some strange behavior and I have never seen anything like that. However, it does not matter how you are importing whether you are using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import peaktool&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OR &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;from peaktool import Peak&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Either way, this should recompile the &lt;/SPAN&gt;&lt;STRONG&gt;full&lt;/STRONG&gt;&lt;SPAN&gt; peaktool.py into peaktool.pyc. This is so because you are still importing from this module, except in the second example you are explicitly calling the Peak class.The only thing I can think of is if there were multiple copies of this script on you machine/server? If this is the case Python may be confused about which one to use and I am not sure what gets precedence (PYTHONPATH or PYTHONHOME). Also, whenever you make tweaks to the peaktool source code, the module will not recompile if you have it open.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To verify it is importing from the proper location you can try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import peaktool print peaktool.__file__&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or when you use the reload() function, it will tell you where the module is being called from. Also, it may help to reload before explicitly importing Peak:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import peaktool reload(peaktool)&amp;nbsp; # *should* recompile pyc file from peaktool import Peak&amp;nbsp; #should now be updated&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;I am out of ideas...Hopefully this works for you though. This [url=&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.tutorialspoint.com/python/python_modules.htm]page[/url" rel="nofollow" target="_blank"&gt;http://www.tutorialspoint.com/python/python_modules.htm]page[/url&lt;/A&gt;&lt;SPAN&gt;] may have some helpful information.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 15:06:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560644#M43876</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-01-23T15:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reload a module imported into a Python Toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560645#M43877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Duncan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've had similar troubles, especially when a toolbox references another script that I've written. It seems that if I...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;import SomeStuffIWrote&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;... then changes to SomeStuffIWrote are a monumental pain to make the toolbox take. Two things I usually do every time I edit:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Right click on the toolbox in ArcCatalog and select refresh (works 99% of the time for me).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Right click on the toolbox, select edit, then close the notepad etc window that pops up. This causes it to completely refresh the tool (works in 99% of the remaining cases where # 1 doesn't work).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only case where I have had trouble is a situation where the toolbox and all of the source files sit on a network location with multiple people accessing it. For some reason no matter what I have done (delete, have everyone refresh, etc etc), for some people, their machines aren't seeing the updates.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Doug&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 15:12:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560645#M43877</guid>
      <dc:creator>DouglasSands</dc:creator>
      <dc:date>2014-01-23T15:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reload a module imported into a Python Toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560646#M43878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb &amp;amp; Doug,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I inserted the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import peaktool
reload(peaktool)
from peaktool import Peak
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Deleted the &lt;/SPAN&gt;&lt;STRONG&gt;pyc&lt;/STRONG&gt;&lt;SPAN&gt; file and refreshed the way Doug suggested and this finally allows me to edit the source code and see the changes when I next run the tool. It feels like this should be much easier if ESRI want us to python toolboxes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The good news I have been able to debug the tool too! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:11:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560646#M43878</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-12T00:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reload a module imported into a Python Toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560647#M43879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Duncan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still find this to be a pain... But what I really want to add is: If you have your .pyt import a .py and you are then editing the .py then you need to reload recursively. How to do that is described here: &lt;A href="http://gis.stackexchange.com/questions/91112/is-there-a-way-to-refresh-imported-modules-in-a-arcgis-python-toolbox/91153#91153" title="http://gis.stackexchange.com/questions/91112/is-there-a-way-to-refresh-imported-modules-in-a-arcgis-python-toolbox/91153#91153"&gt;Is there a way to refresh imported modules in a ArcGIS Python Toolbox? - Geographic Information Systems Stack Exchange&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 13:03:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-you-reload-a-module-imported-into-a-python/m-p/560647#M43879</guid>
      <dc:creator>MartinHvidberg</dc:creator>
      <dc:date>2014-10-23T13:03:30Z</dc:date>
    </item>
  </channel>
</rss>

