<?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: pyc &amp; importing modules in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176073#M13545</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah nice.. so there's no specific steps in ArcPy, all standard Python stuff, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Sep 2016 11:06:31 GMT</pubDate>
    <dc:creator>MatthiasBuehler</dc:creator>
    <dc:date>2016-09-03T11:06:31Z</dc:date>
    <item>
      <title>pyc &amp; importing modules</title>
      <link>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176071#M13543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to create .pyc files and create scripts that will still run only using .pyc files (for sharing the files).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;important is that I would also like to use import modules I have created, so it should work to import pyc files or compile all files into one main pyc file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can I get a short into in how to create those files?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please let me know.. thanks!&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Sep 2016 10:30:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176071#M13543</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2016-09-03T10:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: pyc &amp; importing modules</title>
      <link>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176072#M13544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you need to try,&amp;nbsp;&lt;A class="link-titled" href="https://docs.python.org/2.7/library/py_compile.html" title="https://docs.python.org/2.7/library/py_compile.html" rel="nofollow noopener noreferrer" target="_blank"&gt;32.10. py_compile — Compile Python source files — Python 2.7.12 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are many references to this, just search .... create pyc python ... as a search phrase, &amp;nbsp;e.g.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://stackoverflow.com/questions/5607283/how-can-i-manually-generate-a-pyc-file-from-a-py-file" title="http://stackoverflow.com/questions/5607283/how-can-i-manually-generate-a-pyc-file-from-a-py-file" rel="nofollow noopener noreferrer" target="_blank"&gt;python - How can I manually generate a .pyc file from a .py file - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&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; py_compile
py_compile&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;compile&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"file.py"&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:04:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176072#M13544</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T09:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: pyc &amp; importing modules</title>
      <link>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176073#M13545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah nice.. so there's no specific steps in ArcPy, all standard Python stuff, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Sep 2016 11:06:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176073#M13545</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2016-09-03T11:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: pyc &amp; importing modules</title>
      <link>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176074#M13546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;give it whirl with your code, I don't use pyc... the only advantage is for use in a situation where people are working in an environment that would restrict the compilation on their machine. &amp;nbsp;If it for hiding/protecting your code, it will slow down most, but not guarantee it... for that produce a license agreement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Sep 2016 11:13:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176074#M13546</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-03T11:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: pyc &amp; importing modules</title>
      <link>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176075#M13547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, thanks for the inputs, as always!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try!&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Sep 2016 11:22:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176075#M13547</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2016-09-03T11:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: pyc &amp; importing modules</title>
      <link>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176076#M13548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Report? did it work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 07:20:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176076#M13548</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-16T07:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: pyc &amp; importing modules</title>
      <link>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176077#M13549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, I've been out of town for work for 2 weeks .. and this week's been busy too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But thanks for checking back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The compiling part did work, yes. Though what I ended up using are the automatically generated .pyc files in the same folder. I am not sure why I did not see them being produced in the first place, this is puzzling. It may be a folder refresh issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically, the structure I'm using now is 1 py file and 1 pyc file, where in the first file I just call a method in the second file, passing on the relevant parameters / user settings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 07:36:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176077#M13549</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2016-09-16T07:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: pyc &amp; importing modules</title>
      <link>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176078#M13550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pyc files are created when a file/module is created. &amp;nbsp;It remains the same unless edits to the underlying script are made, just be aware that if you edit your script from which the pyc was created, that you need to use the new pyc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 10:51:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176078#M13550</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-16T10:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: pyc &amp; importing modules</title>
      <link>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176079#M13551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.python.org/2/library/compileall.html" title="https://docs.python.org/2/library/compileall.html"&gt;32.11. compileall — Byte-compile Python libraries — Python 2.7.12 documentation&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;But note that distributing pycs only won't stop people from being able to see your source code if they want to...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.curiousefficiency.org/posts/2011/04/benefits-and-limitations-of-pyc-only.html" title="http://www.curiousefficiency.org/posts/2011/04/benefits-and-limitations-of-pyc-only.html"&gt;The benefits (and limitations) of PYC-only Python distribution | Curious Efficiency&lt;/A&gt;&amp;nbsp;&lt;A class="link-titled" href="https://docs.python.org/2/library/compileall.html" title="https://docs.python.org/2/library/compileall.html"&gt;https://docs.python.org/2/library/compileall.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2016 10:59:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyc-importing-modules/m-p/176079#M13551</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2016-09-19T10:59:31Z</dc:date>
    </item>
  </channel>
</rss>

