#author("2023-05-24T15:28:09+09:00","default:irrp","irrp") →Python関連Tips #contents ---- -exe化することでプログラムの速度が遅くなる可能性があります。exe化されたプログラムは、Pythonインタプリタが持つ高い最適化機能を持っていないため。 -また、exe化されたプログラムは、外部ライブラリやモジュールが含まれているため、起動時間が長くなることもあります。 -スピードを上げるには以下の方法が考えられます。 --不要なモジュールやライブラリを削除する --アプリケーションの起動時間を短縮するために、py2exeのオプションを調整する --CythonなどでPythonコードをコンパイルし、exe化する * 一般 [#leeb00c3] -[[The structure of .pyc files | Ned Batchelder>https://nedbatchelder.com/blog/200804/the_structure_of_pyc_files.html]] 2008 -[[エクセルをPythonで操作したい!〜xlwings×Pyinstaller〜|分析屋|note>https://note.com/bunsekiya_tech/n/n16a4573b9a76]] 2022.9 --Python環境が無い⼈にまるっとPython+ライブラリ+実⾏コードを渡す「Pyinstaller」。エクセルとPythonを連携させる「xlwings」。 --2つを連携させることでPython×エクセルアプリが誰にでも配布できるようになりました。 -[[Pythonファイルを超簡単にexeファイル化するGUIソフト - Qiita>https://qiita.com/osorezugoing/items/4ea5249c43c0ba8b89aa]] 2022.6 -[[Pythonスクリプトのexe化>https://qiita.com/ybsh2891/items/afd741153593d2d9e021]] 2021.7 *Py2exe [#uaf3be70] -[[DeprecationWarning: the `setup.py py2exe` command line interface is deprecated · Issue #150 · py2exe/py2exe · GitHub>https://github.com/py2exe/py2exe/issues/150]] 2022 --[[py2exe/migration.md at master · py2exe/py2exe · GitHub>https://github.com/py2exe/py2exe/blob/master/docs/migration.md]] 2022.9 --[[py2exe/py2exe.freeze.md at master · py2exe/py2exe · GitHub>https://github.com/py2exe/py2exe/blob/master/docs/py2exe.freeze.md]] -[[py2exe公式>http://www.py2exe.org/index.cgi/FrontPage]] -[[python - Multiple top-level packages discovered in a flat-layout - Stack Overflow>https://stackoverflow.com/questions/72294299/multiple-top-level-packages-discovered-in-a-flat-layout]] 2022 --下記のようなエラーが出る場合、setup() の引数に py_modules=[] を追加すると回避できる場合がある error: Multiple top-level packages discovered in a flat-layout: ['xxx'...]. To avoid accidental inclusion of unwanted files or directories, setuptools will not proceed with this build. If you are trying to create a single distribution with multiple packages on purpose, you should not rely on automatic discovery. Instead, consider the following options: 1. set up custom discovery (`find` directive with `include` or `exclude`) 2. use a `src-layout` 3. explicitly set `py_modules` or `packages` with a list of names To find more information, look for "package discovery" on setuptools docs. -[[python - py2exe - generate single executable file - Stack Overflow>https://stackoverflow.com/questions/112698/py2exe-generate-single-executable-file]] 2022.10 -[[python py2exeでexe化した後、pyside周りとかでエラーがでた場合の対処のメモ – SAKAIDEN>https://www.sakaiden.com/?p=31200]] 2022.10 -[[pyhon.py→exe化→軽量化→高速化 忘備録(pyinstaller py2exe) | by Yutaka_kun | LSC PSD | Medium>https://medium.com/lsc-psd/pyhon-py-exe%E5%8C%96-%E8%BB%BD%E9%87%8F%E5%8C%96-%E9%AB%98%E9%80%9F%E5%8C%96-%E5%BF%98%E5%82%99%E9%8C%B2-pyinstaller-py2exe-4cd7c5f70c99]] 2020 *Codon [#b43a50fd] -[[Codonを使いPythonで作成したプログラムをC/C++で活用する - Qiita>https://qiita.com/cha84rakanal/items/1aa3963596f8323ca451]] 2023.5 -[[Pythonを高速化する「Codon」コンパイラを使ってみた | DevelopersIO>https://dev.classmethod.jp/articles/python-compiler-codon-trial-use/]] 2023.4 -[[あなたのPythonを100倍高速にする技術 / Codon入門>https://zenn.dev/turing_motors/articles/e23973714c3ecf]] 2023.3 --[[GitHub - exaloop/codon: A high-performance, zero-overhead, extensible Python compiler using LLVM>https://github.com/exaloop/codon]] 2023.3 *Nukita [#d03ac545] -[[NuitkaでPythonプログラムを配布してみよう | インフォメーション・ディベロプメント>https://www.idnet.co.jp/column/page_245.html]] 2020 -[[PyInstaller より圧倒的に優れている Nuitka の使い方とハマったポイント | つくみ島だより>https://blog.tsukumijima.net/article/python-nuitka-usage/]] 2022 *モジュール化 [#l5b281a0] -[[Pythonで自分だけのクソライブラリを作る方法>https://zenn.dev/karaage0703/articles/db8c663640c68b]] 2023.5 -[[[Python] 最小限setup.pyでのビルドを通じてsetuptoolsの気持ちを聞いてみた | DevelopersIO>https://dev.classmethod.jp/articles/python-setup-minimum/]] 2023.4 -[[setuptools でサクッと自作モジュールを作る(python) - Qiita>https://qiita.com/kenmaro/items/78006af7d72d18e3121b]] 2020