FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-docs-de/faq/library.po at sync-upstream-3.15 · python/python-docs-de · GitHub
python
python-docs-de
Repository navigation
Code
Issues
Pull requests
2
(2)
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
python-docs-de
/
faq
/
library.po
Copy path
More file actions
More file actions
Latest commit
History
History
History
1469 lines (1316 loc) · 58.2 KB
Breadcrumbs
python-docs-de
/
faq
/
library.po
Copy path
File metadata and controls
1469 lines (1316 loc) · 58.2 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
#
German translation of the Python documentation.
#
Copyright (C) 2001 Python Software Foundation
#
This file is distributed under the same license as the Python package.
#
#
Translators:
#
python-doc bot, 2025
#
Swen Bachmann, 2026
#
msgid ""
msgstr ""
"
Project-Id-Version
:
Python 3.15\n
"
"
Report-Msgid-Bugs-To
:
\n
"
"
POT-Creation-Date
:
2026-08-22 12:07+0200\n
"
"
PO-Revision-Date
:
2026-10-19 22:45+0200\n
"
"
Last-Translator
:
python-doc bot, 2025\n
"
"
Language-Team
:
German (https://github.com/python/python-docs-de)\n
"
"
Language
:
de\n
"
"
MIME-Version
:
1.0\n
"
"
Content-Type
:
text/plain; charset=UTF-8\n
"
"
Content-Transfer-Encoding
:
8bit\n
"
"
Plural-Forms
:
nplurals=2; plural=(n != 1);\n
"
#:
../../faq/library.rst:5
msgid
"Library and Extension FAQ"
msgstr
"FAQ zu Bibliothek und Erweiterungen"
#:
../../faq/library.rst:8
msgid
"Contents"
msgstr
"Inhalt"
#:
../../faq/library.rst:12
msgid
"General Library Questions"
msgstr
"Allgemeine Fragen zur Bibliothek"
#:
../../faq/library.rst:15
msgid
"How do I find a module or application to perform task X?"
msgstr
"Wie finde ich ein Modul oder eine Anwendung für Aufgabe X?"
#:
../../faq/library.rst:17
msgid
""
"Check :ref:`the Library Reference <library-index>` to see if there's a "
"relevant standard library module. (Eventually you'll learn what's in the "
"standard library and will be able to skip this step.)"
msgstr
""
"Sieh in :ref:`der Bibliotheksreferenz <library-index>` nach, ob es ein "
"passendes Modul der Standardbibliothek gibt. (Irgendwann weißt du, was in "
"der Standardbibliothek steckt, und kannst diesen Schritt überspringen.)"
#:
../../faq/library.rst:21
msgid
""
"For third-party packages, search the `Python Package Index <https://pypi."
"org>`_ or try `Google <https://www.google.com>`_ or another web search "
"engine. Searching for
\"
Python
\"
plus a keyword or two for your topic of "
"interest will usually find something helpful."
msgstr
""
"Für Pakete von Dritten suche im `Python Package Index <https://pypi.org>`_ "
"oder versuche es mit `Google <https://www.google.com>`_ oder einer anderen "
"Suchmaschine. Nach „Python“ plus einem oder zwei Stichwörtern zu deinem "
"Thema zu suchen findet meist etwas Hilfreiches."
#:
../../faq/library.rst:28
msgid
"Where is the math.py (socket.py, regex.py, etc.) source file?"
msgstr
"Wo ist die Quelldatei math.py (socket.py, regex.py und so weiter)?"
#:
../../faq/library.rst:30
msgid
""
"If you can't find a source file for a module it may be a built-in or "
"dynamically loaded module implemented in C, C++ or other compiled language. "
"In this case you may not have the source file or it may be something like :"
"file:`mathmodule.c`, somewhere in a C source directory (not on the Python "
"Path)."
msgstr
""
"Findest du für ein Modul keine Quelldatei, ist es vielleicht ein "
"integriertes oder dynamisch geladenes Modul, das in C, C++ oder einer "
"anderen kompilierten Sprache umgesetzt ist. In diesem Fall hast du die "
"Quelldatei möglicherweise nicht, oder sie heißt etwa :file:`mathmodule.c` "
"und liegt irgendwo in einem C-Quellverzeichnis und nicht im Python-Pfad."
#:
../../faq/library.rst:35
msgid
"There are (at least) three kinds of modules in Python:"
msgstr
"Es gibt (mindestens) drei Arten von Modulen in Python:"
#:
../../faq/library.rst:37
msgid
"modules written in Python (.py);"
msgstr
"Module, die in Python geschrieben sind (.py);"
#:
../../faq/library.rst:38
msgid
""
"modules written in C and dynamically loaded (.dll, .pyd, .so, .sl, etc);"
msgstr
""
"Module, die in C geschrieben und dynamisch geladen werden (.dll, .pyd, .so, ."
"sl und so weiter);"
#:
../../faq/library.rst:39
msgid
""
"modules written in C and linked with the interpreter; to get a list of "
"these, type::"
msgstr
""
"Module, die in C geschrieben und mit dem Interpreter gebunden sind. Um eine "
"Liste davon zu bekommen, gib ein::"
#:
../../faq/library.rst:42
msgid
""
"import sys\n"
"print(sys.builtin_module_names)"
msgstr
""
"import sys\n"
"print(sys.builtin_module_names)"
#:
../../faq/library.rst:47
msgid
"How do I make a Python script executable on Unix?"
msgstr
"Wie mache ich ein Python-Skript unter Unix ausführbar?"
#:
../../faq/library.rst:49
msgid
""
"You need to do two things: the script file's mode must be executable and the "
"first line must begin with ``#!`` followed by the path of the Python "
"interpreter."
msgstr
""
"Du musst zwei Dinge tun: Der Modus der Skriptdatei muss ausführbar sein, und "
"die erste Zeile muss mit ``#!`` beginnen, gefolgt vom Pfad des Python-"
"Interpreters."
#:
../../faq/library.rst:53
msgid
""
"The first is done by executing ``chmod +x scriptfile`` or perhaps ``chmod "
"755 scriptfile``."
msgstr
""
"Das Erste erledigst du mit ``chmod +x scriptfile`` oder vielleicht ``chmod "
"755 scriptfile``."
#:
../../faq/library.rst:56
msgid
""
"The second can be done in a number of ways. The most straightforward way is "
"to write ::"
msgstr
"Das Zweite geht auf mehrere Weisen. Am geradlinigsten ist es, ::"
#:
../../faq/library.rst:59
msgid
"#!/usr/local/bin/python"
msgstr
"#!/usr/local/bin/python"
#:
../../faq/library.rst:61
msgid
""
"as the very first line of your file, using the pathname for where the Python "
"interpreter is installed on your platform."
msgstr
""
"als allererste Zeile deiner Datei zu schreiben, mit dem Pfadnamen, unter dem "
"der Python-Interpreter auf deiner Plattform installiert ist."
#:
../../faq/library.rst:64
msgid
""
"If you would like the script to be independent of where the Python "
"interpreter lives, you can use the :program:`env` program. Almost all Unix "
"variants support the following, assuming the Python interpreter is in a "
"directory on the user's :envvar:`PATH`::"
msgstr
""
"Soll das Skript unabhängig davon sein, wo der Python-Interpreter liegt, "
"kannst du das Programm :program:`env` verwenden. Fast alle Unix-Varianten "
"unterstützen das Folgende, sofern der Python-Interpreter in einem "
"Verzeichnis im :envvar:`PATH` des Benutzers liegt::"
#:
../../faq/library.rst:69
msgid
"#!/usr/bin/env python"
msgstr
"#!/usr/bin/env python"
#:
../../faq/library.rst:71
msgid
""
"*Don't* do this for CGI scripts. The :envvar:`PATH` variable for CGI "
"scripts is often very minimal, so you need to use the actual absolute "
"pathname of the interpreter."
msgstr
""
"Mach das *nicht* bei CGI-Skripten. Die Variable :envvar:`PATH` ist für CGI-"
"Skripte oft sehr knapp gehalten, du musst deshalb den tatsächlichen "
"absoluten Pfadnamen des Interpreters verwenden."
#:
../../faq/library.rst:75
msgid
""
"Occasionally, a user's environment is so full that the :program:`/usr/bin/"
"env` program fails; or there's no env program at all. In that case, you can "
"try the following hack (due to Alex Rezinsky):"
msgstr
""
"Gelegentlich ist die Umgebung eines Benutzers so voll, dass das Programm :"
"program:`/usr/bin/env` scheitert, oder es gibt überhaupt kein env-Programm. "
"In diesem Fall kannst du den folgenden Trick versuchen (von Alex Rezinsky):"
#:
../../faq/library.rst:79
msgid
""
"#! /bin/sh\n"
"
\"\"\"
:
\"
\n"
"exec python $0 ${1+
\"
$@
\"
}\n"
"
\"\"\"
"
msgstr
""
"#! /bin/sh\n"
"
\"\"\"
:
\"
\n"
"exec python $0 ${1+
\"
$@
\"
}\n"
"
\"\"\"
"
#:
../../faq/library.rst:86
msgid
""
"The minor disadvantage is that this defines the script's __doc__ string. "
"However, you can fix that by adding ::"
msgstr
""
"Der kleine Nachteil ist, dass dies die __doc__-Zeichenkette des Skripts "
"festlegt. Das kannst du aber beheben, indem du ::"
#:
../../faq/library.rst:89
msgid
"__doc__ =
\"\"\"
...Whatever...
\"\"\"
"
msgstr
"__doc__ =
\"\"\"
...Whatever...
\"\"\"
"
#:
../../faq/library.rst:94
msgid
"Is there a curses/termcap package for Python?"
msgstr
"Gibt es ein curses/termcap-Paket für Python?"
#:
../../faq/library.rst:98
msgid
""
"For Unix variants: The standard Python source distribution comes with a "
"curses module in the :source:`Modules` subdirectory, though it's not "
"compiled by default. (Note that this is not available in the Windows "
"distribution -- there is no curses module for Windows.)"
msgstr
""
"Für Unix-Varianten: Die Standard-Quellcode-Distribution von Python bringt im "
"Unterverzeichnis :source:`Modules` ein curses-Modul mit, das allerdings "
"nicht standardmäßig kompiliert wird. (Beachte, dass es in der Windows-"
"Distribution nicht verfügbar ist -- es gibt kein curses-Modul für Windows.)"
#:
../../faq/library.rst:103
msgid
""
"The :mod:`curses` module supports basic curses features as well as many "
"additional functions from ncurses and SYSV curses such as colour, "
"alternative character set support, pads, and mouse support. This means the "
"module isn't compatible with operating systems that only have BSD curses, "
"but there don't seem to be any currently maintained OSes that fall into this "
"category."
msgstr
""
"Das Modul :mod:`curses` unterstützt die grundlegenden curses-Funktionen "
"sowie viele zusätzliche Funktionen aus ncurses und SYSV-curses, etwa Farben, "
"alternative Zeichensätze, Pads und Mausunterstützung. Das bedeutet, dass das "
"Modul mit Betriebssystemen nicht kompatibel ist, die nur BSD-curses haben, "
"aber es scheint derzeit keine gepflegten Betriebssysteme zu geben, die in "
"diese Kategorie fallen."
#:
../../faq/library.rst:111
msgid
"Is there an equivalent to C's onexit() in Python?"
msgstr
"Gibt es in Python eine Entsprechung zu onexit() aus C?"
#:
../../faq/library.rst:113
msgid
""
"The :mod:`atexit` module provides a register function that is similar to "
"C's :c:func:`!onexit`."
msgstr
""
"Das Modul :mod:`atexit` stellt eine Funktion register bereit, die :c:func:`!"
"onexit` aus C ähnelt."
#:
../../faq/library.rst:118
msgid
"Why don't my signal handlers work?"
msgstr
"Warum funktionieren meine Signalbehandler nicht?"
#:
../../faq/library.rst:120
msgid
""
"The most common problem is that the signal handler is declared with the "
"wrong argument list. It is called as ::"
msgstr
""
"Das häufigste Problem ist, dass der Signalbehandler mit der falschen "
"Argumentliste deklariert ist. Er wird so aufgerufen: ::"
#:
../../faq/library.rst:123
msgid
"handler(signum, frame)"
msgstr
"handler(signum, frame)"
#:
../../faq/library.rst:125
msgid
"so it should be declared with two parameters::"
msgstr
"er sollte also mit zwei Parametern deklariert werden::"
#:
../../faq/library.rst:127
msgid
""
"def handler(signum, frame):\n"
" ..."
msgstr
""
"def handler(signum, frame):\n"
" ..."
#:
../../faq/library.rst:132
msgid
"Common tasks"
msgstr
"Häufige Aufgaben"
#:
../../faq/library.rst:135
msgid
"How do I test a Python program or component?"
msgstr
"Wie teste ich ein Python-Programm oder einen Bestandteil davon?"
#:
../../faq/library.rst:137
msgid
""
"Python comes with two testing frameworks. The :mod:`doctest` module finds "
"examples in the docstrings for a module and runs them, comparing the output "
"with the expected output given in the docstring."
msgstr
""
"Python bringt zwei Testframeworks mit. Das Modul :mod:`doctest` findet "
"Beispiele in den Docstrings eines Moduls und führt sie aus, wobei es die "
"Ausgabe mit der im Docstring angegebenen erwarteten Ausgabe vergleicht."
#:
../../faq/library.rst:141
msgid
""
"The :mod:`unittest` module is a fancier testing framework modelled on Java "
"and Smalltalk testing frameworks."
msgstr
""
"Das Modul :mod:`unittest` ist ein aufwendigeres Testframework, nachempfunden "
"den Testframeworks von Java und Smalltalk."
#:
../../faq/library.rst:144
msgid
""
"To make testing easier, you should use good modular design in your program. "
"Your program should have almost all functionality encapsulated in either "
"functions or class methods -- and this sometimes has the surprising and "
"delightful effect of making the program run faster (because local variable "
"accesses are faster than global accesses). Furthermore the program should "
"avoid depending on mutating global variables, since this makes testing much "
"more difficult to do."
msgstr
""
"Um das Testen zu erleichtern, solltest du in deinem Programm einen guten "
"modularen Entwurf verwenden. Dein Programm sollte fast alle Funktionalität "
"in Funktionen oder Klassenmethoden kapseln -- und das hat manchmal den "
"überraschenden und erfreulichen Effekt, dass das Programm schneller läuft, "
"weil Zugriffe auf lokale Variablen schneller sind als auf globale. Außerdem "
"sollte das Programm es vermeiden, von veränderten globalen Variablen "
"abzuhängen, denn das macht das Testen viel schwieriger."
#:
../../faq/library.rst:152
msgid
"The
\"
global main logic
\"
of your program may be as simple as ::"
msgstr
"Die „globale Hauptlogik“ deines Programms darf so einfach sein wie ::"
#:
../../faq/library.rst:154
msgid
""
"if __name__ ==
\"
__main__
\"
:\n"
" main_logic()"
msgstr
""
"if __name__ ==
\"
__main__
\"
:\n"
" main_logic()"
#:
../../faq/library.rst:157
msgid
"at the bottom of the main module of your program."
msgstr
"am Ende des Hauptmoduls deines Programms."
#:
../../faq/library.rst:159
msgid
""
"Once your program is organized as a tractable collection of function and "
"class behaviours, you should write test functions that exercise the "
"behaviours. A test suite that automates a sequence of tests can be "
"associated with each module. This sounds like a lot of work, but since "
"Python is so terse and flexible it's surprisingly easy. You can make coding "
"much more pleasant and fun by writing your test functions in parallel with "
"the
\"
production code
\"
, since this makes it easy to find bugs and even "
"design flaws earlier."
msgstr
""
"Sobald dein Programm als überschaubare Sammlung von Funktions- und "
"Klassenverhalten organisiert ist, solltest du Testfunktionen schreiben, die "
"diese Verhalten durchlaufen. Jedem Modul lässt sich eine Testsammlung "
"zuordnen, die eine Folge von Tests automatisiert. Das klingt nach viel "
"Arbeit, ist aber überraschend leicht, weil Python so knapp und flexibel ist. "
"Du kannst das Programmieren viel angenehmer und unterhaltsamer machen, indem "
"du deine Testfunktionen parallel zum „produktiven Code“ schreibst, denn so "
"lassen sich Fehler und sogar Entwurfsschwächen früher finden."
#:
../../faq/library.rst:167
msgid
""
"
\"
Support modules
\"
that are not intended to be the main module of a program "
"may include a self-test of the module. ::"
msgstr
""
"„Hilfsmodule“, die nicht als Hauptmodul eines Programms gedacht sind, dürfen "
"einen Selbsttest des Moduls enthalten. ::"
#:
../../faq/library.rst:170
msgid
""
"if __name__ ==
\"
__main__
\"
:\n"
" self_test()"
msgstr
""
"if __name__ ==
\"
__main__
\"
:\n"
" self_test()"
#:
../../faq/library.rst:173
msgid
""
"Even programs that interact with complex external interfaces may be tested "
"when the external interfaces are unavailable by using
\"
fake
\"
interfaces "
"implemented in Python."
msgstr
""
"Selbst Programme, die mit komplexen externen Schnittstellen arbeiten, lassen "
"sich testen, wenn die externen Schnittstellen nicht verfügbar sind, indem "
"man „falsche“ Schnittstellen verwendet, die in Python umgesetzt sind."
#:
../../faq/library.rst:179
msgid
"How do I create documentation from doc strings?"
msgstr
"Wie erzeuge ich aus Docstrings Dokumentation?"
#:
../../faq/library.rst:181
msgid
""
"The :mod:`pydoc` module can create HTML from the doc strings in your Python "
"source code. An alternative for creating API documentation purely from "
"docstrings is `epydoc <https://epydoc.sourceforge.net/>`_. `Sphinx <https://"
"www.sphinx-doc.org>`_ can also include docstring content."
msgstr
""
"Das Modul :mod:`pydoc` kann aus den Docstrings in deinem Python-Quellcode "
"HTML erzeugen. Eine Alternative, um API-Dokumentation ausschließlich aus "
"Docstrings zu erzeugen, ist `epydoc <https://epydoc.sourceforge.net/>`_. "
"Auch `Sphinx <https://www.sphinx-doc.org>`_ kann Inhalte aus Docstrings "
"einbeziehen."
#:
../../faq/library.rst:188
msgid
"How do I get a single keypress at a time?"
msgstr
"Wie bekomme ich einzelne Tastendrücke?"
#:
../../faq/library.rst:190
msgid
""
"For Unix variants there are several solutions. It's straightforward to do "
"this using curses, but curses is a fairly large module to learn."
msgstr
""
"Für Unix-Varianten gibt es mehrere Lösungen. Mit curses geht das "
"geradeheraus, aber curses ist ein recht umfangreiches Modul, in das man sich "
"einarbeiten muss."
#:
../../faq/library.rst:234
msgid
"Threads"
msgstr
"Threads"
#:
../../faq/library.rst:237
msgid
"How do I program using threads?"
msgstr
"Wie programmiere ich mit Threads?"
#:
../../faq/library.rst:239
msgid
""
"Be sure to use the :mod:`threading` module and not the :mod:`_thread` "
"module. The :mod:`threading` module builds convenient abstractions on top of "
"the low-level primitives provided by the :mod:`_thread` module."
msgstr
""
"Verwende unbedingt das Modul :mod:`threading` und nicht das Modul :mod:"
"`_thread`. Das Modul :mod:`threading` baut bequeme Abstraktionen auf den "
"grundlegenden Mitteln auf, die das Modul :mod:`_thread` bereitstellt."
#:
../../faq/library.rst:245
msgid
"None of my threads seem to run: why?"
msgstr
"Keiner meiner Threads scheint zu laufen. Warum?"
#:
../../faq/library.rst:247
msgid
""
"As soon as the main thread exits, all threads are killed. Your main thread "
"is running too quickly, giving the threads no time to do any work."
msgstr
""
"Sobald der Haupt-Thread sich beendet, werden alle Threads getötet. Dein "
"Haupt-Thread läuft zu schnell durch und gibt den Threads keine Zeit, "
"irgendetwas zu tun."
#:
../../faq/library.rst:250
msgid
""
"A simple fix is to add a sleep to the end of the program that's long enough "
"for all the threads to finish::"
msgstr
""
"Eine einfache Abhilfe ist, am Ende des Programms eine Wartezeit einzufügen, "
"die lang genug ist, damit alle Threads fertig werden::"
#:
../../faq/library.rst:253
msgid
""
"import threading, time\n"
"\n"
"def thread_task(name, n):\n"
" for i in range(n):\n"
" print(name, i)\n"
"\n"
"for i in range(10):\n"
" T = threading.Thread(target=thread_task, args=(str(i), i))\n"
" T.start()\n"
"\n"
"time.sleep(10) # <---------------------------!"
msgstr
""
"import threading, time\n"
"\n"
"def thread_task(name, n):\n"
" for i in range(n):\n"
" print(name, i)\n"
"\n"
"for i in range(10):\n"
" T = threading.Thread(target=thread_task, args=(str(i), i))\n"
" T.start()\n"
"\n"
"time.sleep(10) # <---------------------------!"
#:
../../faq/library.rst:265
msgid
""
"But now (on many platforms) the threads don't run in parallel, but appear to "
"run sequentially, one at a time! The reason is that the OS thread scheduler "
"doesn't start a new thread until the previous thread is blocked."
msgstr
""
"Aber jetzt laufen die Threads (auf vielen Plattformen) nicht parallel, "
"sondern scheinen hintereinander zu laufen, einer nach dem anderen! Der Grund "
"ist, dass der Thread-Planer des Betriebssystems keinen neuen Thread startet, "
"solange der vorherige nicht blockiert ist."
#:
../../faq/library.rst:269
msgid
"A simple fix is to add a tiny sleep to the start of the run function::"
msgstr
""
"Eine einfache Abhilfe ist, am Anfang der Ausführungsfunktion eine winzige "
"Wartezeit einzufügen::"
#:
../../faq/library.rst:271
msgid
""
"def thread_task(name, n):\n"
" time.sleep(0.001) # <--------------------!\n"
" for i in range(n):\n"
" print(name, i)\n"
"\n"
"for i in range(10):\n"
" T = threading.Thread(target=thread_task, args=(str(i), i))\n"
" T.start()\n"
"\n"
"time.sleep(10)"
msgstr
""
"def thread_task(name, n):\n"
" time.sleep(0.001) # <--------------------!\n"
" for i in range(n):\n"
" print(name, i)\n"
"\n"
"for i in range(10):\n"
" T = threading.Thread(target=thread_task, args=(str(i), i))\n"
" T.start()\n"
"\n"
"time.sleep(10)"
#:
../../faq/library.rst:282
msgid
""
"Instead of trying to guess a good delay value for :func:`time.sleep`, it's "
"better to use some kind of semaphore mechanism. One idea is to use the :mod:"
"`queue` module to create a queue object, let each thread append a token to "
"the queue when it finishes, and let the main thread read as many tokens from "
"the queue as there are threads."
msgstr
""
"Statt zu versuchen, einen guten Wert für die Wartezeit von :func:`time."
"sleep` zu erraten, ist es besser, irgendeine Art von Semaphor-Mechanismus zu "
"verwenden. Eine Idee ist, mit dem Modul :mod:`queue` ein "
"Warteschlangenobjekt zu erzeugen, jeden Thread beim Beenden ein Zeichen an "
"die Warteschlange anhängen zu lassen und den Haupt-Thread so viele Zeichen "
"aus der Warteschlange zu lesen, wie es Threads gibt."
#:
../../faq/library.rst:290
msgid
"How do I parcel out work among a bunch of worker threads?"
msgstr
"Wie verteile ich Arbeit auf eine Reihe von Arbeiter-Threads?"
#:
../../faq/library.rst:292
msgid
""
"The easiest way is to use the :mod:`concurrent.futures` module, especially "
"the :mod:`~concurrent.futures.ThreadPoolExecutor` class."
msgstr
""
"Am einfachsten geht das mit dem Modul :mod:`concurrent.futures`, "
"insbesondere mit der Klasse :mod:`~concurrent.futures.ThreadPoolExecutor`."
#:
../../faq/library.rst:295
msgid
""
"Or, if you want fine control over the dispatching algorithm, you can write "
"your own logic manually. Use the :mod:`queue` module to create a queue "
"containing a list of jobs. The :class:`~queue.Queue` class maintains a list "
"of objects and has a ``.put(obj)`` method that adds items to the queue and a "
"``.get()`` method to return them. The class will take care of the locking "
"necessary to ensure that each job is handed out exactly once."
msgstr
""
"Oder du schreibst deine eigene Logik von Hand, wenn du die Verteilung genau "
"steuern willst. Erzeuge mit dem Modul :mod:`queue` eine Warteschlange, die "
"eine Liste von Aufträgen enthält. Die Klasse :class:`~queue.Queue` führt "
"eine Liste von Objekten und hat eine Methode ``.put(obj)``, die Elemente zur "
"Warteschlange hinzufügt, sowie eine Methode ``.get()``, die sie zurückgibt. "
"Die Klasse kümmert sich um die nötige Sperrung, damit jeder Auftrag genau "
"einmal ausgegeben wird."
#:
../../faq/library.rst:302
msgid
"Here's a trivial example::"
msgstr
"Hier ein einfaches Beispiel::"
#:
../../faq/library.rst:304
msgid
""
"import threading, queue, time\n"
"\n"
"# The worker thread gets jobs off the queue. When the queue is empty, it\n"
"# assumes there will be no more work and exits.\n"
"# (Realistically workers will run until terminated.)\n"
"def worker():\n"
" print('Running worker')\n"
" time.sleep(0.1)\n"
" while True:\n"
" try:\n"
" arg = q.get(block=False)\n"
" except queue.Empty:\n"
" print('Worker', threading.current_thread(), end=' ')\n"
" print('queue empty')\n"
" break\n"
" else:\n"
" print('Worker', threading.current_thread(), end=' ')\n"
" print('running with argument', arg)\n"
" time.sleep(0.5)\n"
"\n"
"# Create queue\n"
"q = queue.Queue()\n"
"\n"
"# Start a pool of 5 workers\n"
"for i in range(5):\n"
" t = threading.Thread(target=worker, name='worker %i' % (i+1))\n"
" t.start()\n"
"\n"
"# Begin adding work to the queue\n"
"for i in range(50):\n"
" q.put(i)\n"
"\n"
"# Give threads time to run\n"
"print('Main thread sleeping')\n"
"time.sleep(5)"
msgstr
""
"import threading, queue, time\n"
"\n"
"# Der Arbeiter-Thread holt Aufträge aus der Warteschlange. Ist sie leer,\n"
"# nimmt er an, dass keine Arbeit mehr kommt, und beendet sich.\n"
"# (In der Praxis laufen Arbeiter, bis sie beendet werden.)\n"
"def worker():\n"
" print('Running worker')\n"
" time.sleep(0.1)\n"
" while True:\n"
" try:\n"
" arg = q.get(block=False)\n"
" except queue.Empty:\n"
" print('Worker', threading.current_thread(), end=' ')\n"
" print('queue empty')\n"
" break\n"
" else:\n"
" print('Worker', threading.current_thread(), end=' ')\n"
" print('running with argument', arg)\n"
" time.sleep(0.5)\n"
"\n"
"# Warteschlange erzeugen\n"
"q = queue.Queue()\n"
"\n"
"# einen Vorrat von 5 Arbeitern starten\n"
"for i in range(5):\n"
" t = threading.Thread(target=worker, name='worker %i' % (i+1))\n"
" t.start()\n"
"\n"
"# beginnen, Arbeit in die Warteschlange zu legen\n"
"for i in range(50):\n"
" q.put(i)\n"
"\n"
"# den Threads Zeit zum Laufen geben\n"
"print('Main thread sleeping')\n"
"time.sleep(5)"
#:
../../faq/library.rst:340
msgid
"When run, this will produce the following output:"
msgstr
"Ausgeführt ergibt das die folgende Ausgabe:"
#:
../../faq/library.rst:342
msgid
""
"Running worker\n"
"Running worker\n"
"Running worker\n"
"Running worker\n"
"Running worker\n"
"Main thread sleeping\n"
"Worker <Thread(worker 1, started 130283832797456)> running with argument 0\n"
"Worker <Thread(worker 2, started 130283824404752)> running with argument 1\n"
"Worker <Thread(worker 3, started 130283816012048)> running with argument 2\n"
"Worker <Thread(worker 4, started 130283807619344)> running with argument 3\n"
"Worker <Thread(worker 5, started 130283799226640)> running with argument 4\n"
"Worker <Thread(worker 1, started 130283832797456)> running with argument 5\n"
"..."
msgstr
""
"Running worker\n"
"Running worker\n"
"Running worker\n"
"Running worker\n"
"Running worker\n"
"Main thread sleeping\n"
"Worker <Thread(worker 1, started 130283832797456)> running with argument 0\n"
"Worker <Thread(worker 2, started 130283824404752)> running with argument 1\n"
"Worker <Thread(worker 3, started 130283816012048)> running with argument 2\n"
"Worker <Thread(worker 4, started 130283807619344)> running with argument 3\n"
"Worker <Thread(worker 5, started 130283799226640)> running with argument 4\n"
"Worker <Thread(worker 1, started 130283832797456)> running with argument 5\n"
"..."
#:
../../faq/library.rst:358
msgid
""
"Consult the module's documentation for more details; the :class:`~queue."
"Queue` class provides a featureful interface."
msgstr
""
"Weitere Einzelheiten stehen in der Dokumentation des Moduls. Die Klasse :"
"class:`~queue.Queue` bietet eine reichhaltige Schnittstelle."
#:
../../faq/library.rst:363
msgid
"What kinds of global value mutation are thread-safe?"
msgstr
"Welche Arten der Änderung globaler Werte sind thread-sicher?"
#:
../../faq/library.rst:365
msgid
""
"A :term:`global interpreter lock` (GIL) is used internally to ensure that "
"only one thread runs in the Python VM at a time. In general, Python offers "
"to switch among threads only between bytecode instructions; how frequently "
"it switches can be set via :func:`sys.setswitchinterval`. Each bytecode "
"instruction and therefore all the C implementation code reached from each "
"instruction is therefore atomic from the point of view of a Python program."
msgstr
""
"Intern wird ein :term:`global interpreter lock` (GIL) verwendet, um "
"sicherzustellen, dass immer nur ein Thread in der Python-VM läuft. Im "
"Allgemeinen wechselt Python nur zwischen Bytecode-Anweisungen den Thread. "
"Wie häufig es wechselt, lässt sich über :func:`sys.setswitchinterval` "
"einstellen. Jede Bytecode-Anweisung und damit aller von ihr erreichte C-Code "
"ist aus Sicht eines Python-Programms deshalb atomar."
#:
../../faq/library.rst:372
msgid
""
"In theory, this means an exact accounting requires an exact understanding of "
"the PVM bytecode implementation. In practice, it means that operations on "
"shared variables of built-in data types (ints, lists, dicts, etc) that "
"
\"
look atomic
\"
really are."
msgstr
""
"Theoretisch bedeutet das, dass eine genaue Abrechnung ein genaues "
"Verständnis der Bytecode-Umsetzung der PVM erfordert. In der Praxis bedeutet "
"es, dass Operationen auf gemeinsam genutzten Variablen integrierter "
"Datentypen (ints, Listen, Dictionarys und so weiter), die „atomar aussehen“, "
"es wirklich sind."
#:
../../faq/library.rst:377
msgid
""
"For example, the following operations are all atomic (L, L1, L2 are lists, "
"D, D1, D2 are dicts, x, y are objects, i, j are ints)::"
msgstr
""
"Zum Beispiel sind die folgenden Operationen alle atomar (L, L1, L2 sind "
"Listen, D, D1, D2 sind Dictionarys, x, y sind Objekte, i, j sind ints)::"
#:
../../faq/library.rst:380
msgid
""
"L.append(x)\n"
"L1.extend(L2)\n"
"x = L[i]\n"
"x = L.pop()\n"
"L1[i:j] = L2\n"
"L.sort()\n"
"x = y\n"
"x.field = y\n"
"D[x] = y\n"
"D1.update(D2)\n"
"D.keys()"
msgstr
""
"L.append(x)\n"
"L1.extend(L2)\n"
"x = L[i]\n"
"x = L.pop()\n"
"L1[i:j] = L2\n"
"L.sort()\n"
"x = y\n"
"x.field = y\n"
"D[x] = y\n"
"D1.update(D2)\n"
"D.keys()"
#:
../../faq/library.rst:392
msgid
"These aren't::"
msgstr
"Diese nicht::"
#:
../../faq/library.rst:394
msgid
""
"i = i+1\n"
"L.append(L[-1])\n"
"L[i] = L[j]\n"
"D[x] = D[x] + 1"
msgstr
""
"i = i+1\n"
"L.append(L[-1])\n"
"L[i] = L[j]\n"
"D[x] = D[x] + 1"
#:
../../faq/library.rst:399
msgid
""
"Operations that replace other objects may invoke those other objects' :meth:"
"`~object.__del__` method when their reference count reaches zero, and that "
"can affect things. This is especially true for the mass updates to "
"dictionaries and lists. When in doubt, use a mutex!"
msgstr
""
"Operationen, die andere Objekte ersetzen, können die Methode :meth:`~object."
"__del__` dieser anderen Objekte auslösen, sobald deren Referenzzähler null "
"erreicht, und das kann sich auswirken. Besonders gilt das für "
"Massenaktualisierungen von Dictionarys und Listen. Im Zweifel: nimm einen "
"Mutex!"
#:
../../faq/library.rst:406
msgid
"Can't we get rid of the Global Interpreter Lock?"
msgstr
"Können wir den Global Interpreter Lock nicht loswerden?"
#:
../../faq/library.rst:408
msgid
""
"The :term:`global interpreter lock` (GIL) is often seen as a hindrance to "
"Python's deployment on high-end multiprocessor server machines, because a "
"multi-threaded Python program effectively only uses one CPU, due to the "
"insistence that (almost) all Python code can only run while the GIL is held."
msgstr
""
"Der :term:`global interpreter lock` (GIL) wird oft als Hindernis für den "
"Einsatz von Python auf hochwertigen Mehrprozessor-Servern gesehen, denn ein "
"Python-Programm mit mehreren Threads nutzt tatsächlich nur eine CPU, weil "
"(fast) aller Python-Code nur laufen darf, solange der GIL gehalten wird."
#:
../../faq/library.rst:413
msgid
""
"With the approval of :pep:`703` work is now underway to remove the GIL from "
"the CPython implementation of Python. Initially it will be implemented as "
"an optional compiler flag when building the interpreter, and so separate "
"builds will be available with and without the GIL. Long-term, the hope is "
"to settle on a single build, once the performance implications of removing "
"the GIL are fully understood. Python 3.13 is likely to be the first release "
"containing this work, although it may not be completely functional in this "
"release."
msgstr
""
"Mit der Zustimmung zu :pep:`703` ist nun die Arbeit daran im Gange, den GIL "
"aus der CPython-Implementierung von Python zu entfernen. Zunächst wird das "
"als optionaler Compiler-Schalter beim Bauen des Interpreters umgesetzt, "
"sodass getrennte Builds mit und ohne GIL verfügbar sein werden. Langfristig "
"besteht die Hoffnung, sich auf einen einzigen Build festzulegen, sobald die "
"Auswirkungen des Entfernens auf die Geschwindigkeit vollständig verstanden "
"sind. Python 3.13 wird wahrscheinlich die erste Veröffentlichung sein, die "
"diese Arbeit enthält, auch wenn sie darin vielleicht noch nicht vollständig "
"funktioniert."
#:
../../faq/library.rst:422
msgid
""
"The current work to remove the GIL is based on a `fork of Python 3.9 with "
"the GIL removed <https://github.com/colesbury/nogil>`_ by Sam Gross. Prior "
"to that, in the days of Python 1.5, Greg Stein actually implemented a "
"comprehensive patch set (the
\"
free threading
\"
patches) that removed the "
"GIL and replaced it with fine-grained locking. Adam Olsen did a similar "
"experiment in his `python-safethread <https://code.google.com/archive/p/"
"python-safethread>`_ project. Unfortunately, both of these earlier "
"experiments exhibited a sharp drop in single-thread performance (at least "
"30% slower), due to the amount of fine-grained locking necessary to "
"compensate for the removal of the GIL. The Python 3.9 fork is the first "
"attempt at removing the GIL with an acceptable performance impact."
msgstr
""
"Die aktuelle Arbeit am Entfernen des GIL beruht auf einem `Fork von Python "
"3.9 ohne GIL <https://github.com/colesbury/nogil>`_ von Sam Gross. Davor, zu "
"Zeiten von Python 1.5, hat Greg Stein tatsächlich einen umfassenden Satz von "
"Patches umgesetzt (die „free threading“-Patches), die den GIL entfernten und "
"durch feingranulare Sperren ersetzten. Adam Olsen hat in seinem Projekt "
"`python-safethread <https://code.google.com/archive/p/python-safethread>`_ "
"ein ähnliches Experiment gemacht. Leider zeigten beide früheren Experimente "
"einen scharfen Einbruch der Geschwindigkeit bei einzelnen Threads, "
"mindestens 30 % langsamer, wegen der Menge an feingranularen Sperren, die "
"zum Ausgleich für das entfernte GIL nötig waren. Der Fork von Python 3.9 ist "
"der erste Versuch, den GIL mit annehmbaren Auswirkungen auf die "
"Geschwindigkeit zu entfernen."
#:
../../faq/library.rst:437
msgid
""
"The presence of the GIL in current Python releases doesn't mean that you "
"can't make good use of Python on multi-CPU machines! You just have to be "
"creative with dividing the work up between multiple *processes* rather than "
"multiple *threads*. The :class:`~concurrent.futures.ProcessPoolExecutor` "
"class in the new :mod:`concurrent.futures` module provides an easy way of "
"doing so; the :mod:`multiprocessing` module provides a lower-level API in "
"case you want more control over dispatching of tasks."
msgstr
""
"Dass der GIL in den aktuellen Python-Veröffentlichungen vorhanden ist, "
"bedeutet nicht, dass du Python auf Maschinen mit mehreren CPUs nicht gut "
"nutzen kannst! Du musst nur kreativ dabei sein, die Arbeit auf mehrere "
"*Prozesse* statt auf mehrere *Threads* zu verteilen. Die Klasse :class:"
"`~concurrent.futures.ProcessPoolExecutor` im neuen Modul :mod:`concurrent."
"futures` bietet dafür einen einfachen Weg. Das Modul :mod:`multiprocessing` "
"bietet eine API auf niedrigerer Ebene, falls du die Verteilung der Aufgaben "
"genauer steuern willst."
#:
../../faq/library.rst:446
msgid
""
"Judicious use of C extensions will also help; if you use a C extension to "
"perform a time-consuming task, the extension can release the GIL while the "
"thread of execution is in the C code and allow other threads to get some "
"work done. Some standard library modules such as :mod:`zlib` and :mod:"
"`hashlib` already do this."
msgstr
""
"Der umsichtige Einsatz von C-Erweiterungen hilft ebenfalls. Verwendest du "
"eine C-Erweiterung für eine zeitaufwendige Aufgabe, kann die Erweiterung den "
"GIL freigeben, während der Ausführungsfaden im C-Code ist, und anderen "
"Threads so erlauben, etwas Arbeit zu erledigen. Einige Module der "
"Standardbibliothek wie :mod:`zlib` und :mod:`hashlib` machen das bereits."
#:
../../faq/library.rst:452
msgid
""
"An alternative approach to reducing the impact of the GIL is to make the GIL "
"a per-interpreter-state lock rather than truly global. This was :ref:`first "
"implemented in Python 3.12 <whatsnew312-pep684>` and is available in the C "
"API. A Python interface to it is expected in Python 3.13. The main "
"limitation to it at the moment is likely to be 3rd party extension modules, "
"since these must be written with multiple interpreters in mind in order to "
"be usable, so many older extension modules will not be usable."
msgstr
""
"Ein anderer Weg, die Auswirkung des GIL zu verringern, ist, ihn zu einer "
"Sperre pro Interpreter-Zustand zu machen statt zu einer wirklich globalen. "
"Das wurde :ref:`erstmals in Python 3.12 umgesetzt <whatsnew312-pep684>` und "
"ist in der C-API verfügbar. Eine Python-Schnittstelle dazu wird für Python "
"3.13 erwartet. Die wichtigste Einschränkung dürfte derzeit bei "
"Erweiterungsmodulen von Dritten liegen, denn diese müssen mit mehreren "
"Interpretern im Blick geschrieben sein, um nutzbar zu sein, weshalb viele "
"älteren Erweiterungsmodule nicht nutzbar sein werden."
#:
../../faq/library.rst:462
msgid
"Input and Output"
msgstr
"Ein- und Ausgabe"
#:
../../faq/library.rst:465
msgid
"How do I delete a file? (And other file questions...)"
msgstr
"Wie lösche ich eine Datei? (Und andere Fragen zu Dateien ...)"
#:
../../faq/library.rst:467
msgid
""
"Use ``os.remove(filename)`` or ``os.unlink(filename)``; for documentation, "
"see the :mod:`os` module. The two functions are identical; :func:`~os."
"unlink` is simply the name of the Unix system call for this function."
msgstr
""
"Verwende ``os.remove(filename)`` oder ``os.unlink(filename)``. Die "
"Dokumentation dazu steht beim Modul :mod:`os`. Die beiden Funktionen sind "
"identisch, :func:`~os.unlink` ist einfach der Name des Unix-Systemaufrufs "
"für diese Funktion."
#:
../../faq/library.rst:471
msgid
""
"To remove a directory, use :func:`os.rmdir`; use :func:`os.mkdir` to create "
"one. ``os.makedirs(path)`` will create any intermediate directories in "
"``path`` that don't exist. ``os.removedirs(path)`` will remove intermediate "
"directories as long as they're empty; if you want to delete an entire "
"directory tree and its contents, use :func:`shutil.rmtree`."
msgstr
""
"Um ein Verzeichnis zu entfernen, verwende :func:`os.rmdir`, zum Anlegen :"
"func:`os.mkdir`. ``os.makedirs(path)`` legt alle Zwischenverzeichnisse in "
"``path`` an, die noch nicht vorhanden sind. ``os.removedirs(path)`` entfernt "
"Zwischenverzeichnisse, solange sie leer sind. Willst du einen ganzen "
"Verzeichnisbaum samt Inhalt löschen, verwende :func:`shutil.rmtree`."
#:
../../faq/library.rst:477
msgid
"To rename a file, use ``os.rename(old_path, new_path)``."
msgstr
""
"Um eine Datei umzubenennen, verwende ``os.rename(old_path, new_path)``."
#:
../../faq/library.rst:479
msgid
""
"To truncate a file, open it using ``f = open(filename,
\"
rb+
\"
)``, and use "
"``f.truncate(offset)``; offset defaults to the current seek position. "
"There's also ``os.ftruncate(fd, offset)`` for files opened with :func:`os."
"open`, where *fd* is the file descriptor (a small integer)."
msgstr
""
"Um eine Datei abzuschneiden, öffne sie mit ``f = open(filename,
\"
rb+
\"
)`` "
"und verwende ``f.truncate(offset)``. Voreingestellt ist offset die aktuelle "
"Position des Lesezeigers. Für Dateien, die mit :func:`os.open` geöffnet "
"wurden, gibt es außerdem ``os.ftruncate(fd, offset)``, wobei *fd* der "
"Dateideskriptor ist, also eine kleine ganze Zahl."
#:
../../faq/library.rst:484
msgid
""
"The :mod:`shutil` module also contains a number of functions to work on "
"files including :func:`~shutil.copyfile`, :func:`~shutil.copytree`, and :"
"func:`~shutil.rmtree`."
msgstr
""
"Das Modul :mod:`shutil` enthält außerdem eine Reihe von Funktionen für die "
"Arbeit mit Dateien, darunter :func:`~shutil.copyfile`, :func:`~shutil."
"copytree` und :func:`~shutil.rmtree`."
#:
../../faq/library.rst:490
msgid
"How do I copy a file?"
msgstr
"Wie kopiere ich eine Datei?"
#:
../../faq/library.rst:492
msgid
""
"The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note "
"that on Windows NTFS volumes, it does not copy `alternate data streams "
"<https://en.wikipedia.org/wiki/NTFS#Alternate_data_stream_(ADS)>`_ nor "
"`resource forks <https://en.wikipedia.org/wiki/Resource_fork>`__ on macOS "
"HFS+ volumes, though both are now rarely used. It also doesn't copy file "
"permissions and metadata, though using :func:`shutil.copy2` instead will "
"preserve most (though not all) of it."
msgstr
""
"Das Modul :mod:`shutil` enthält eine Funktion :func:`~shutil.copyfile`. "
"Beachte, dass sie auf NTFS-Datenträgern unter Windows keine `alternativen "
"Datenströme <https://en.wikipedia.org/wiki/"
"NTFS#Alternate_data_stream_(ADS)>`_ kopiert und auf HFS+-Datenträgern unter "
"macOS keine `Ressourcenzweige <https://en.wikipedia.org/wiki/"
"Resource_fork>`__, auch wenn beides inzwischen selten verwendet wird. Sie "
"kopiert außerdem keine Dateirechte und Metadaten, wobei :func:`shutil.copy2` "
"davon das meiste erhält, wenn auch nicht alles."
#:
../../faq/library.rst:503
msgid
"How do I read (or write) binary data?"
msgstr
"Wie lese oder schreibe ich Binärdaten?"
#:
../../faq/library.rst:505
msgid
""
"To read or write complex binary data formats, it's best to use the :mod:"
"`struct` module. It allows you to take a string containing binary data "
"(usually numbers) and convert it to Python objects; and vice versa."
msgstr
""
"Um komplexe Binärdatenformate zu lesen oder zu schreiben, verwendest du am "
"besten das Modul :mod:`struct`. Es erlaubt dir, eine Zeichenkette mit "
"Binärdaten zu nehmen, meist Zahlen, und sie in Python-Objekte umzuwandeln — "
"und umgekehrt."
#:
../../faq/library.rst:509
msgid
""
View remainder of file in raw view
Back
|
FazBrowse Home
|
New Git URL