Pythonモジュールのリロードの仕組みと潜在的な問題点について説明し、本番環境での使用を避けるよう推奨している。 `__main__`名前空間の働きとその活用方法を解説し、モジュールをスクリプトとしても使えるようにする方法を紹介している。 Pythonの ...
モジュールの概要: モジュールはPythonの`ModuleType`オブジェクトで、一度インポートすると`sys.modules`にキャッシュされる。 インポートの仕組み: Pythonは`import`時にまず`sys.modules`を確認し、存在しなければ新しいモジュールを読み込んで実行する。 モジュール ...
本稿の最後にモジュールの基礎をマスターする上で知っておくべきことを幾つか取り上げておこう。 グローバル変数「__name__」 グローバル変数「__name__」には、あるモジュールがインポートされた場合には、そのモジュール名が、そうではなく「python ...
この記事は会員限定です。会員登録(無料)すると全てご覧いただけます。 なお、モジュールやパッケージの詳細については「Python入門」の以下の記事を参考にしてほしい。 「モジュールの使い方」 「モジュールの作り方」 「パッケージ」 例外について ...
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 ...
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 ...
前回はfuncコマンドで各minion上のモジュールを実行する方法について解説しましたが、 今回はPythonプログラムからモジュールを実行する方法について解説します。 funcコマンドの場合は、 単純にモジュールを実行して結果を表示するだけでしたが、 Python ...
PythonとRustを使ってPythonの拡張モジュールを書く Hideo Hattori(以下、Hattori):ありがとうございます。このようなお話させていただく機会をいただきまして、ありがとうございます。今日は「RustとPython」ということでお話をさせていただきます、Hattori Hideoと ...
A big patch series sent out this weekend for the Linux kernel's perf subsystem removes the embedded Python and Perl scripting ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する