<?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: Python Code changes not reflecting in Maya in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/python-code-changes-not-reflecting-in-maya/m-p/10952749#M2893</link>
    <description>&lt;P&gt;Thank you for your help! That makes more sense now. It worked! I also had to include the module that reload is in for Python3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import importlib
importlib.reload(&lt;EM&gt;module&lt;/EM&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Feb 2022 23:15:02 GMT</pubDate>
    <dc:creator>imapepsi</dc:creator>
    <dc:date>2022-02-15T23:15:02Z</dc:date>
    <item>
      <title>Python Code changes not reflecting in Maya</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/python-code-changes-not-reflecting-in-maya/m-p/10952007#M2891</link>
      <description>&lt;P&gt;I'm using PyCharm2021 and Maya2022 to write code that builds a model for me.&amp;nbsp;My code is split up into modules with a single directory and one main.py that runs the whole program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But in order for Maya to reflect my changes in any of the code files I have to close and restart Maya. Is there a way to avoid restarting Maya?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've heard there's a function called reload in Python, but I wasn't sure how to use it.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 16:49:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/python-code-changes-not-reflecting-in-maya/m-p/10952007#M2891</guid>
      <dc:creator>imapepsi</dc:creator>
      <dc:date>2022-02-15T16:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Python Code changes not reflecting in Maya</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/python-code-changes-not-reflecting-in-maya/m-p/10952086#M2892</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you import a .py file into maya it creates an interpreted .pyc file which it can faster read. In order to overwrite the pyc file you need to use the reload function.&lt;/P&gt;&lt;P&gt;The syntax is rather easy:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import main as main
reload(main)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Btw, if you ever want to publish your script, I would recommend to give your main module a more unique name. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 17:18:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/python-code-changes-not-reflecting-in-maya/m-p/10952086#M2892</guid>
      <dc:creator>Kahylan</dc:creator>
      <dc:date>2022-02-15T17:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Python Code changes not reflecting in Maya</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/python-code-changes-not-reflecting-in-maya/m-p/10952749#M2893</link>
      <description>&lt;P&gt;Thank you for your help! That makes more sense now. It worked! I also had to include the module that reload is in for Python3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import importlib
importlib.reload(&lt;EM&gt;module&lt;/EM&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 23:15:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/python-code-changes-not-reflecting-in-maya/m-p/10952749#M2893</guid>
      <dc:creator>imapepsi</dc:creator>
      <dc:date>2022-02-15T23:15:02Z</dc:date>
    </item>
  </channel>
</rss>

