こんにちは!TechCommitメンバーの友季子です♬今回は、Pythonのモジュール、パッケージ、サブモジュール、そして __init__ について詳しく解説していきます。Pythonを使う上で、これらの概念を理解することはとても大切ですので、ぜひ参考にしてくださいね!
本稿の最後にモジュールの基礎をマスターする上で知っておくべきことを幾つか取り上げておこう。 グローバル変数「__name__」 グローバル変数「__name__」には、あるモジュールがインポートされた場合には、そのモジュール名が、そうではなく「python ...
モジュールの概要: モジュールはPythonの`ModuleType`オブジェクトで、一度インポートすると`sys.modules`にキャッシュされる。 インポートの仕組み: Pythonは`import`時にまず`sys.modules`を確認し、存在しなければ新しいモジュールを読み込んで実行する。 モジュール ...
Once you know how to add and use a Python module, you will greatly extend the capabilities of the language. A Python module is an external class or set of functions that exist outside the main file of ...
PythonとRustを使ってPythonの拡張モジュールを書く Hideo Hattori(以下、Hattori):ありがとうございます。このようなお話させていただく機会をいただきまして、ありがとうございます。今日は「RustとPython」ということでお話をさせていただきます、Hattori Hideoと ...
本格的にPythonでモジュールをいくつも開発して利用するようなことでもない限り、それほど必要性は高くないのだが、たくさんデプロイされているコンパイル済みのPythonファイルについても一応、知っておいたほうがよいだろう。 Pythonやそのパッケージを ...
venvモジュールで仮想環境を構築した後でパッケージをインストールすると、pipを最新バージョンにするように推奨されることがある。これを避けるために、最初から最新バージョンのpipを仮想環境にインストールする方法を紹介する。 仮想環境構築時に ...
A big patch series sent out this weekend for the Linux kernel's perf subsystem removes the embedded Python and Perl scripting ...
How does Python deal with memory management? Learn the ins and outs of Python's garbage collection system and how to avoid its pitfalls. Python grants its users many conveniences, and one of the ...
Now that we know how to build a module, the time has come to discover what goes into coding a module. Mostly this is a matter of making use of the C API and this is the subject of most of this book.
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する