0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Pyxelでファイルを実行形式に変換する

Posted at

概要

Pyxelは作成したアプリをexeファイルにしたり、Webサーバーで実行できるHTMLに変換することができます。
その変換方法をまとめたページになります。

(1)アプリケーションファイル(pyxapp)を作成する

  1. PyxelのPythonファイル(sample.py)を作成する
  2. dstフォルダーを作成する
  3. 作成したdstフォルダーに①で作成したsample.pyをコピーする
    リソースファイルもある場合は同じ階層にコピーしてください。
  4. コンソールでpyxel package dst ./dst /sample.pyを入力+Enterで
    dst.pyxappファイルが作成されます。

作成したファイルはpyxel play ./dst.pyxappコマンドで実行できます。

(2)実行ファイル(exe)を作成する場合

  1. pip install pyinstallerでPyinstallerをインストールする
  2. コンソールでpyxel app2exe ./dst.pyxappのコマンドでexeファイルが作成されます。
  3. 作成されたexeファイルを実行するとアプリが実行されます。

(3) Web公開用ファイル(HTML)を作成する

  1. 「pyxapp」ファイルを作成する
  2. コンソールでpyxel app2html ./dst.pyxappを実行してHTMLファイルを作成する
  3. 作成されたHTMLファイルをWebサーバーなどで実行するとゲームで遊ぶことができます。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?