Skip to main content

CIT-AM Introduction Programming class lib

Project description

IntroductionPrograming-library: citam_pydraw

Overview

千葉工業大学 先進工学部 知能メディア工学科の第2セメスター「プログラミング言語基礎」及び第3セメスター「プロジェクト1」において使用される、Pythonの図形描画ライブラリです。 tkinterのWrapperで、Processingライクに動作させることを目指して作成されました。

Requirement

必要環境

  • MacOS
    • Windowsでも使用可能ですが、音楽を再生する機能のみ使用不可です
      • 今後のバージョンでは対応しなくなる可能性があります
    • Linux環境も一応ですが対応しています
  • Python3.10.5 <
    • 動作確認済み >=3.12.2
    • MacのSystem DefaultのPython環境にはライブラリを入れることができないため注意してください
  • 必要なライブラリ
    • tkinter 8.6以上
    • Pillow 11.2以上
    • brew + pyenv環境の場合、対応したpython-tkが必要です
  • 音楽再生用コマンド
    • MacOS: afplay
    • Linux: mpv

開発・動作確認環境

  • MacOS Ventura以降
  • Docker環境
  • Python
    • brew + pyenv
    • 3.10.5 <
    • <= 3.12.2
  • ライブラリ
    • Python標準
    • tkinter 8.6
    • Pillow 11.2.1

環境構築の既知トラブル

MacOSかつpython3.10系の場合

tkinter8.5がデフォルトで入っているようですが、Pythonとtcl/tkの対応問題によって実行時にWindowが黒く表示される不具合が発生します。

import tkinter
tkinter.Tcl().eval('info patchlevel')

上記をPythonで実行するとtkinterのバージョンを確認することが可能です。

開発・動作確認環境と同様にbrew + pyenv環境の場合は

pyenv uninstall 3.10.x
brew install python-tk@3.10
pyenv install 3.10.x

でおおよその場合解決します。

実行時にImportErrorが出て、エラー箇所がImport _tkinterの場合

tkinterがうまく読み込めていません。 Python Build時にtkinterのリンクがちゃんといってない?詳細な原因は不明です。 開発・動作確認環境と同様にbrew + pyenv環境の場合は

pyenv uninstall 3.x.x
brew install python-tk@3.x
pyenv install 3.x.x

でおおよその場合解決します。

brew install python-tk@3.x

の際は、python-tkのバージョンをインストールしたいPythonのバージョンに合わせて指定してください。

import IP 実行時にModuleNotFoundErrorが出て、エラー箇所がimport IP.IPの場合

他にも以下パターンは同様の原因です。

ModuleNotFoundError: No module named "IP.mouse"
ModuleNotFoundError: No module named "IP.keyboard"

パッケージのダウンロードもしくは展開時(zipでダウンロードした場合)にライブラリ内のIP.py等が欠損したことが原因です。 ダウンロードもしくは展開をやり直して、以下のファイルが全てあることを確認してください。

IPファイル構成

Usage

導入方法

gitからクローン

git clone https://github.com/aais-lab/IntroductionPrograming-library.git

ライブラリのフォルダへ移動して、pip install

cd IntroductionPrograming-library
pip install .

Successfully installed IP-x.x.xと表示されれば導入完了です。

Reference

関数等のリファレンス IntroductionPrograming-Reference

Author

Nao Yamanouchi

Licence

3-Clause BSD

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

citam_pydraw-2.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

citam_pydraw-2.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file citam_pydraw-2.0.tar.gz.

File metadata

  • Download URL: citam_pydraw-2.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for citam_pydraw-2.0.tar.gz
Algorithm Hash digest
SHA256 df1e69d5e087068ab838b1783e8713cc4add5810e2658cd60225071d9cacc859
MD5 9cd1a17fee3a25d53a397eae52caecd1
BLAKE2b-256 4b16efe7e1eaeaf4dfdd02acb9cba6e3a1b28c8775d22da77d874bdf5319e8dd

See more details on using hashes here.

File details

Details for the file citam_pydraw-2.0-py3-none-any.whl.

File metadata

  • Download URL: citam_pydraw-2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for citam_pydraw-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffa2c569cd0f4963aa72d6e5c076303c93dd15e3ef00b98453bd536ace06bb5a
MD5 28697a08356ff65bc71bc82f702062a4
BLAKE2b-256 64b4c2c44f896073154fb5f209dac471b2672f35ff49233bd1a87c2612050792

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page