per page, with , order by , clip by
Results of 1 - 10 of about 21 for initial (0.007 sec.)
functools --- 高階関数と呼び出し可能オブジェクトの操作 12177
functools --- 高階関数と呼び出し可能オブジェクトの操作 ソースコード: Lib/functools.py functools モジュールは、ほかの関数を操作したり返したりする高階関数のためのモジュールです。 一般に、このモジュールではあらゆる呼び出し可能オブジェクトを関数 ... alive False >>> c . set_alive () >>> c . alive True Added in version 3.4. functools. reduce ( function , iterable , / [ , initial ] ) 2 つの引数を取る function を、 iterable の要素に左から右へ累積的に適用し、単一の値にまとめます。 例えば reduce(lambda ... は ((((1+2)+3)+4)+5) を計算します。 左の引数 x は累積した値、右の引数 y は iterable から得た、更新に使う値です。 省略可能な initial を指定すると、計算時に iterable の要素より前に置かれ、 iterable が空の場合のデフォルト値にもなります。 initial を指定せず、 ... iterable に要素が 1 つしかない場合は、その要素を返します。 およそ次と等価です: initial_missing = object () def reduce ( function , iterable , / , initial = initial_missing ): it = iter ( iterable ) if initial ...
https://man.mtool.work/python/3.14/library/functools.html
smtplib --- SMTP プロトコルクライアント 11754
smtplib --- SMTP プロトコルクライアント ソースコード: Lib/smtplib.py smtplib モジュールは、SMTP または ESMTP の待ち受けデーモンが動作するインターネット上のマシンへメールを送るための、SMTP クライアントセッションオブジェクトを定義します。 SMT ... ions. If the optional host and port parameters are given, the SMTP connect() method is called with those parameters during initialization. If specified, local_hostname is used as the FQDN of the local host in the HELO/EHLO command. Otherwise, the local ... 注釈 スパマーによる悪用を防ぐため、多くのサイトでは SMTP の VRFY を無効にしています。 SMTP. login ( user , password , * , initial_response_ok = True ) 認証が必要な SMTP サーバにログインします。 引数は認証に使用するユーザ名とパスワードです。 このセッショ ... が対応する認証方法のうち、サーバが対応を通知したものを順に試します。 対応する認証方法の一覧は auth() を参照してください。 initial_response_ok は、そのまま auth() に渡されます。 オプションのキーワード引数 initial_response_ok は、それをサポートする認証方 ...
https://man.mtool.work/python/3.14/library/smtplib.html
textwrap --- テキストの折り返しと詰め込み 11129
textwrap --- テキストの折り返しと詰め込み ソースコード: Lib/textwrap.py textwrap モジュールは、実際の処理をすべて担う TextWrapper クラスと、いくつかの便利な関数を提供します。 1 つか 2 つの文字列を折り返したり詰め込んだりするだけなら、これら ... ょう。 それ以外の場合は、効率のために TextWrapper のインスタンスを使ってください。 textwrap. wrap ( text , width = 70 , * , initial_indent = '' , subsequent_indent = '' , expand_tabs = True , replace_whitespace = True , fix_sentence_endings = False , bre ... す。 wrap() の動作についての詳細は TextWrapper.wrap() メソッドを参照してください。 textwrap. fill ( text , width = 70 , * , initial_indent = '' , subsequent_indent = '' , expand_tabs = True , replace_whitespace = True , fix_sentence_endings = False , bre ... 引数を受け取ります。それぞれのキーワード引数は一つのインスタンス属性に対応します。したがって、例えば wrapper = TextWrapper ( initial_indent = "* " ) はこれと同じです wrapper = TextWrapper () wrapper . initial_indent = "* " 同じ TextWrapper オブジェクトは何 ...
https://man.mtool.work/python/3.14/library/textwrap.html
itertools --- 効率的なループ用のイテレータ生成関数群 10706
itertools --- 効率的なループ用のイテレータ生成関数群 このモジュールは イテレータ を構築する部品を実装しています。プログラム言語 APL, Haskell, SML からアイデアを得ていますが、 Python に適した形に修正されています。 このモジュールは、高速でメモ ... その場合はストリームを途中で打ち切る関数やループでのみ使用してください。 itertools. accumulate ( iterable [ , function , * , initial=None ] ) 累積和、または他の 2 引数関数による累積結果を返すイテレータを作成します。 function のデフォルトは加算です。 funct ... ion は、累積値と iterable から取り出した値の 2 つの引数を受け取る必要があります。 initial を指定すると、その値から累積を開始し、出力は入力のイテラブルより 1 要素多くなります。 およそ次と等価です: def accumulate ( ... iterable , function = operator . add , * , initial = None ): '累積値を返す' # accumulate([1,2,3,4,5]) → 1 3 6 10 15 # accumulate([1,2,3,4,5], initial=100) → 100 101 103 106 ...
https://man.mtool.work/python/3.14/library/itertools.html
タイマーファイル記述子 HOWTO 10080
タイマーファイル記述子 HOWTO リリース : 1.13 この HOWTO では、Linux のタイマーファイル記述子を Python で使う方法を説明します。 使用例 次の例は、タイマーファイル記述子を使って 1 秒に 2 回関数を実行する方法を示します。 # 実用的なスクリプトでは ... timerfd_create ( time . CLOCK_REALTIME ) # 1 秒後に初回の満了を迎え、その後は 0.5 秒間隔とする os . timerfd_settime ( fd , initial = 1 , interval = 0.5 ) try : # タイマーのイベントを 4 回処理する。 for _ in range ( 4 ): # タイマーが満了するまで read() は ... i , fd in enumerate ( fds , start = 1 ): one_sec_in_nsec = 10 ** 9 i = i * one_sec_in_nsec os . timerfd_settime_ns ( fd , initial = i // 4 , interval = i // 4 ) timeout = 3 try : conn = None is_active = True while is_active : # タイマーの満了を最大 3 秒 ... very 0.25 seconds; timer 2 every 0.5 seconds; etc for i , fd in enumerate ( fds , start = 1 ): os . timerfd_settime ( fd , initial = i / 4 , interval = i / 4 ) timeout = 3 try : conn = None is_active = True while is_active : # Wait for the timer to expi ...
https://man.mtool.work/python/3.14/howto/timerfd.html
io --- ストリームを扱うコアツール 10080
io --- ストリームを扱うコアツール ソースコード: Lib/io.py 概要 io モジュールは、さまざまな種類の I/O を扱うための Python の主要な機能を提供します。 I/O は大きく テキスト I/O 、 バイナリ I/O 、 raw I/O の 3 種類に分かれます。 これらは一般的な ... e.txt" , "r" , encoding = "utf-8" ) StringIO オブジェクトはインメモリーのテキストストリームです: f = io . StringIO ( "some initial text data" ) 注釈 非ブロッキングストリームを扱う場合、ストリームが直ちに操作を実行できないと、テキスト I/O オブジェクトの読 ... 定することです: f = open ( "myfile.jpg" , "rb" ) BytesIO はインメモリーのバイナリストリームです: f = io . BytesIO ( b "some initial binary data: \x00\x01 " ) バイナリーストリーム API は BufferedIOBase のドキュメントで詳しく解説します。 他のライブラリモジ ... reams バッファ付き I/O ストリームは、I/O デバイスに生 I/O より高レベルなインターフェースを提供します。 class io. BytesIO ( initial_bytes = b'' ) メモリ内のバイトバッファを使うバイナリストリームです。 BufferedIOBase を継承します。 close() メソッドを呼び出 ...
https://man.mtool.work/python/3.14/library/io.html
http.cookiejar --- HTTP クライアント用の Cookie 処理 8389
http.cookiejar --- HTTP クライアント用の Cookie 処理 ソースコード: Lib/http/cookiejar.py http.cookiejar モジュールは、HTTP クッキーを自動で扱うクラスを定義しています。 ウェブサーバーからの HTTP レスポンスで小さなデータ ( クッキー ) をクライ ... nverifiable = True , strict_ns_unverifiable = False , strict_ns_domain = DefaultCookiePolicy.DomainLiberal , strict_ns_set_initial_dollar = False , strict_ns_set_path = False , secure_protocols = ('https', 'wss') ) コンストラクタの引数はキーワード引数と ... をどの程度厳しくするかを指示するフラグです。とりうる値については下の説明を見てください。 DefaultCookiePolicy. strict_ns_set_initial_dollar Set-Cookie: ヘッダで、 '$' で始まる名前のクッキーを無視します。 DefaultCookiePolicy. strict_ns_set_path 要求した UR ... 定していれば True です。 Cookie. domain_specified サーバにより明示的にドメインが指定されていれば True です。 Cookie. domain_initial_dot サーバが明示的に指定したドメインがドット ( '.' ) で始まっていれば True です。 クッキーは、オプションとして標準的でない ...
https://man.mtool.work/python/3.14/library/http.cookiejar.html
拡張モジュールの定義 7966
拡張モジュールの定義 A C extension for CPython is a shared library (for example, a .so file on Linux, .pyd DLL on Windows), which is loadable into the Python process (for example, it is compiled with compatible compiler settings), and which ... exports an initialization function . デフォルトで (つまり、 importlib.machinery.ExtensionFileLoader によって) インポート可能であるためには、共 ... ルの一つは Setuptools であり、ドキュメントは https://setuptools.pypa.io/en/latest/setuptools.html にあります。 Normally, the initialization function returns a module definition initialized using PyModuleDef_Init() . This allows splitting the creation proc ... , Python itself creates the module object -- that is, it does the equivalent of object.__new__() for classes. It also sets initial attributes like __package__ and __loader__ . Afterwards, the module object is initialized using extension-specific code -- ...
https://man.mtool.work/python/3.14/c-api/extension-modules.html
関数型プログラミング HOWTO 7966
関数型プログラミング HOWTO Author : A. M. Kuchling Release : 0.32 この文書では、関数型スタイルでプログラムを実装するのにピッタリな Python の機能を見てまわることにしましょう。まず関数型プログラミングという概念を紹介したあと、 iterator や gen ... = functools . partial ( log , subsystem = 'server' ) server_log ( 'Unable to open socket' ) functools.reduce(func, iter, [initial_value]) は、イテラブルの全要素に累積的に演算を適用するため、無限のイテラブルには使えません。 func は 2 つの要素を受け取り、 ... く、イテラブルが何も値を返さない場合は、 TypeError が送出されます。 初期値を指定した場合は、それを出発点にして、最初に func(initial_value, A) を計算します。 >>> import operator , functools >>> functools . reduce ( operator . concat , [ 'A' , 'BB' , 'C' ] ... s . reduce ( operator . concat , []) Traceback (most recent call last): ... TypeError : reduce() of empty iterable with no initial value >>> functools . reduce ( operator . mul , [ 1 , 2 , 3 ], 1 ) 6 >>> functools . reduce ( operator . mul , [], 1 ) 1 o ...
https://man.mtool.work/python/3.14/howto/functional.html
Logging クックブック 7543
Logging クックブック Author : Vinay Sajip <vinay_sajip at red-dove dot com> このページは、過去に有用であるとされていた、logging に関連するいくつものレシピを含んでいます。チュートリアルやリファレンス情報へのリンクについては その他のリソース ... nfig ): """ This could be done in the main process, but is just done in a separate process for illustrative purposes. This initialises logging according to the specified configuration, starts the listener and waits for the main process to signal complet ... on. In practice, they could be a heterogeneous bunch of processes rather than ones which are identical to each other. This initialises logging according to the specified configuration, and logs a hundred messages with random levels to randomly selected ... leep ( 0.01 ) def main (): q = Queue () # The main process gets a simple configuration which prints to the console. config_initial = { 'version' : 1 , 'handlers' : { 'console' : { 'class' : 'logging.StreamHandler' , 'level' : 'INFO' } }, 'root' : { 'han ...
https://man.mtool.work/python/3.14/howto/logging-cookbook.html
PREV 1 2 3 NEXT