<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Working with modules]]></title><description><![CDATA[<p dir="auto">Hi, I have a question about working in modules—specifically where the generated .pyc files are (if anywhere).</p>
<p dir="auto">For example: I import a module of helper functions into my main script and test the script in RF. And then when I have to edit one of the helper functions, RF isn't "aware" of the changes. I usually quit and re-open RF and then it'll work fine.</p>
<p dir="auto">My understanding is that .pyc files are created on import, at runtime, and I assume this is why RF doesn't see the changes in the imported module, but I don't see those files (or a <code>__pycache__</code>) folder in my dev folder. Are they stored somewhere in Application Support?</p>
]]></description><link>https://forum.robofont.com/topic/546/working-with-modules</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 02:27:23 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/546.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Nov 2018 15:57:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Working with modules on Mon, 04 Nov 2019 13:27:05 GMT]]></title><description><![CDATA[<p dir="auto">Hi, I have a question about working in modules—specifically where the generated .pyc files are (if anywhere).</p>
<p dir="auto">For example: I import a module of helper functions into my main script and test the script in RF. And then when I have to edit one of the helper functions, RF isn't "aware" of the changes. I usually quit and re-open RF and then it'll work fine.</p>
<p dir="auto">My understanding is that .pyc files are created on import, at runtime, and I assume this is why RF doesn't see the changes in the imported module, but I don't see those files (or a <code>__pycache__</code>) folder in my dev folder. Are they stored somewhere in Application Support?</p>
]]></description><link>https://forum.robofont.com/post/1887</link><guid isPermaLink="true">https://forum.robofont.com/post/1887</guid><dc:creator><![CDATA[jesentanadi]]></dc:creator><pubDate>Mon, 04 Nov 2019 13:27:05 GMT</pubDate></item><item><title><![CDATA[Reply to Working with modules on Thu, 29 Nov 2018 08:53:57 GMT]]></title><description><![CDATA[<p dir="auto"><code>.pyc</code> or <code>__pychache__</code> are indeed made during runtime on import of the requested module. To reload a py file in python3 you can use:</p>
<pre><code class="language-python">import module

import importlib
importlib.reload(module)
</code></pre>
<p dir="auto">You will have to do this for each ‘file’ in your module.<br />
Be careful with subclasses of NSObjects.</p>
]]></description><link>https://forum.robofont.com/post/1888</link><guid isPermaLink="true">https://forum.robofont.com/post/1888</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Thu, 29 Nov 2018 08:53:57 GMT</pubDate></item><item><title><![CDATA[Reply to Working with modules on Thu, 29 Nov 2018 11:40:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/1">@frederik</a> Thanks. Is it possible to delete <code>.pyc</code> files of <code>__pycache__</code> folder? I don't know where RoboFont puts those.</p>
]]></description><link>https://forum.robofont.com/post/1890</link><guid isPermaLink="true">https://forum.robofont.com/post/1890</guid><dc:creator><![CDATA[jesentanadi]]></dc:creator><pubDate>Thu, 29 Nov 2018 11:40:27 GMT</pubDate></item><item><title><![CDATA[Reply to Working with modules on Sat, 01 Dec 2018 20:31:49 GMT]]></title><description><![CDATA[<p dir="auto">If you have the extension installed RoboFont copies during installing the extension to <code>&lt;user&gt;/Libary/Application Support/RoboFont/plugins</code> and there you will find your <code>.pyc</code> or <code>pycache</code>.</p>
<p dir="auto">For development I would recommend to have a <code>main.py</code> that load the extension so you can run this directly in the scripting window.</p>
<p dir="auto">good luck!</p>
]]></description><link>https://forum.robofont.com/post/1892</link><guid isPermaLink="true">https://forum.robofont.com/post/1892</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Sat, 01 Dec 2018 20:31:49 GMT</pubDate></item><item><title><![CDATA[Reply to Working with modules on Mon, 03 Dec 2018 15:50:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/1">@frederik</a> One more question.</p>
<p dir="auto">Another problem I'm having is that if I have 2 extensions with some helper functions in a <code>utils</code> directory, when I try to run the second one, I get a <code>ModuleNotFoundError</code> for something in the <code>utils</code> directory.</p>
<p dir="auto">For example:</p>
<pre><code class="language-console">Extension1.roboFontExt
└── lib
    ├── extensionName.py
    └── utils
        ├── __init__.py
        └── helperFunctions.py

Extension2.roboFontExt
└── lib
    ├── anotherExtension.py
    └── utils
        ├── __init__.py
        └── calculations.py
</code></pre>
<p dir="auto">When I have Extension1 installed and I try to run Extension2 from the scripting window, I'll get something like <code>ModuleNotFoundError: No module named utils.calculations</code>.</p>
<p dir="auto">Should I treat each extension like a package and put an <code>__init__.py</code> in the <code>lib</code> folder of each extension?</p>
<pre><code class="language-console">Extension1.roboFontExt
└── lib
    ├── __init__.py
    ├── extensionName.py
    └── utils
        ├── __init__.py
        └── helperFunctions.py

Extension2.roboFontExt
└── lib
    ├── __init__.py
    ├── anotherExtension.py
    └── utils
        ├── __init__.py
        └── calculations.py
</code></pre>
]]></description><link>https://forum.robofont.com/post/1893</link><guid isPermaLink="true">https://forum.robofont.com/post/1893</guid><dc:creator><![CDATA[jesentanadi]]></dc:creator><pubDate>Mon, 03 Dec 2018 15:50:53 GMT</pubDate></item><item><title><![CDATA[Reply to Working with modules on Mon, 03 Dec 2018 16:50:19 GMT]]></title><description><![CDATA[<p dir="auto">when an extension is installed, its <code>lib</code> folder is added to the <code>sys.path</code>. and since it’s a shared namespace, there is a conflict if two modules have the same name.</p>
<p dir="auto">the recommendation is to use reverse domain names (without dots) to create unique names for extension modules:</p>
<ul>
<li><code>comJesentanadiExtensionNameUtils</code> (Extension1)</li>
<li><code>comJesentanadiAnotherExtensionUtils</code> (Extension2)</li>
</ul>
<p dir="auto">see the note in <a href="http://robofont.com/documentation/building-tools/extensions/extension-file-spec/#lib" rel="nofollow">Extension File Specification &gt; lib</a></p>
]]></description><link>https://forum.robofont.com/post/1894</link><guid isPermaLink="true">https://forum.robofont.com/post/1894</guid><dc:creator><![CDATA[gferreira]]></dc:creator><pubDate>Mon, 03 Dec 2018 16:50:19 GMT</pubDate></item><item><title><![CDATA[Reply to Working with modules on Mon, 03 Dec 2018 16:07:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/22">@gferreira</a> Ah! Ok, thank you. Very helpful! :+1:</p>
]]></description><link>https://forum.robofont.com/post/1895</link><guid isPermaLink="true">https://forum.robofont.com/post/1895</guid><dc:creator><![CDATA[jesentanadi]]></dc:creator><pubDate>Mon, 03 Dec 2018 16:07:03 GMT</pubDate></item></channel></rss>