FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-docs-ja/howto/curses.po at 3.15 · python/python-docs-ja · GitHub
python
python-docs-ja
Repository navigation
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
python-docs-ja
/
howto
/
curses.po
Copy path
More file actions
More file actions
Latest commit
History
History
History
1167 lines (1049 loc) · 54.9 KB
Breadcrumbs
python-docs-ja
/
howto
/
curses.po
Copy path
File metadata and controls
1167 lines (1049 loc) · 54.9 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
SOME DESCRIPTIVE TITLE.
#
Copyright (C) 2001 Python Software Foundation
#
This file is distributed under the same license as the Python package.
#
FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#
Translators:
#
python-doc bot, 2025
#
Inada Naoki <songofacandy@gmail.com>, 2026
#
#,
fuzzy
msgid ""
msgstr ""
"
Project-Id-Version
:
Python 3.15\n
"
"
Report-Msgid-Bugs-To
:
\n
"
"
POT-Creation-Date
:
2026-10-25 17:19+0000\n
"
"
PO-Revision-Date
:
2025-09-16 00:00+0000\n
"
"
Last-Translator
:
Inada Naoki <songofacandy@gmail.com>, 2026\n
"
"
Language-Team
:
Japanese (https://app.transifex.com/python-doc/teams/5390/
"
"
ja/)\n
"
"
MIME-Version
:
1.0\n
"
"
Content-Type
:
text/plain; charset=UTF-8\n
"
"
Content-Transfer-Encoding
:
8bit\n
"
"
Language
:
ja\n
"
"
Plural-Forms
:
nplurals=1; plural=0;\n
"
#:
../../howto/curses.rst:5
msgid
"Curses Programming with Python"
msgstr
"Python で Curses プログラミング"
#:
../../howto/curses.rst-1
msgid
"Abstract"
msgstr
"概要"
#:
../../howto/curses.rst:12
msgid
""
"This document describes how to use the :mod:`curses` extension module to "
"control text-mode displays."
msgstr
""
"このドキュメントでは :mod:`curses` 拡張モジュールでテキストモードディスプレイ"
"を制御する方法について記述します。"
#:
../../howto/curses.rst:17
msgid
"What is curses?"
msgstr
"curses ってなに?"
#:
../../howto/curses.rst:19
msgid
""
"The curses library supplies a terminal-independent screen-painting and "
"keyboard-handling facility for text-based terminals; such terminals include "
"VT100s, the Linux console, and the simulated terminal provided by various "
"programs. Display terminals support various control codes to perform common "
"operations such as moving the cursor, scrolling the screen, and erasing "
"areas. Different terminals use widely differing codes, and often have their "
"own minor quirks."
msgstr
""
"curses ライブラリは、VT100s や Linux コンソール、さまざまなプログラムが提供す"
"るエミュレーション端末といったテキストベースの端末(ターミナル)のために、端"
"末に依存しないスクリーン描画や、キーボードの処理を提供します。端末はカーソル"
"の移動や、画面のスクロール、領域の消去といった共通の操作を行うための様々な制"
"御コードをサポートします。端末の種類によって大きく異なる制御コードを使うこと"
"があり、しばしば独特の癖があります。"
#:
../../howto/curses.rst:27
msgid
""
"In a world of graphical displays, one might ask
\"
why bother
\"
? It's true "
"that character-cell display terminals are an obsolete technology, but there "
"are niches in which being able to do fancy things with them are still "
"valuable. One niche is on small-footprint or embedded Unixes that don't run "
"an X server. Another is tools such as OS installers and kernel "
"configurators that may have to run before any graphical support is available."
msgstr
""
"グラフィカルなディスプレイが当たり前の今となっては、「なんでわざわざ?」と疑"
"問に思うかもしれません。確かに文字表示端末は時代遅れな技術ではありますが、"
"ニッチな領域が存在していて、意匠を凝らすことができるため、いまだに価値のある"
"ものとなっています。そのような領域の一つは、例えば X サーバーを持たない組み込"
"みのUnixです。ほかにも、OSのインストーラや、カーネル設定などのツールで、これ"
"らはグラフィカルサポートが利用可能になる前に動作する必要があります。"
msgid
""
"The curses library provides fairly basic functionality, providing the "
"programmer with an abstraction of a display containing multiple non-"
"overlapping windows of text. The contents of a window can be changed in "
"various ways---adding text, erasing it, changing its appearance---and the "
"curses library will figure out what control codes need to be sent to the "
"terminal to produce the right output. curses doesn't provide many user-"
"interface concepts such as buttons, checkboxes, or dialogs; if you need such "
"features, consider a user interface library such as :pypi:`Urwid`."
msgstr
""
"curses ライブラリが提供するのは比較的基本的な機能です。\n"
"画面を、互いに重ならない複数のテキストウィンドウとして扱う仕組みを提供しま"
"す。\n"
"ウィンドウの内容は、テキストの追加や削除、見た目の変更など、さまざまな方法で"
"変更できます。\n"
"curses ライブラリは、意図した表示にするために端末へ送る制御コードを判断しま"
"す。\n"
"ボタン、チェックボックス、ダイアログなどのユーザーインターフェース部品の多く"
"は提供しません。\n"
"そのような機能が必要なら、:pypi:`Urwid` などのユーザーインターフェースライブ"
"ラリを検討してください。"
#:
../../howto/curses.rst:45
msgid
""
"The curses library was originally written for BSD Unix; the later System V "
"versions of Unix from AT&T added many enhancements and new functions. BSD "
"curses is no longer maintained, having been replaced by ncurses, which is an "
"open-source implementation of the AT&T interface. If you're using an open-"
"source Unix such as Linux or FreeBSD, your system almost certainly uses "
"ncurses. Since most current commercial Unix versions are based on System V "
"code, all the functions described here will probably be available. The "
"older versions of curses carried by some proprietary Unixes may not support "
"everything, though."
msgstr
""
"curses ライブラリは元々 BSD UNIX 向けに書かれました; 後の AT&T から出た Unix "
"System V バージョンで多くの機能と新機能が追加されました。BSD curses はいまや"
"メンテナンスされておらず、これは AT&T インターフェースのオープンソース実装で"
"ある ncurses にとって置き換えられました。Linux や FreeBSD のようなオープン"
"ソース Unix を利用している場合は、おそらくシステムは ncurses を利用していま"
"す。現在のほとんどの商用 Unix は System V のコードを基にしているため、ここで"
"述べる全ての関数が利用できるはずです。しかし、古いバージョンの curses を持つ"
"いくつかのプロプライエタリ Unix は全てには対応していないでしょう。"
msgid
""
"The Windows version of Python doesn't include the :mod:`curses` module. The "
"third-party :pypi:`windows-curses` package provides the same interface on "
"Windows."
msgstr
""
"Windows 版の Python には :mod:`curses` モジュールが含まれていません。\n"
"サードパーティーの :pypi:`windows-curses` パッケージが、Windows で同じイン"
"ターフェースを提供します。"
#:
../../howto/curses.rst:60
msgid
"The Python curses module"
msgstr
"Python の curses module"
msgid
""
"The Python module is a fairly simple wrapper over the C functions provided "
"by curses; if you're already familiar with curses programming in C, it's "
"really easy to transfer that knowledge to Python. The biggest difference is "
"that the Python interface makes things simpler by merging different C "
"functions such as :c:func:`!addstr`, :c:func:`!mvaddstr`, and :c:func:`!"
"mvwaddstr` into a single :meth:`~curses.window.addstr` method. You'll see "
"this covered in more detail later."
msgstr
""
"Python のモジュールは、curses が提供する C 関数の比較的単純なラッパです。\n"
"C での curses プログラミングに慣れていれば、その知識を Python でも簡単に生か"
"せます。\n"
"最大の違いは、Python のインターフェースでは :c:func:`!addstr`、:c:func:`!"
"mvaddstr`、:c:func:`!mvwaddstr` のような別々の C 関数を 1 つの :meth:"
"`~curses.window.addstr` メソッドにまとめ、扱いやすくしていることです。\n"
"詳しくは後で説明します。"
#:
../../howto/curses.rst:70
msgid
""
"This HOWTO is an introduction to writing text-mode programs with curses and "
"Python. It doesn't attempt to be a complete guide to the curses API; for "
"that, see the Python library guide's section on ncurses, and the C manual "
"pages for ncurses. It will, however, give you the basic ideas."
msgstr
""
"この HOWTO は curses と Python を使ってテキストプログラムを書くための入門記事"
"です。 curses API に対する完全な解説をすることは意図していません; その目的の"
"ためには Python ライブラリガイドの ncurses 節と C 言語マニュアルのncurses の"
"ページを参照してください。とはいえ、この文章は基本的な考えを提供してくれるで"
"しょう。"
#:
../../howto/curses.rst:77
msgid
"Starting and ending a curses application"
msgstr
"curses アプリケーションの起動と終了"
msgid
""
"Before doing anything, curses must be initialized. This is done by calling "
"the :func:`~curses.initscr` function, which will determine the terminal "
"type, send any required setup codes to the terminal, and create various "
"internal data structures. If successful, :func:`!initscr` returns a window "
"object representing the entire screen; this is usually called ``stdscr`` "
"after the name of the corresponding C variable. ::"
msgstr
""
"何をするにしても、まず curses を初期化する必要があります。\n"
":func:`~curses.initscr` 関数を呼び出すと、端末の種類を判定し、必要な設定コー"
"ドを端末へ送り、内部の各種データ構造を作成します。\n"
"成功すると、:func:`!initscr` は画面全体を表すウィンドウオブジェクトを返しま"
"す。\n"
"これは対応する C の変数名にちなんで、通常 ``stdscr`` と呼ばれます。 ::"
msgid
""
"import curses\n"
"stdscr = curses.initscr()"
msgstr
""
"import curses\n"
"stdscr = curses.initscr()"
msgid
""
"Usually curses applications turn off automatic echoing of keys to the "
"screen, in order to be able to read keys and only display them under certain "
"circumstances. This requires calling the :func:`~curses.noecho` function. ::"
msgstr
""
"通常、curses アプリケーションではキー入力を自動的に画面へ表示する機能 (エ"
"コー) を無効にし、キーを読み取った後、必要な場合にだけ表示します。\n"
"そのためには :func:`~curses.noecho` 関数を呼び出します。 ::"
msgid
"curses.noecho()"
msgstr
"curses.noecho()"
#:
../../howto/curses.rst:97
msgid
""
"Applications will also commonly need to react to keys instantly, without "
"requiring the Enter key to be pressed; this is called cbreak mode, as "
"opposed to the usual buffered input mode. ::"
msgstr
""
"通常アプリケーションはまた、Enter キーを押すことなく、キーに対してすぐに反応"
"する必要があります; これは cbreak モードと呼ばれ、通常の入力がバッファされる"
"モードと逆に動作します。 ::"
msgid
"curses.cbreak()"
msgstr
"curses.cbreak()"
msgid
""
"Terminals usually return special keys, such as the cursor keys or navigation "
"keys such as Page Up and Home, as a multibyte escape sequence. While you "
"could write your application to expect such sequences and process them "
"accordingly, curses can do it for you, returning a special value such as :"
"const:`curses.KEY_LEFT`. To get curses to do the job, you'll have to enable "
"keypad mode. ::"
msgstr
""
"端末は通常、カーソルキーや Page Up、Home などの特殊キーを、複数バイトのエス"
"ケープシーケンスとして返します。\n"
"これらのシーケンスを自分で処理することもできますが、curses に任せると :const:"
"`curses.KEY_LEFT` のような特別な値として受け取れます。\n"
"そのためには、キーパッドモードを有効にします。 ::"
msgid
"stdscr.keypad(True)"
msgstr
"stdscr.keypad(True)"
#:
../../howto/curses.rst:112
msgid
""
"Terminating a curses application is much easier than starting one. You'll "
"need to call::"
msgstr
""
"curses アプリケーションを終了させるのは起動よりも簡単です。 以下を呼び出す必"
"要があります::"
msgid
""
"curses.nocbreak()\n"
"stdscr.keypad(False)\n"
"curses.echo()"
msgstr
""
"curses.nocbreak()\n"
"stdscr.keypad(False)\n"
"curses.echo()"
#:
../../howto/curses.rst:119
msgid
""
"to reverse the curses-friendly terminal settings. Then call the :func:"
"`~curses.endwin` function to restore the terminal to its original operating "
"mode. ::"
msgstr
""
"cursesに親和性の高い設定をもとに戻します。そして、:func:`~curses.endwin` 関数"
"を呼び出し、端末を通常の操作モードに復旧します。 ::"
msgid
"curses.endwin()"
msgstr
"curses.endwin()"
msgid
""
"A common problem when debugging a curses application is to get your terminal "
"messed up when the application dies without restoring the terminal to its "
"previous state. In Python this commonly happens when your code is buggy and "
"raises an uncaught exception. Keys are no longer echoed to the screen when "
"you type them, for example, which makes using the shell difficult."
msgstr
""
"curses アプリケーションのデバッグでよくある問題は、端末の状態を復元する前にア"
"プリケーションが終了し、端末がおかしな状態のままになることです。\n"
"Python では、コードのバグで例外が発生し、それが捕捉されなかった場合によく起こ"
"ります。\n"
"例えば、入力したキーが画面に表示されなくなり、シェルを使いにくくなります。"
#:
../../howto/curses.rst:131
msgid
""
"In Python you can avoid these complications and make debugging much easier "
"by importing the :func:`curses.wrapper` function and using it like this::"
msgstr
""
"Pythonでは、これらの複雑さを避けデバッグをより容易にするために、 :func:"
"`curses.wrapper` 関数をインポートして、このように使います::"
msgid
""
"from curses import wrapper\n"
"\n"
"def main(stdscr):\n"
" # Clear screen\n"
" stdscr.clear()\n"
"\n"
" # This raises ZeroDivisionError when i == 10.\n"
" for i in range(0, 11):\n"
" v = i-10\n"
" stdscr.addstr(i, 0, '10 divided by {} is {}'.format(v, 10/v))\n"
"\n"
" stdscr.refresh()\n"
" stdscr.getkey()\n"
"\n"
"wrapper(main)"
msgstr
""
"from curses import wrapper\n"
"\n"
"def main(stdscr):\n"
" # 画面を消去する\n"
" stdscr.clear()\n"
"\n"
" # i == 10 のとき ZeroDivisionError が発生する。\n"
" for i in range(0, 11):\n"
" v = i-10\n"
" stdscr.addstr(i, 0, '10 divided by {} is {}'.format(v, 10/v))\n"
"\n"
" stdscr.refresh()\n"
" stdscr.getkey()\n"
"\n"
"wrapper(main)"
msgid
""
"The :func:`~curses.wrapper` function takes a callable object and does the "
"initializations described above, also initializing colors if color support "
"is present. :func:`!wrapper` then runs your provided callable. Once the "
"callable returns, :func:`!wrapper` will restore the original state of the "
"terminal. The callable is called inside a :keyword:`try`...
\\
:keyword:"
"`except` that catches exceptions, restores the state of the terminal, and "
"then re-raises the exception. Therefore your terminal won't be left in a "
"funny state on exception and you'll be able to read the exception's message "
"and traceback."
msgstr
""
":func:`~curses.wrapper` 関数は呼び出し可能オブジェクトを受け取り、上記の初期"
"化を行います。\n"
"色がサポートされていれば、色の初期化も行います。\n"
"その後、:func:`!wrapper` は渡された呼び出し可能オブジェクトを実行します。\n"
"その呼び出しから戻ると、:func:`!wrapper` は端末をもとの状態に戻します。\n"
"呼び出しは :keyword:`try`...
\\
:keyword:`except` の中で行われ、例外が発生する"
"と、それを捕捉して端末の状態を復元してから再送出します。\n"
"そのため、例外が発生しても端末が異常な状態のままにならず、例外のメッセージや"
"トレースバックを読めます。"
#:
../../howto/curses.rst:164
msgid
"Windows and Pads"
msgstr
"ウィンドウとパッド"
msgid
""
"Windows are the basic abstraction in curses. A window object represents a "
"rectangular area of the screen, and supports methods to display text, erase "
"it, allow the user to input strings, and so forth."
msgstr
""
"curses の基本となる抽象化はウィンドウです。\n"
"ウィンドウオブジェクトは画面上の長方形の領域を表し、テキストの表示や消去、利"
"用者による文字列の入力などのメソッドを備えています。"
msgid
""
"The ``stdscr`` object returned by the :func:`~curses.initscr` function is a "
"window object that covers the entire screen. Many programs may need only "
"this single window, but you might wish to divide the screen into smaller "
"windows, in order to redraw or clear them separately. The :func:`~curses."
"newwin` function creates a new window of a given size, returning the new "
"window object. ::"
msgstr
""
":func:`~curses.initscr` 関数が返す ``stdscr`` オブジェクトは、画面全体を覆う"
"ウィンドウオブジェクトです。\n"
"多くのプログラムはこのウィンドウだけで十分ですが、個別に再描画や消去を行うた"
"めに、画面を小さなウィンドウに分けたい場合もあるでしょう。\n"
":func:`~curses.newwin` 関数は、指定されたサイズの新しいウィンドウを作り、その"
"ウィンドウオブジェクトを返します。 ::"
msgid
""
"begin_x = 20; begin_y = 7\n"
"height = 5; width = 40\n"
"win = curses.newwin(height, width, begin_y, begin_x)"
msgstr
""
"begin_x = 20; begin_y = 7\n"
"height = 5; width = 40\n"
"win = curses.newwin(height, width, begin_y, begin_x)"
msgid
""
"Note that the coordinate system used in curses is unusual. Coordinates are "
"always passed in the order *y,x*, and the top-left corner of a window is "
"coordinate (0,0). This breaks the normal convention for handling "
"coordinates where the *x* coordinate comes first. This is an unfortunate "
"difference from most other computer applications, but it's been part of "
"curses since it was first written, and it's too late to change things now."
msgstr
""
"curses の座標系は独特なので注意してください。\n"
"座標は常に *y,x* の順に渡し、ウィンドウの左上隅が (0,0) です。\n"
"これは *x* 座標を先にする通常の慣習と異なります。\n"
"ほかの多くのアプリケーションと違うのは残念ですが、curses の最初の実装からこの"
"方式なので、今から変更するには遅すぎます。"
msgid
""
"Your application can determine the size of the screen by using the :data:"
"`curses.LINES` and :data:`curses.COLS` variables to obtain the *y* and *x* "
"sizes. Legal coordinates will then extend from ``(0,0)`` to ``(curses.LINES "
"- 1, curses.COLS - 1)``."
msgstr
""
"画面のサイズは、:data:`curses.LINES` と :data:`curses.COLS` 変数からそれぞれ "
"*y* 方向と *x* 方向の大きさを取得して調べられます。\n"
"有効な座標の範囲は ``(0,0)`` から ``(curses.LINES - 1, curses.COLS - 1)`` ま"
"でです。"
msgid
""
"When you call a method to display or erase text, the effect doesn't "
"immediately show up on the display. Instead you must call the :meth:"
"`~curses.window.refresh` method of window objects to update the screen."
msgstr
""
"テキストを表示または消去するメソッドを呼び出しても、その結果はすぐには画面に"
"現れません。\n"
"画面を更新するには、ウィンドウオブジェクトの :meth:`~curses.window.refresh` "
"メソッドを呼び出す必要があります。"
msgid
""
"This is because curses was originally written with slow 300-baud terminal "
"connections in mind; with these terminals, minimizing the time required to "
"redraw the screen was very important. Instead curses accumulates changes to "
"the screen and displays them in the most efficient manner when you call :"
"meth:`!refresh`. For example, if your program displays some text in a "
"window and then clears the window, there's no need to send the original text "
"because they're never visible."
msgstr
""
"これは、curses が当初、300 ボーという低速な端末接続を想定して書かれたためで"
"す。\n"
"そのような端末では、画面の再描画にかかる時間を最小限にすることが非常に重要で"
"した。\n"
"そこで curses は画面への変更を蓄積し、:meth:`!refresh` が呼ばれたときに最も効"
"率的な方法で表示します。\n"
"例えば、プログラムがウィンドウにテキストを表示してからそのウィンドウを消去し"
"た場合、テキストは実際には表示されないので、端末へ送る必要がありません。"
msgid
""
"In practice, explicitly telling curses to redraw a window doesn't really "
"complicate programming with curses much. Most programs go into a flurry of "
"activity, and then pause waiting for a keypress or some other action on the "
"part of the user. All you have to do is to be sure that the screen has been "
"redrawn before pausing to wait for user input, by first calling :meth:`!"
"stdscr.refresh` or the :meth:`!refresh` method of some other relevant window."
msgstr
""
"実際には、ウィンドウの再描画を明示的に指示しても、curses のプログラミングはそ"
"れほど複雑になりません。\n"
"多くのプログラムは一連の処理を行った後、キー入力などの利用者の操作を待って休"
"止します。\n"
"入力待ちに入る前に :meth:`!stdscr.refresh` または必要なほかのウィンドウの :"
"meth:`!refresh` を呼び出し、画面を再描画しておけばよいのです。"
msgid
""
"A pad is a special case of a window; it can be larger than the actual "
"display screen, and only a portion of the pad displayed at a time. Creating "
"a pad requires the pad's height and width, while refreshing a pad requires "
"giving the coordinates of the on-screen area where a subsection of the pad "
"will be displayed. ::"
msgstr
""
"パッドは特殊なウィンドウです。\n"
"実際の画面より大きくでき、一度に表示するのはその一部だけです。\n"
"作成時にはパッドの高さと幅を指定し、更新時にはパッドの一部を表示する画面上の"
"領域の座標を指定します。 ::"
msgid
""
"pad = curses.newpad(100, 100)\n"
"# These loops fill the pad with letters; addch() is\n"
"# explained in the next section\n"
"for y in range(0, 99):\n"
" for x in range(0, 99):\n"
" pad.addch(y,x, ord('a') + (x*x+y*y) % 26)\n"
"\n"
"# Displays a section of the pad in the middle of the screen.\n"
"# (0,0) : coordinate of upper-left corner of pad area to display.\n"
"# (5,5) : coordinate of upper-left corner of window area to be filled\n"
"# with pad content.\n"
"# (20, 75) : coordinate of lower-right corner of window area to be\n"
"# : filled with pad content.\n"
"pad.refresh( 0,0, 5,5, 20,75)"
msgstr
""
"pad = curses.newpad(100, 100)\n"
"# このループでパッドを文字で埋める。addch() は\n"
"# 次の節で説明する。\n"
"for y in range(0, 99):\n"
" for x in range(0, 99):\n"
" pad.addch(y,x, ord('a') + (x*x+y*y) % 26)\n"
"\n"
"# 画面中央にパッドの一部を表示する。\n"
"# (0,0) : 表示するパッド領域の左上隅の座標。\n"
"# (5,5) : パッドの内容を表示するウィンドウ領域の\n"
"# 左上隅の座標。\n"
"# (20, 75) : パッドの内容を表示するウィンドウ領域の\n"
"# : 右下隅の座標。\n"
"pad.refresh( 0,0, 5,5, 20,75)"
msgid
""
"The :meth:`!refresh` call displays a section of the pad in the rectangle "
"extending from coordinate (5,5) to coordinate (20,75) on the screen; the "
"upper left corner of the displayed section is coordinate (0,0) on the pad. "
"Beyond that difference, pads are exactly like ordinary windows and support "
"the same methods."
msgstr
""
":meth:`!refresh` の呼び出しは、画面上の座標 (5,5) から (20,75) までの長方形"
"に、パッドの一部を表示します。\n"
"表示する部分の左上隅は、パッド上の座標 (0,0) です。\n"
"この点以外は、パッドは通常のウィンドウとまったく同じで、同じメソッドを使えま"
"す。"
msgid
""
"If you have multiple windows and pads on screen there is a more efficient "
"way to update the screen and prevent annoying screen flicker as each part of "
"the screen gets updated. :meth:`!refresh` actually does two things:"
msgstr
""
"画面上に複数のウィンドウやパッドがある場合は、各部分の更新に伴うちらつきを防"
"ぎ、画面をより効率的に更新する方法があります。\n"
":meth:`!refresh` は実際には次の 2 つの処理を行っています。"
msgid
""
"Calls the :meth:`~curses.window.noutrefresh` method of each window to update "
"an underlying data structure representing the desired state of the screen."
msgstr
""
"それぞれのウィンドウの :meth:`~curses.window.noutrefresh` メソッドを呼び出し"
"て、配下にある、スクリーンの望ましい状態を表すデータ構造を更新します。"
#:
../../howto/curses.rst:251
msgid
""
"Calls the function :func:`~curses.doupdate` function to change the physical "
"screen to match the desired state recorded in the data structure."
msgstr
""
":func:`~curses.doupdate` 関数を呼び出して、データ構造に記録された望ましい状態"
"に合致するように、物理スクリーンを更新します。"
msgid
""
"Instead you can call :meth:`!noutrefresh` on a number of windows to update "
"the data structure, and then call :func:`!doupdate` to update the screen."
msgstr
""
"代わりに、複数のウィンドウで :meth:`!noutrefresh` を呼んでデータ構造を更新"
"し、その後 :func:`!doupdate` を呼んで画面を更新できます。"
#:
../../howto/curses.rst:260
msgid
"Displaying Text"
msgstr
"テキストの表示"
msgid
""
"From a C programmer's point of view, curses may sometimes look like a twisty "
"maze of functions, all subtly different. For example, :c:func:`!addstr` "
"displays a string at the current cursor location in the ``stdscr`` window, "
"while :c:func:`!mvaddstr` moves to a given y,x coordinate first before "
"displaying the string. :c:func:`!waddstr` is just like :c:func:`!addstr`, "
"but allows specifying a window to use instead of using ``stdscr`` by "
"default. :c:func:`!mvwaddstr` allows specifying both a window and a "
"coordinate."
msgstr
""
"C プログラマから見ると、curses は少しずつ異なる関数が入り組んだ迷路のように見"
"えることがあります。\n"
"例えば、:c:func:`!addstr` は ``stdscr`` ウィンドウの現在のカーソル位置に文字"
"列を表示し、:c:func:`!mvaddstr` は先に指定された y,x 座標へ移動してから表示し"
"ます。\n"
":c:func:`!waddstr` は :c:func:`!addstr` と同様ですが、デフォルトの "
"``stdscr`` の代わりに、使うウィンドウを指定できます。\n"
":c:func:`!mvwaddstr` ではウィンドウと座標の両方を指定できます。"
#:
../../howto/curses.rst:271
msgid
""
"Fortunately the Python interface hides all these details. ``stdscr`` is a "
"window object like any other, and methods such as :meth:`~curses.window."
"addstr` accept multiple argument forms. Usually there are four different "
"forms."
msgstr
""
"幸運にも、Python インターフェースはこれらの詳細を全て隠蔽してくれます。 "
"``stdscr`` は他のものと同様のウィンドウオブジェクトであり、 :meth:`~curses."
"window.addstr` のようなメソッドは複数の引数形式を許容してくれます。通常それら"
"は4つの形式です。"
#:
../../howto/curses.rst:277
msgid
"Form"
msgstr
"形式"
#:
../../howto/curses.rst:277
../../howto/curses.rst:348
msgid
"Description"
msgstr
"説明"
#:
../../howto/curses.rst:279
msgid
"*str* or *ch*"
msgstr
"*str* または *ch*"
#:
../../howto/curses.rst:279
msgid
"Display the string *str* or character *ch* at the current position"
msgstr
"文字列 *str* または文字 *ch* を現在位置に表示します"
#:
../../howto/curses.rst:282
msgid
"*str* or *ch*, *attr*"
msgstr
"*str* または *ch*, *attr*"
#:
../../howto/curses.rst:282
msgid
""
"Display the string *str* or character *ch*, using attribute *attr* at the "
"current position"
msgstr
""
"文字列 *str* または文字 *ch* を属性 *attr* を利用して現在位置に表示します"
#:
../../howto/curses.rst:286
msgid
"*y*, *x*, *str* or *ch*"
msgstr
"*y*, *x*, *str* または *ch*"
#:
../../howto/curses.rst:286
msgid
"Move to position *y,x* within the window, and display *str* or *ch*"
msgstr
"ウィンドウ内の位置 *y,x* に移動し *str* または *ch* を表示します"
#:
../../howto/curses.rst:289
msgid
"*y*, *x*, *str* or *ch*, *attr*"
msgstr
"*y*, *x*, *str* または *ch*, *attr*"
#:
../../howto/curses.rst:289
msgid
""
"Move to position *y,x* within the window, and display *str* or *ch*, using "
"attribute *attr*"
msgstr
""
"ウィンドウ内の位置 *y,x* に移動し属性 *attr* を利用して *str* または *ch* を"
"表示します"
#:
../../howto/curses.rst:293
msgid
""
"Attributes allow displaying text in highlighted forms such as boldface, "
"underline, reverse code, or in color. They'll be explained in more detail "
"in the next subsection."
msgstr
""
"属性によって表示するテキストをハイライトすることができます、ボールド体、アン"
"ダーライン、反転、カラーなど。より詳しくは次の小節で説明します。"
msgid
""
"The :meth:`~curses.window.addstr` method takes a Python string or bytestring "
"as the value to be displayed. The contents of bytestrings are sent to the "
"terminal as-is. On a build without wide-character support strings are "
"encoded using the value of the window's :attr:`~window.encoding` attribute; "
"this defaults to the default system encoding as returned by :func:`locale."
"getencoding`."
msgstr
""
":meth:`~curses.window.addstr` メソッドは、表示する値として Python の文字列ま"
"たはバイト列を受け取ります。\n"
"バイト列の内容はそのまま端末へ送られます。\n"
"ワイド文字に対応していないビルドでは、文字列はウィンドウの :attr:`~window."
"encoding` 属性の値でエンコードされます。\n"
"この属性のデフォルト値は、:func:`locale.getencoding` が返すシステムのデフォル"
"トエンコーディングです。"
msgid
""
"The :meth:`~curses.window.addch` methods take a character, which can be "
"either a string of length 1, a bytestring of length 1, or an integer."
msgstr
""
":meth:`~curses.window.addch` メソッドは文字を受け取ります。\n"
"文字は、長さ 1 の文字列、長さ 1 のバイト列、または整数で指定できます。"
msgid
""
"Constants are provided for the characters of the terminal's alternate "
"character set. For example, :const:`ACS_PLMINUS` is a +/- symbol, and :const:"
"`ACS_ULCORNER` is the upper left corner of a box (handy for drawing "
"borders). You can also use the appropriate Unicode character."
msgstr
""
"端末の代替文字集合の文字に対応する定数が用意されています。\n"
"例えば、:const:`ACS_PLMINUS` は +/- 記号、:const:`ACS_ULCORNER` は枠の左上隅"
"で、罫線を描くのに便利です。\n"
"対応する Unicode 文字を使うこともできます。"
msgid
""
"Windows remember where the cursor was left after the last operation, so if "
"you leave out the *y,x* coordinates, the string or character will be "
"displayed wherever the last operation left off. You can also move the "
"cursor with the ``move(y,x)`` method. Because some terminals always display "
"a flashing cursor, you may want to ensure that the cursor is positioned in "
"some location where it won't be distracting; it can be confusing to have the "
"cursor blinking at some apparently random location."
msgstr
""
"ウィンドウは最後の操作後のカーソル位置を覚えているので、*y,x* 座標を省略する"
"と、文字列や文字は直前の操作でカーソルが残った位置に表示されます。\n"
"``move(y,x)`` メソッドでカーソルを移動することもできます。\n"
"常に点滅するカーソルを表示する端末もあるので、邪魔にならない位置にカーソルを"
"置くとよいでしょう。\n"
"無関係に見える場所でカーソルが点滅すると、混乱を招くことがあります。"
msgid
""
"If your application doesn't need a blinking cursor at all, you can call "
"``curs_set(False)`` to make it invisible. The window method :meth:`~curses."
"window.leaveok` does something different: when its argument is true, curses "
"leaves the cursor wherever the last update put it, instead of moving it back "
"to the window's cursor position."
msgstr
""
"アプリケーションで点滅するカーソルがまったく必要なければ、"
"``curs_set(False)`` を呼んで非表示にできます。\n"
"ウィンドウの :meth:`~curses.window.leaveok` メソッドは、それとは異なる働きを"
"します。\n"
"引数が真の場合、curses はカーソルをウィンドウのカーソル位置に戻さず、最後の更"
"新で移動した位置に残します。"
#:
../../howto/curses.rst:333
msgid
"Attributes and Color"
msgstr
"属性とカラー"
msgid
""
"Characters can be displayed in different ways. Status lines in a text-based "
"application are commonly shown in reverse video, or a text viewer may need "
"to highlight certain words. curses supports this by allowing you to specify "
"an attribute for each cell on the screen."
msgstr
""
"文字にはさまざまな表示方法があります。\n"
"テキストベースのアプリケーションではステータス行を反転表示することが多く、テ"
"キストビューアでは特定の単語を強調表示したい場合があります。\n"
"curses では画面上の各セルに属性を指定して、これらを実現できます。"
#:
../../howto/curses.rst:340
msgid
""
"An attribute is an integer, each bit representing a different attribute. "
"You can try to display text with multiple attribute bits set, but curses "
"doesn't guarantee that all the possible combinations are available, or that "
"they're all visually distinct. That depends on the ability of the terminal "
"being used, so it's safest to stick to the most commonly available "
"attributes, listed here."
msgstr
""
"属性は整数値で、それぞれのビットが異なる属性を表わします。複数の属性ビットを"
"セットしてテキストの表示を試みることができますが、curses は全ての組み合わせが"
"利用可能であるかや視覚的に区別できるかどうかは保証してくれません、それらは利"
"用している端末の能力に依存しているため、最も安全なのは、最も一般的に利用可能"
"な属性を設定する方法です、ここに列挙します。"
#:
../../howto/curses.rst:348
msgid
"Attribute"
msgstr
"属性"
#:
../../howto/curses.rst:350
msgid
":const:`A_BLINK`"
msgstr
":const:`A_BLINK`"
#:
../../howto/curses.rst:350
msgid
"Blinking text"
msgstr
"テキストを点滅"
#:
../../howto/curses.rst:352
msgid
":const:`A_BOLD`"
msgstr
":const:`A_BOLD`"
#:
../../howto/curses.rst:352
msgid
"Extra bright or bold text"
msgstr
"高輝度またはボールドテキスト"
#:
../../howto/curses.rst:354
msgid
":const:`A_DIM`"
msgstr
":const:`A_DIM`"
#:
../../howto/curses.rst:354
msgid
"Half bright text"
msgstr
"低輝度テキスト"
#:
../../howto/curses.rst:356
msgid
":const:`A_REVERSE`"
msgstr
":const:`A_REVERSE`"
#:
../../howto/curses.rst:356
msgid
"Reverse-video text"
msgstr
"反転テキスト"
#:
../../howto/curses.rst:358
msgid
":const:`A_STANDOUT`"
msgstr
":const:`A_STANDOUT`"
#:
../../howto/curses.rst:358
msgid
"The best highlighting mode available"
msgstr
"利用できる最良のハイライトモード"
#:
../../howto/curses.rst:360
msgid
":const:`A_UNDERLINE`"
msgstr
":const:`A_UNDERLINE`"
#:
../../howto/curses.rst:360
msgid
"Underlined text"
msgstr
"下線付きテキスト"
#:
../../howto/curses.rst:363
msgid
""
"So, to display a reverse-video status line on the top line of the screen, "
"you could code::"
msgstr
""
"つまり、反転するステータスラインを画面の最上部に表示するには、コードをこうし"
"ます::"
msgid
""
"stdscr.addstr(0, 0,
\"
Current mode: Typing mode
\"
,\n"
" curses.A_REVERSE)\n"
"stdscr.refresh()"
msgstr
""
"stdscr.addstr(0, 0,
\"
Current mode: Typing mode
\"
,\n"
" curses.A_REVERSE)\n"
"stdscr.refresh()"
#:
../../howto/curses.rst:370
msgid
""
"The curses library also supports color on those terminals that provide it. "
"The most common such terminal is probably the Linux console, followed by "
"color xterms."
msgstr
""
"curses ライブラリはカラー機能を提供している端末でのカラーもサポートしていま"
"す。そんな端末の中で最も一般的なものは Linux コンソールで、color xterm もそれ"
"に続きます。"
msgid
""
"To use color, you must call the :func:`~curses.start_color` function soon "
"after calling :func:`~curses.initscr`, to initialize the default color set "
"(the :func:`curses.wrapper` function does this automatically). Once that's "
"done, the :func:`~curses.has_colors` function returns TRUE if the terminal "
"in use can actually display color. (Note: curses uses the American spelling "
"'color', instead of the Canadian/British spelling 'colour'. If you're used "
"to the British spelling, you'll have to resign yourself to misspelling it "
"for the sake of these functions.)"
msgstr
""
"色を使うには、:func:`~curses.initscr` の直後に :func:`~curses.start_color` を"
"呼び出し、デフォルトの色を初期化する必要があります (:func:`curses.wrapper` は"
"これを自動的に行います)。\n"
"初期化後、使用中の端末が実際にカラー表示に対応していれば、:func:`~curses."
"has_colors` は真を返します。\n"
"なお、curses はカナダやイギリスの綴り colour ではなく、アメリカの綴り color "
"を使います。\n"
"イギリス式の綴りに慣れている方も、これらの関数では「綴り間違い」を我慢してく"
"ださい。"
msgid
""
"The curses library maintains a finite number of color pairs, containing a "
"foreground (or text) color and a background color. You can get the "
"attribute value corresponding to a color pair with the :func:`~curses."
"color_pair` function; this can be bitwise-OR'ed with other attributes such "
"as :const:`A_REVERSE`, but again, such combinations are not guaranteed to "
"work on all terminals."
msgstr
""
"curses ライブラリは、前景色 (文字の色) と背景色からなる有限個のカラーペアを管"
"理します。\n"
":func:`~curses.color_pair` 関数で、カラーペアに対応する属性値を取得できま"
"す。\n"
"この値は :const:`A_REVERSE` などのほかの属性とビット単位の OR で組み合わせら"
"れますが、その組み合わせがすべての端末で動くとは限りません。"
#:
../../howto/curses.rst:391
msgid
"An example, which displays a line of text using color pair 1::"
msgstr
"例として、テキスト行をカラーペア 1 を使って表示します::"
msgid
""
"stdscr.addstr(
\"
Pretty text
\"
, curses.color_pair(1))\n"
"stdscr.refresh()"
msgstr
""
"stdscr.addstr(
\"
Pretty text
\"
, curses.color_pair(1))\n"
"stdscr.refresh()"
#:
../../howto/curses.rst:396
msgid
""
"As I said before, a color pair consists of a foreground and background "
"color. The ``init_pair(n, f, b)`` function changes the definition of color "
"pair *n*, to foreground color f and background color b. Color pair 0 is "
"hard-wired to white on black, and cannot be changed."
msgstr
""
msgid
""
"Colors are numbered, and :func:`start_color` initializes 8 basic colors when "
"it activates color mode. They are: 0:black, 1:red, 2:green, 3:yellow, 4:"
"blue, 5:magenta, 6:cyan, and 7:white. The :mod:`curses` module defines "
"named constants for each of these colors: :const:`curses.COLOR_BLACK`, :"
"const:`curses.COLOR_RED`, and so forth."
msgstr
""
"色には番号が付いており、:func:`start_color` はカラーモードを有効にするときに "
"8 つの基本色を初期化します。\n"
"0 は黒、1 は赤、2 は緑、3 は黄、4 は青、5 はマゼンタ、6 はシアン、7 は白で"
"す。\n"
":mod:`curses` モジュールは各色に :const:`curses.COLOR_BLACK`、:const:`curses."
"COLOR_RED` などの定数を定義しています。"
#:
../../howto/curses.rst:407
msgid
""
"Let's put all this together. To change color 1 to red text on a white "
"background, you would call::"
msgstr
""
"やってみましょう。カラー 1 を白背景に赤に変更してみましょう、こうして呼び出し"
"ます::"
msgid
"curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)"
msgstr
"curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)"
msgid
""
"When you change a color pair, any text already displayed using that color "
"pair will change to the new colors. You can also display new text in this "
"color with::"
msgstr
""
"カラーペアを変更すると、そのペアを使って既に表示されているテキストも新しい色"
"になります。\n"
"次のように、その色で新たなテキストを表示することもできます。 ::"
msgid
"stdscr.addstr(0,0,
\"
RED ALERT!
\"
, curses.color_pair(1))"
msgstr
"stdscr.addstr(0,0,
\"
RED ALERT!
\"
, curses.color_pair(1))"
#:
../../howto/curses.rst:418
msgid
""
"Very fancy terminals can change the definitions of the actual colors to a "
"given RGB value. This lets you change color 1, which is usually red, to "
"purple or blue or any other color you like. Unfortunately, the Linux "
"console doesn't support this, so I'm unable to try it out, and can't provide "
"any examples. You can check if your terminal can do this by calling :func:"
"`~curses.can_change_color`, which returns ``True`` if the capability is "
"there. If you're lucky enough to have such a talented terminal, consult "
"your system's man pages for more information."
msgstr
""
#:
../../howto/curses.rst:429
msgid
"User Input"
msgstr
"ユーザ入力"
msgid
""
"The C curses library offers only very simple input mechanisms. Python's :mod:"
"`curses` module adds a basic text-input widget. (Other libraries such as :"
"pypi:`Urwid` have more extensive collections of widgets.)"
msgstr
""
"C の curses ライブラリが提供する入力機能は、ごく単純なものだけです。\n"
"Python の :mod:`curses` モジュールは、基本的なテキスト入力ウィジェットを追加"
"しています。\n"
"(:pypi:`Urwid` などのほかのライブラリには、より豊富なウィジェットがありま"
"す。)"
msgid
"There are three methods for getting input from a window:"
msgstr
"ウィンドウから入力を取得するメソッドは 3 つあります。"
msgid
""
":meth:`~curses.window.get_wch` refreshes the screen and then waits for the "
"user to hit a key, displaying the key if :func:`~curses.echo` has been "
"called earlier. You can optionally specify a coordinate to which the cursor "
"should be moved before pausing."
msgstr
""
":meth:`~curses.window.get_wch` は画面を更新してから、利用者のキー入力を待ちま"
"す。\n"
"事前に :func:`~curses.echo` が呼ばれていれば、入力されたキーを表示します。\n"
"待機する前にカーソルを移動する座標を指定することもできます。"
msgid
""
":meth:`~curses.window.getch` does the same thing but returns the code of the "
"key instead of a character. With ncurses this is a single byte of the key's "
"encoding in the current locale, so a character encoded with several bytes "
"takes several calls, one byte per call."
msgstr
""
":meth:`~curses.window.getch` は同じ処理をしますが、文字の代わりにキーのコード"
"を返します。\n"
"ncurses では、これは現在のロケールでエンコードされたキーの 1 バイトなので、複"
"数バイトの文字を読むには、1 回に 1 バイトずつ複数回呼び出す必要があります。"
msgid
""
":meth:`~curses.window.getkey` does the same as :meth:`!getch` but returns a "
"string: an ordinary key as a 1-character string, and a special key as its "
"name, such as ``KEY_UP``."
msgstr
""
":meth:`~curses.window.getkey` は :meth:`!getch` と同じ処理をしますが、文字列"
"を返します。\n"
"通常のキーは 1 文字の文字列、特殊キーは ``KEY_UP`` のような名前になります。"
msgid
""
"It's possible to not wait for the user using the :meth:`~curses.window."
"nodelay` window method. After ``nodelay(True)``, the reads for the window "
"become non-blocking. To signal that no input is ready, :meth:`!get_wch` and :"
"meth:`!getkey` raise an exception, and :meth:`!getch` returns ``-1``. "
"There's also a :func:`~curses.halfdelay` function, which can be used to (in "
"effect) set a timer on each read; if no input becomes available within a "
"specified delay (measured in tenths of a second), the read fails the same "
"way."
msgstr
""
"ウィンドウの :meth:`~curses.window.nodelay` メソッドを使うと、利用者の入力を"
"待たずに済むようにできます。\n"
"``nodelay(True)`` の後は、そのウィンドウの読み取りはノンブロッキングになりま"
"す。\n"
"入力がない場合、:meth:`!get_wch` と :meth:`!getkey` は例外を送出し、:meth:`!"
"getch` は ``-1`` を返します。\n"
"また、:func:`~curses.halfdelay` を使うと、実質的に各読み取りにタイマーを設定"
"できます。\n"
"指定した待ち時間 (0.1 秒単位) 内に入力がなければ、読み取りは同じように失敗し"
"ます。"
#:
../../howto/curses.rst:464
msgid
""
"Special keys such as Page Up, Home, or the cursor keys are returned by all "
"three as one of the :ref:`KEY_* constants <curses-key-constants>`, all "
"larger than 255. You can compare the value returned to constants such as :"
"const:`curses.KEY_PPAGE`, :const:`curses.KEY_HOME`, or :const:`curses."
"KEY_LEFT`. The main loop of your program may look something like this::"
msgstr
""
msgid
""
"while True:\n"
" c = stdscr.get_wch()\n"
" if c == 'p':\n"
" PrintDocument()\n"
" elif c == 'q':\n"
" break # Exit the while loop\n"
" elif c == curses.KEY_HOME:\n"
" x = y = 0"
msgstr
""
"while True:\n"
" c = stdscr.get_wch()\n"
" if c == 'p':\n"
" PrintDocument()\n"
" elif c == 'q':\n"
" break # while ループを抜ける\n"
" elif c == curses.KEY_HOME:\n"
" x = y = 0"
msgid
""
"The :mod:`curses.ascii` module supplies ASCII class membership functions "
"that take either integer or 1-character string arguments; these may be "
"useful in writing more readable tests for such loops. It also supplies "
"conversion functions that take either integer or 1-character-string "
"arguments and return the same type. For example, :func:`curses.ascii.ctrl` "
"returns the control character corresponding to its argument."
View remainder of file in raw view
Back
|
FazBrowse Home
|
New Git URL