<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: KodoOjiEngineer</title>
    <description>The latest articles on DEV Community by KodoOjiEngineer (@kodoojiengineer).</description>
    <link>https://dev.to/kodoojiengineer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F774200%2F212f8c31-808e-477a-9db6-c931bbb7ea3c.jpg</url>
      <title>DEV Community: KodoOjiEngineer</title>
      <link>https://dev.to/kodoojiengineer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kodoojiengineer"/>
    <language>en</language>
    <item>
      <title>Basic usage of PyInstaller and Pyarmor</title>
      <dc:creator>KodoOjiEngineer</dc:creator>
      <pubDate>Tue, 14 Dec 2021 08:19:15 +0000</pubDate>
      <link>https://dev.to/kodoojiengineer/basic-usage-of-pyinstaller-and-pyarmor-4el0</link>
      <guid>https://dev.to/kodoojiengineer/basic-usage-of-pyinstaller-and-pyarmor-4el0</guid>
      <description>&lt;h1&gt;
  
  
  Pyinstaller and Pyarmor
&lt;/h1&gt;

&lt;p&gt;Pyinstaller and Pyarmor are two tools that can be used to create GUI tools using Python, or to convert your code into an exe file for distribution.&lt;/p&gt;

&lt;p&gt;Pyinstaller turns your python code into an exe file on windows, or an app file on mac, and Pyarmor obfuscates the code before turning it into an exe if you don't want people to know what's in the code.&lt;/p&gt;

&lt;p&gt;I had a chance to use it at work, so I'll share it with you along with my personal notes.&lt;/p&gt;

&lt;h1&gt;
  
  
  Both are not Cross Platform.
&lt;/h1&gt;

&lt;p&gt;Both Pyinstaller and Pyarmor are not cross platform. Therefore, you have to exe and app them on Windows, Mac and Linux respectively. &lt;br&gt;
It is also important to make sure that the &lt;strong&gt;OS versions match&lt;/strong&gt; (I was unable to run the app on Catalina when I made it on Big Sur).&lt;/p&gt;

&lt;p&gt;(If you are using the Fastapi framework, &lt;code&gt;pip install websocket==8.1&lt;/code&gt; was required, due to the use of uvicorn?)&lt;/p&gt;

&lt;h1&gt;
  
  
  Command differences by environment
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flask
  ┝ __init__.py
  └ app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For simplicity, let's assume a Flask application like the one above.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If you have installed python or pythol library in your local environment&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pyinstaller 
 under /flask,  &lt;code&gt;pyinstaller app.py&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Pyarmor
 under /flask,  &lt;code&gt;pyarmor pack -e " --onefile" app.py&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you are installing Python and python library under Poetry environment&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pyinstaller 
  &lt;code&gt;pyinstaller app.py&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Pyarmor
  &lt;code&gt;pyarmor pack -e " --onefile" -x " --exclude venv --no-cross-protection" app.py&lt;/code&gt; (need to exclude .venv file)&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  License of Pyarmor
&lt;/h1&gt;

&lt;p&gt;You need to purchase a license for commercial use.&lt;br&gt;
It is a one-time purchase and costs about $70 (us doller). If I buy one, can I use it for more than one?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pyarmor.readthedocs.io/en/latest/license.html#purchase"&gt;PyArmor License&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There's not much information on Pyarmor, and I had a hard time figuring out how to Build it, especially in a poetry environment!&lt;br&gt;
I hope this helps someone out there!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
