-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathstruct.po
More file actions
757 lines (552 loc) · 54.6 KB
/
Copy pathstruct.po
File metadata and controls
757 lines (552 loc) · 54.6 KB
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
# 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:
# Danial Behzadi <dani.behzi@ubuntu.com>, 2025
# Alireza Shabani (Revisto) <theRevisto@gmail.com>, 2025
# Ariyan Bolandi, 2025
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
# Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-16 12:56+0000\n"
"PO-Revision-Date: 2026-09-13 19:44+0330\n"
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
"Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n"
"Language: fa\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"
"X-Generator: Poedit 3.6\n"
msgid ":mod:`!struct` --- Interpret bytes as packed binary data"
msgstr ":mod:`!struct` --- تفسیر بایتها بهعنوان دادههای دودویی بستهبندیشده"
msgid "**Source code:** :source:`Lib/struct.py`"
msgstr "**کد منبع:** :source:`Lib/struct.py`"
msgid "This module converts between Python values and C structs represented as Python :class:`bytes` objects. Compact :ref:`format strings <struct-format-strings>` describe the intended conversions to/from Python values. The module's functions and objects can be used for two largely distinct applications, data exchange with external sources (files or network connections), or data transfer between the Python application and the C layer."
msgstr "این ماژول بین مقادیر پایتون و ساختارهای C که بهصورت اشیای :class:`bytes` پایتون نمایش داده میشوند، تبدیل انجام میدهد. :ref:`رشتههای قالب <struct-format-strings>` فشرده، تبدیلهای موردنظر به/از مقادیر پایتون را توصیف میکنند. توابع و اشیای این ماژول میتوانند برای دو کاربرد تا حد زیادی متمایز استفاده شوند: تبادل داده با منابع خارجی (پروندهها یا اتصالهای شبکه)، یا انتقال داده بین برنامهی پایتون و لایهی C."
msgid "When no prefix character is given, native mode is the default. It packs or unpacks data based on the platform and compiler on which the Python interpreter was built. The result of packing a given C struct includes pad bytes which maintain proper alignment for the C types involved; similarly, alignment is taken into account when unpacking. In contrast, when communicating data between external sources, the programmer is responsible for defining byte ordering and padding between elements. See :ref:`struct-alignment` for details."
msgstr "هنگامی که هیچ نویسهی پیشوندی داده نشود، حالت بومی پیشفرض است. این حالت دادهها را بر اساس سکو و کامپایلری که مفسر پایتون بر پایهی آنها ساخته شده است، بستهبندی یا واگشایی میکند. نتیجهی بستهبندی یک ساختار C مشخص، شامل بایتهای پرکنندهای است که تراز مناسب را برای انواع C مربوط حفظ میکنند؛ بهطور مشابه، هنگام واگشایی نیز تراز در نظر گرفته میشود. در مقابل، هنگام تبادل داده بین منابع خارجی، برنامهنویس مسئول تعیین ترتیب بایتها و بایتهای پرکننده بین المانها است. برای جزئیات، :ref:`struct-alignment` را ببینید."
msgid "Several :mod:`!struct` functions (and methods of :class:`Struct`) take a *buffer* argument. This refers to objects that implement the :ref:`bufferobjects` and provide either a readable or read-writable buffer. The most common types used for that purpose are :class:`bytes` and :class:`bytearray`, but many other types that can be viewed as an array of bytes implement the buffer protocol, so that they can be read/filled without additional copying from a :class:`bytes` object."
msgstr "چندین تابع :mod:`!struct` (و متدهای :class:`Struct`) یک آرگومان *بافر* دریافت میکنند. این به اشیایی اشاره دارد که :ref:`bufferobjects` را پیادهسازی میکنند و یک بافر قابل خواندن یا قابل خواندن و نوشتن فراهم میکنند. رایجترین انواعی که برای این منظور استفاده میشوند، :class:`bytes` و :class:`bytearray` هستند، اما بسیاری از انواع دیگر که میتوان آنها را بهعنوان آرایهای از بایتها در نظر گرفت، پروتکل بافر را پیادهسازی میکنند، بهطوری که بتوان آنها را بدون کپی اضافی از یک شیء :class:`bytes` خواند/پر کرد."
msgid "Functions and Exceptions"
msgstr "توابع و استثناها"
msgid "The module defines the following exception and functions:"
msgstr "این ماژول استثنا و توابع زیر را تعریف میکند:"
msgid "Exception raised on various occasions; argument is a string describing what is wrong."
msgstr "استثنایی که در موارد مختلف پرتاب میشود؛ آرگومان آن رشتهای است که توضیح میدهد چه چیزی اشتباه است."
msgid "Return a bytes object containing the values *v1*, *v2*, ... packed according to the format string *format*. The arguments must match the values required by the format exactly."
msgstr "یک شیء bytes حاوی مقادیر *v1*، *v2*، ... برمیگرداند که بر اساس رشته قالب *format* بستهبندی شدهاند. آرگومانها باید دقیقاً با مقادیر مورد نیاز قالب مطابقت داشته باشند."
msgid "Pack the values *v1*, *v2*, ... according to the format string *format* and write the packed bytes into the writable buffer *buffer* starting at position *offset*. Note that *offset* is a required argument. A negative *offset* counts from the end of *buffer*."
msgstr "مقادیر *v1*، *v2*، ... را مطابق رشتهی قالب *format* بستهبندی کنید و بایتهای بستهبندیشده را در بافر قابلنوشتن *buffer* از موقعیت *offset* بنویسید. توجه داشته باشید که *offset* یک آرگومان الزامی است. *offset* منفی از انتهای *buffer* شمارش میشود."
msgid "Unpack from the buffer *buffer* (presumably packed by ``pack(format, ...)``) according to the format string *format*. The result is a tuple even if it contains exactly one item. The buffer's size in bytes must match the size required by the format, as reflected by :func:`calcsize`."
msgstr "از بافر *buffer* (که احتمالاً با ``pack(format, ...)`` بستهبندی شده است) بر اساس رشتهی قالب *format* واگشایی میکند. نتیجه یک تاپل است، حتی اگر دقیقاً شامل یک آیتم باشد. اندازهی بافر بر حسب بایت باید با اندازهی مورد نیاز قالب مطابقت داشته باشد، همانطور که :func:`calcsize` نشان میدهد."
msgid "Unpack from *buffer* starting at position *offset*, according to the format string *format*. The result is a tuple even if it contains exactly one item. The buffer's size in bytes, starting at position *offset*, must be at least the size required by the format, as reflected by :func:`calcsize`. A negative *offset* counts from the end of *buffer*."
msgstr "از *buffer* با شروع از موقعیت *offset*، بر اساس رشتهی قالب *format* واگشایی کنید. نتیجه حتی اگر دقیقاً شامل یک آیتم باشد، یک تاپل است. اندازهی بافر بر حسب بایت، با شروع از موقعیت *offset*، باید حداقل برابر با اندازهی موردنیاز قالب باشد، همانطور که :func:`calcsize` نشان میدهد. یک *offset* منفی از انتهای *buffer* شمارش میشود."
msgid "Iteratively unpack from the buffer *buffer* according to the format string *format*. This function returns an iterator which will read equally sized chunks from the buffer until all its contents have been consumed. The buffer's size in bytes must be a multiple of the size required by the format, as reflected by :func:`calcsize`."
msgstr "بهصورت تکراری از بافر *buffer* بر اساس رشتهی قالب *format* واگشایی میشود. این تابع یک پیمایشگر برمیگرداند که تکههایی با اندازهی یکسان از بافر میخواند تا زمانی که تمام محتوای آن مصرف شود. اندازهی بافر بر حسب بایت باید مضربی از اندازهی مورد نیاز قالب باشد، همانطور که :func:`calcsize` نشان میدهد."
msgid "Each iteration yields a tuple as specified by the format string."
msgstr "هر تکرار، یک تاپل را مطابق آنچه رشتهی قالب مشخص میکند برمیگرداند."
msgid "Return the size of the struct (and hence of the bytes object produced by ``pack(format, ...)``) corresponding to the format string *format*."
msgstr "اندازهی ساختار (و بنابراین اندازهی شیء bytes تولیدشده توسط ``pack(format, ...)``) متناظر با رشتهی قالب *format* را برمیگرداند."
msgid "Format Strings"
msgstr "رشتههای قالب"
msgid "Format strings describe the data layout when packing and unpacking data. They are built up from :ref:`format characters<format-characters>`, which specify the type of data being packed/unpacked. In addition, special characters control the :ref:`byte order, size and alignment<struct-alignment>`. Each format string consists of an optional prefix character which describes the overall properties of the data and one or more format characters which describe the actual data values and padding."
msgstr "رشتههای قالب، چیدمان دادهها را هنگام بستهبندی و واگشایی داده توصیف میکنند. آنها از :ref:`نویسههای قالب <format-characters>` تشکیل شدهاند که نوع دادههایی را که بستهبندی/واگشایی میشوند مشخص میکنند. افزون بر این، نویسههای ویژه :ref:`ترتیب بایت، اندازه و ترازبندی <struct-alignment>` را کنترل میکنند. هر رشتهی قالب شامل یک نویسهی پیشوندی اختیاری است که ویژگیهای کلی دادهها را توصیف میکند و یک یا چند نویسهی قالب که مقادیر واقعی داده و فضای پرکننده را توصیف میکنند."
msgid "Byte Order, Size, and Alignment"
msgstr "ترتیب بایت، اندازه و همترازی"
msgid "By default, C types are represented in the machine's native format and byte order, and properly aligned by skipping pad bytes if necessary (according to the rules used by the C compiler). This behavior is chosen so that the bytes of a packed struct correspond exactly to the memory layout of the corresponding C struct. Whether to use native byte ordering and padding or standard formats depends on the application."
msgstr "بهطور پیشفرض، انواع C در قالب و ترتیب بایت بومی ماشین نمایش داده میشوند و در صورت لزوم با پرش از بایتهای پرکننده (طبق قواعد استفادهشده توسط کامپایلر C) بهدرستی همتراز میشوند. این رفتار انتخاب شده است تا بایتهای یک ساختار فشرده دقیقاً با چیدمان حافظهی ساختار C متناظر مطابقت داشته باشند. اینکه از ترتیب بایت و پرکنندگی بومی استفاده شود یا از قالبهای استاندارد، به کاربرد بستگی دارد."
msgid "Alternatively, the first character of the format string can be used to indicate the byte order, size and alignment of the packed data, according to the following table:"
msgstr "بهعنوان جایگزین، میتوان از اولین نویسهی رشتهی قالب برای نشان دادن ترتیب بایتها، اندازه و همترازی دادههای بستهبندیشده، مطابق جدول زیر استفاده کرد:"
msgid "Character"
msgstr "نویسه"
msgid "Byte order"
msgstr "ترتیب بایت"
msgid "Size"
msgstr "اندازه"
msgid "Alignment"
msgstr "تراز"
msgid "``@``"
msgstr "``@``"
msgid "native"
msgstr "بومی"
msgid "``=``"
msgstr "``=``"
msgid "standard"
msgstr "استاندارد"
msgid "none"
msgstr "هیچ"
msgid "``<``"
msgstr "``<``"
msgid "little-endian"
msgstr "کوچکاندیان (little-endian)"
msgid "``>``"
msgstr "``>``"
msgid "big-endian"
msgstr "بزرگاندیان"
msgid "``!``"
msgstr "``!``"
msgid "network (= big-endian)"
msgstr "شبکه (= بزرگاندیان)"
msgid "If the first character is not one of these, ``'@'`` is assumed."
msgstr "اگر اولین نویسه یکی از اینها نباشد، ``'@'`` فرض میشود."
msgid "The number 1023 (``0x3ff`` in hexadecimal) has the following byte representations:"
msgstr "عدد ۱۰۲۳ (``0x3ff`` در مبنای شانزده) بازنماییهای بایتی زیر را دارد:"
msgid "``03 ff`` in big-endian (``>``)"
msgstr "``03 ff`` در بزرگاندیان (``>``)"
msgid "``ff 03`` in little-endian (``<``)"
msgstr "``ff 03`` بهصورت کوچکاندیان (little-endian) (``<``)"
msgid "Python example:"
msgstr "مثال پایتون:"
msgid "Native byte order is big-endian or little-endian, depending on the host system. For example, Intel x86, AMD64 (x86-64), and Apple M1 are little-endian; IBM z and many legacy architectures are big-endian. Use :data:`sys.byteorder` to check the endianness of your system."
msgstr "ترتیب بایت بومی، بسته به سیستم میزبان، بزرگاندیان (big-endian) یا کوچکاندیان (little-endian) است. برای مثال، Intel x86، AMD64 (x86-64) و Apple M1 کوچکاندیان هستند؛ IBM z و بسیاری از معماریهای قدیمی بزرگاندیان هستند. برای بررسی ترتیب بایت (endianness) سیستم خود از :data:`sys.byteorder` استفاده کنید."
msgid "Native size and alignment are determined using the C compiler's ``sizeof`` expression. This is always combined with native byte order."
msgstr "اندازه و همترازی بومی با استفاده از عبارت ``sizeof`` کامپایلر C تعیین میشود. این همیشه با ترتیب بایت بومی ترکیب میشود."
msgid "Standard size depends only on the format character; see the table in the :ref:`format-characters` section."
msgstr "اندازهی استاندارد فقط به نویسهی قالب بستگی دارد؛ جدول موجود در بخش :ref:`format-characters` را ببینید."
msgid "Note the difference between ``'@'`` and ``'='``: both use native byte order, but the size and alignment of the latter is standardized."
msgstr "به تفاوت بین ``'@'`` و ``'='`` توجه کنید: هر دو از ترتیب بایتهای بومی استفاده میکنند، اما اندازه و همترازی مورد دوم استاندارد شده است."
msgid "The form ``'!'`` represents the network byte order which is always big-endian as defined in `IETF RFC 1700 <IETF RFC 1700_>`_."
msgstr "قالب ``'!'`` نمایانگر ترتیب بایتهای شبکه است که مطابق تعریف `IETF RFC 1700 <IETF RFC 1700_>`_، همیشه بهصورت بزرگاندیان (big-endian) است."
msgid "There is no way to indicate non-native byte order (force byte-swapping); use the appropriate choice of ``'<'`` or ``'>'``."
msgstr "راهی برای مشخص کردن ترتیب بایت غیربومی (اجبار به جابجایی بایتها) وجود ندارد؛ از انتخاب مناسب ``'<'`` یا ``'>'`` استفاده کنید."
msgid "Notes:"
msgstr "یادداشتها:"
msgid "Padding is only automatically added between successive structure members. No padding is added at the beginning or the end of the encoded struct."
msgstr "فضای پرکننده (padding) فقط بهصورت خودکار بین اعضای متوالی ساختار اضافه میشود. هیچ فضای پرکنندهای در ابتدا یا انتهای ساختار کدگذاریشده اضافه نمیشود."
msgid "No padding is added when using non-native size and alignment, e.g. with '<', '>', '=', and '!'."
msgstr "هنگام استفاده از اندازه و ترازبندی غیربومی، هیچ پرکنندهای (padding) اضافه نمیشود، برای مثال با '<'، '>'، '=' و '!'."
msgid "To align the end of a structure to the alignment requirement of a particular type, end the format with the code for that type with a repeat count of zero. See :ref:`struct-examples`."
msgstr "برای همتراز کردن انتهای یک ساختار با الزام همترازی یک نوع خاص، قالب را با کد آن نوع و تعداد تکرار صفر به پایان ببرید. :ref:`struct-examples` را ببینید."
msgid "Format Characters"
msgstr "نویسههای قالببندی"
msgid "Format characters have the following meaning; the conversion between C and Python values should be obvious given their types. The 'Standard size' column refers to the size of the packed value in bytes when using standard size; that is, when the format string starts with one of ``'<'``, ``'>'``, ``'!'`` or ``'='``. When using native size, the size of the packed value is platform-dependent."
msgstr "نویسههای قالب معنای زیر را دارند؛ با توجه به نوع آنها، تبدیل بین مقادیر C و پایتون باید بدیهی باشد. ستون «اندازه استاندارد» به اندازهی مقدار بستهبندیشده بر حسب بایت هنگام استفاده از اندازه استاندارد اشاره دارد؛ یعنی زمانی که رشتهی قالب با یکی از ``'<'``، ``'>'``، ``'!'`` یا ``'='`` شروع شود. هنگام استفاده از اندازه بومی، اندازهی مقدار بستهبندیشده وابسته به سکو است."
msgid "Format"
msgstr "قالب"
msgid "C Type"
msgstr "نوع C"
msgid "Python type"
msgstr "نوع پایتون"
msgid "Standard size"
msgstr "اندازه استاندارد"
msgid "Notes"
msgstr "یادداشتها"
msgid "``x``"
msgstr "``x``"
msgid "pad byte"
msgstr "بایت پرکننده"
msgid "no value"
msgstr "بدون مقدار"
msgid "\\(7)"
msgstr "\\(7)"
msgid "``c``"
msgstr "``c``"
msgid ":c:expr:`char`"
msgstr ":c:expr:`char`"
msgid "bytes of length 1"
msgstr "بایتهایی با طول ۱"
msgid "1"
msgstr "1"
msgid "``b``"
msgstr "``b``"
msgid ":c:expr:`signed char`"
msgstr ":c:expr:`signed char`"
msgid "int"
msgstr "int"
msgid "\\(2)"
msgstr "\\(2)"
msgid "``B``"
msgstr "``B``"
msgid ":c:expr:`unsigned char`"
msgstr ":c:expr:`unsigned char`"
msgid "``?``"
msgstr "``?``"
msgid ":c:expr:`_Bool`"
msgstr ":c:expr:`_Bool`"
msgid "bool"
msgstr "bool"
msgid "\\(1)"
msgstr "\\(1)"
msgid "``h``"
msgstr "``h``"
msgid ":c:expr:`short`"
msgstr ":c:expr:`short`"
msgid "2"
msgstr "2"
msgid "``H``"
msgstr "``H``"
msgid ":c:expr:`unsigned short`"
msgstr ":c:expr:`unsigned short`"
msgid "``i``"
msgstr "``i``"
msgid ":c:expr:`int`"
msgstr ":c:expr:`int`"
msgid "4"
msgstr "4"
msgid "``I``"
msgstr "``I``"
msgid ":c:expr:`unsigned int`"
msgstr ":c:expr:`unsigned int`"
msgid "``l``"
msgstr "``l``"
msgid ":c:expr:`long`"
msgstr ":c:expr:`long`"
msgid "``L``"
msgstr "``L``"
msgid ":c:expr:`unsigned long`"
msgstr ":c:expr:`unsigned long`"
msgid "``q``"
msgstr "``q``"
msgid ":c:expr:`long long`"
msgstr ":c:expr:`long long`"
msgid "8"
msgstr "۸"
msgid "``Q``"
msgstr "``Q``"
msgid ":c:expr:`unsigned long long`"
msgstr ":c:expr:`unsigned long long`"
msgid "``n``"
msgstr "``n``"
msgid ":c:type:`ssize_t`"
msgstr ":c:type:`ssize_t`"
msgid "\\(2), \\(3)"
msgstr "\\(2), \\(3)"
msgid "``N``"
msgstr "``N``"
msgid ":c:type:`size_t`"
msgstr ":c:type:`size_t`"
msgid "``e``"
msgstr "``e``"
msgid ":c:expr:`_Float16`"
msgstr ":c:expr:`_Float16`"
msgid "float"
msgstr "float"
msgid "\\(4), \\(6)"
msgstr "\\(4), \\(6)"
msgid "``f``"
msgstr "``f``"
msgid ":c:expr:`float`"
msgstr ":c:expr:`float`"
msgid "\\(4)"
msgstr "\\(4)"
msgid "``d``"
msgstr "``d``"
msgid ":c:expr:`double`"
msgstr ":c:expr:`double`"
msgid "``F``"
msgstr "``F``"
msgid ":c:expr:`float complex`"
msgstr ":c:expr:`float complex`"
msgid "complex"
msgstr "complex"
msgid "\\(10)"
msgstr "\\(10)"
msgid "``D``"
msgstr "``D``"
msgid ":c:expr:`double complex`"
msgstr ":c:expr:`double complex`"
msgid "16"
msgstr "16"
msgid "``s``"
msgstr "``s``"
msgid ":c:expr:`char[]`"
msgstr ":c:expr:`char[]`"
msgid "bytes"
msgstr "bytes"
msgid "\\(9)"
msgstr "\\(9)"
msgid "``p``"
msgstr "``p``"
msgid "\\(8)"
msgstr "\\(8)"
msgid "``P``"
msgstr "``P``"
msgid ":c:expr:`void \\*`"
msgstr ":c:expr:`void \\*`"
msgid "\\(2), \\(5)"
msgstr "\\(2), \\(5)"
msgid "Added support for the ``'n'`` and ``'N'`` formats."
msgstr "پشتیبانی از قالبهای ``'n'`` و ``'N'`` اضافه شد."
msgid "Added support for the ``'e'`` format."
msgstr "پشتیبانی از قالب ``'e'`` اضافه شد."
msgid "Added support for the ``'F'`` and ``'D'`` formats."
msgstr "پشتیبانی از قالبهای ``'F'`` و ``'D'`` اضافه شد."
msgid "The :mod:`array` and :ref:`ctypes <ctypes-fundamental-data-types>` modules, as well as third-party modules like `numpy <https://numpy.org/doc/stable/reference/arrays.interface.html#object.__array_interface__>`__, use similar -- but slightly different -- type codes."
msgstr "ماژولهای :mod:`array` و :ref:`ctypes <ctypes-fundamental-data-types>`، و همچنین ماژولهای شخص ثالث مانند `numpy <https://numpy.org/doc/stable/reference/arrays.interface.html#object.__array_interface__>`__، از کدهای نوع مشابه، اما کمی متفاوت، استفاده میکنند."
msgid "The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type defined by C standards since C99. In standard mode, it is represented by one byte."
msgstr "کد تبدیل ``'?'`` متناظر با نوع :c:expr:`_Bool` است که از C99 در استانداردهای C تعریف شده است. در حالت استاندارد، این نوع با یک بایت بازنمایی میشود."
msgid "When attempting to pack a non-integer using any of the integer conversion codes, if the non-integer has a :meth:`~object.__index__` method then that method is called to convert the argument to an integer before packing."
msgstr "هنگام تلاش برای بستهبندی مقداری که عدد صحیح نیست با استفاده از هر یک از کدهای تبدیل مربوط به عدد صحیح، اگر آن مقدار دارای متد :meth:`~object.__index__` باشد، آن متد برای تبدیل آرگومان به عدد صحیح پیش از بستهبندی فراخوانی میشود."
msgid "Added use of the :meth:`~object.__index__` method for non-integers."
msgstr "استفاده از متد :meth:`~object.__index__` برای غیرصحیحها افزوده شد."
msgid "The ``'n'`` and ``'N'`` conversion codes are only available for the native size (selected as the default or with the ``'@'`` byte order character). For the standard size, you can use whichever of the other integer formats fits your application."
msgstr "کدهای تبدیل ``'n'`` و ``'N'`` فقط برای اندازه بومی (انتخابشده بهعنوان پیشفرض یا با نویسه ترتیب بایت ``'@'``) در دسترس هستند. برای اندازه استاندارد، میتوانید از هر یک از قالبهای دیگر عدد صحیح که مناسب برنامه شماست استفاده کنید."
msgid "For the ``'f'``, ``'d'`` and ``'e'`` conversion codes, the packed representation uses the IEEE 754 binary32, binary64 or binary16 format (for ``'f'``, ``'d'`` or ``'e'`` respectively), regardless of the floating-point format used by the platform."
msgstr "برای کدهای تبدیل ``'f'``، ``'d'`` و ``'e'``، بازنمایی فشرده از قالب binary32، binary64 یا binary16 IEEE 754 (بهترتیب برای ``'f'``، ``'d'`` یا ``'e'``) استفاده میکند، صرفنظر از قالب ممیز شناور استفادهشده توسط سکو."
msgid "The ``'P'`` format character is only available for the native byte ordering (selected as the default or with the ``'@'`` byte order character). The byte order character ``'='`` chooses to use little- or big-endian ordering based on the host system. The struct module does not interpret this as native ordering, so the ``'P'`` format is not available."
msgstr "نویسهی قالب ``'P'`` فقط برای ترتیب بایت بومی در دسترس است (که بهعنوان پیشفرض یا با نویسهی ترتیب بایت ``'@'`` انتخاب میشود). نویسهی ترتیب بایت ``'='`` استفاده از ترتیب کوچکاندیان (little-endian) یا بزرگاندیان (big-endian) را بر اساس سیستم میزبان انتخاب میکند. ماژول struct این را بهعنوان ترتیب بومی تفسیر نمیکند، بنابراین قالب ``'P'`` در دسترس نیست."
msgid "The IEEE 754 binary16 \"half precision\" type was introduced in the 2008 revision of the `IEEE 754 standard <ieee 754 standard_>`_. It has a sign bit, a 5-bit exponent and 11-bit precision (with 10 bits explicitly stored), and can represent numbers between approximately ``6.1e-05`` and ``6.5e+04`` at full precision. This type is not widely supported by C compilers: it's available as :c:expr:`_Float16` type, if the compiler supports the Annex H of the C23 standard. On a typical machine, an unsigned short can be used for storage, but not for math operations. See the Wikipedia page on the `half-precision floating-point format <half precision format_>`_ for more information."
msgstr "نوع binary16 «دقت نصفه» (half precision) در IEEE 754، در بازنگری سال ۲۰۰۸ `استاندارد IEEE 754 <ieee 754 standard_>`_ معرفی شد. این نوع دارای یک بیت علامت، توان ۵ بیتی و دقت ۱۱ بیتی است (با ۱۰ بیت که بهصورت صریح ذخیره میشوند) و میتواند اعدادی بین تقریباً ``6.1e-05`` و ``6.5e+04`` را با دقت کامل نمایش دهد. این نوع بهطور گسترده توسط کامپایلرهای C پشتیبانی نمیشود: اگر کامپایلر از پیوست H استاندارد C23 پشتیبانی کند، بهعنوان نوع :c:expr:`_Float16` در دسترس است. در یک ماشین معمول، میتوان از unsigned short برای ذخیرهسازی استفاده کرد، اما نه برای عملیات ریاضی. برای اطلاعات بیشتر، صفحهی ویکیپدیا دربارهی `قالب ممیز شناور با دقت نصفه <half precision format_>`_ را ببینید."
msgid "When packing, ``'x'`` inserts one NUL byte."
msgstr "هنگام بستهبندی، ``'x'`` یک بایت NUL درج میکند."
msgid "The ``'p'`` format character encodes a \"Pascal string\", meaning a short variable-length string stored in a *fixed number of bytes*, given by the count. The first byte stored is the length of the string, or 255, whichever is smaller. The bytes of the string follow. If the byte string passed in to :func:`pack` is too long (longer than the count minus 1), only the leading ``count-1`` bytes of the string are stored. If the byte string is shorter than ``count-1``, it is padded with null bytes so that exactly count bytes in all are used. Note that for :func:`unpack`, the ``'p'`` format character consumes ``count`` bytes, but that the :class:`!bytes` object returned can never contain more than 255 bytes. When packing, arguments of types :class:`bytes` and :class:`bytearray` are accepted."
msgstr "نویسه قالب ``'p'`` یک «رشته پاسکالی» را کدگذاری میکند، یعنی رشتهای کوتاه با طول متغیر که در *تعداد ثابتی از بایتها* ذخیره میشود و با تعداد (count) مشخص میگردد. نخستین بایت ذخیرهشده، طول رشته یا ۲۵۵ است، هرکدام که کوچکتر باشد. بایتهای رشته در ادامه میآیند. اگر رشته بایت دادهشده به :func:`pack` بیش از حد طولانی باشد (طولانیتر از count منهای ۱)، تنها ``count-1`` بایت ابتدایی رشته ذخیره میشود. اگر رشته بایت کوتاهتر از ``count-1`` باشد، با بایتهای null پر میشود تا دقیقاً در مجموع count بایت استفاده شود. توجه داشته باشید که برای :func:`unpack`، نویسه قالب ``'p'`` ``count`` بایت مصرف میکند، اما شیء :class:`!bytes` برگشتی هرگز نمیتواند بیش از ۲۵۵ بایت داشته باشد. هنگام pack کردن، آرگومانهایی از انواع :class:`bytes` و :class:`bytearray` پذیرفته میشوند."
msgid "For the ``'s'`` format character, the count is interpreted as the length of the byte string, not a repeat count like for the other format characters; for example, ``'10s'`` means a single 10-byte string mapping to or from a single Python byte string, while ``'10c'`` means 10 separate one byte character elements (e.g., ``cccccccccc``) mapping to or from ten different Python byte objects. (See :ref:`struct-examples` for a concrete demonstration of the difference.) If a count is not given, it defaults to 1. For packing, the byte string is truncated or padded with null bytes as appropriate to make it fit. For unpacking, the resulting :class:`!bytes` object always has exactly the specified number of bytes. As a special case, ``'0s'`` means a single, empty byte string (while ``'0c'`` means 0 characters). When packing, arguments of types :class:`bytes` and :class:`bytearray` are accepted."
msgstr "برای نویسهی قالب ``'s'``، تعداد بهعنوان طول رشتهی بایتی تفسیر میشود، نه بهعنوان تعداد تکرار مانند دیگر نویسههای قالب؛ برای مثال، ``'10s'`` بهمعنای یک رشتهی ۱۰ بایتی واحد است که به یک رشتهی بایتی پایتون یا از آن نگاشت میشود، در حالی که ``'10c'`` بهمعنای ۱۰ المان نویسهای یکبایتی جداگانه (مانند ``cccccccccc``) است که به ۱۰ شیء بایتی متفاوت پایتون یا از آنها نگاشت میشوند. (برای نمایش ملموس این تفاوت، :ref:`struct-examples` را ببینید.) اگر تعدادی داده نشود، مقدار پیشفرض ۱ است. در بستهبندی، رشتهی بایتی در صورت لزوم بریده میشود یا با بایتهای تهی پر میشود تا در قالب جای گیرد. در واگشایی، شیء :class:`!bytes` حاصل همیشه دقیقاً دارای تعداد بایت مشخصشده است. بهعنوان یک حالت خاص، ``'0s'`` بهمعنای یک رشتهی بایتی خالی واحد است (در حالی که ``'0c'`` بهمعنای ۰ نویسه است). هنگام بستهبندی، آرگومانهایی از انواع :class:`bytes` و :class:`bytearray` پذیرفته میشوند."
msgid "For the ``'F'`` and ``'D'`` format characters, the packed representation uses the IEEE 754 binary32 and binary64 format for components of the complex number, regardless of the floating-point format used by the platform. Note that complex types (``F`` and ``D``) are available unconditionally, despite complex types being an optional feature in C. As specified in the C11 standard, each complex type is represented by a two-element C array containing, respectively, the real and imaginary parts."
msgstr "برای نویسههای قالب ``'F'`` و ``'D'``، نمایش فشرده از قالب IEEE 754 binary32 و binary64 برای کامپوننتهای عدد مختلط استفاده میکند، صرفنظر از قالب ممیز شناور استفادهشده توسط سکو. توجه داشته باشید که انواع مختلط (``F`` و ``D``) بهطور غیرمشروط در دسترس هستند، با وجود اینکه انواع مختلط یک ویژگی اختیاری در C هستند. همانطور که در استاندارد C11 مشخص شده است، هر نوع مختلط بهصورت یک آرایه C دو عنصری نمایش داده میشود که بهترتیب شامل بخش حقیقی و بخش موهومی است."
msgid "A format character may be preceded by an integral repeat count. For example, the format string ``'4h'`` means exactly the same as ``'hhhh'``."
msgstr "میتوان پیش از یک نویسه قالب، یک تعداد تکرار صحیح قرار داد. برای مثال، رشته قالب ``'4h'`` دقیقاً همان معنای ``'hhhh'`` را دارد."
msgid "Whitespace characters between formats are ignored; a count and its format must not contain whitespace though."
msgstr "نویسههای فضای سفید بین قالبها نادیده گرفته میشوند؛ هرچند یک تعداد و قالب آن نباید شامل فضای سفید باشند."
msgid "When packing a value ``x`` using one of the integer formats (``'b'``, ``'B'``, ``'h'``, ``'H'``, ``'i'``, ``'I'``, ``'l'``, ``'L'``, ``'q'``, ``'Q'``), if ``x`` is outside the valid range for that format then :exc:`struct.error` is raised."
msgstr "هنگام بستهبندی (packing) یک مقدار ``x`` با استفاده از یکی از قالبهای عدد صحیح (``'b'``، ``'B'``، ``'h'``، ``'H'``، ``'i'``، ``'I'``، ``'l'``، ``'L'``، ``'q'``، ``'Q'``)، اگر ``x`` خارج از محدوده معتبر برای آن قالب باشد، :exc:`struct.error` پرتاب میشود."
msgid "Previously, some of the integer formats wrapped out-of-range values and raised :exc:`DeprecationWarning` instead of :exc:`struct.error`."
msgstr "پیشتر، برخی از قالبهای عدد صحیح مقادیر خارج از محدوده را دور میزدند و بهجای :exc:`struct.error`، :exc:`DeprecationWarning` ایجاد میکردند."
msgid "For the ``'?'`` format character, the return value is either :const:`True` or :const:`False`. When packing, the truth value of the argument object is used. Either 0 or 1 in the native or standard bool representation will be packed, and any non-zero value will be ``True`` when unpacking."
msgstr "برای نویسهی قالب ``'?'``، مقدار بازگشتی یا :const:`True` است یا :const:`False`. هنگام بستهبندی، از مقدار درستی شیء آرگومان استفاده میشود. یکی از مقادیر ۰ یا ۱ در نمایش بولی بومی یا استاندارد بستهبندی میشود، و هر مقدار غیرصفر هنگام واگشایی ``True`` خواهد بود."
msgid "Examples"
msgstr "مثالها"
msgid "Native byte order examples (designated by the ``'@'`` format prefix or lack of any prefix character) may not match what the reader's machine produces as that depends on the platform and compiler."
msgstr "مثالهای ترتیب بایتهای بومی (native byte order) (که با پیشوند قالب ``'@'`` یا فقدان هر نویسهی پیشوند مشخص میشوند) ممکن است با آنچه دستگاه خواننده تولید میکند مطابقت نداشته باشند، زیرا این امر به سکو و کامپایلر بستگی دارد."
msgid "Pack and unpack integers of three different sizes, using big endian ordering::"
msgstr "بستهبندی و واگشایی اعداد صحیح در سه اندازهی مختلف، با استفاده از ترتیب بایتبزرگ (big endian)::"
msgid ""
">>> from struct import *\n"
">>> pack(\">bhl\", 1, 2, 3)\n"
"b'\\x01\\x00\\x02\\x00\\x00\\x00\\x03'\n"
">>> unpack('>bhl', b'\\x01\\x00\\x02\\x00\\x00\\x00\\x03')\n"
"(1, 2, 3)\n"
">>> calcsize('>bhl')\n"
"7"
msgstr ""
">>> from struct import *\n"
">>> pack(\">bhl\", 1, 2, 3)\n"
"b'\\x01\\x00\\x02\\x00\\x00\\x00\\x03'\n"
">>> unpack('>bhl', b'\\x01\\x00\\x02\\x00\\x00\\x00\\x03')\n"
"(1, 2, 3)\n"
">>> calcsize('>bhl')\n"
"7"
msgid "Attempt to pack an integer which is too large for the defined field::"
msgstr "تلاش برای بستهبندی یک عدد صحیح که برای فیلد تعریفشده بیش از حد بزرگ است::"
msgid ""
">>> pack(\">h\", 99999)\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
"struct.error: 'h' format requires -32768 <= number <= 32767"
msgstr ""
">>> pack(\">h\", 99999)\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
"struct.error: 'h' format requires -32768 <= number <= 32767"
msgid "Demonstrate the difference between ``'s'`` and ``'c'`` format characters::"
msgstr "نمایش تفاوت بین نویسههای قالببندی ``'s'`` و ``'c'``::"
msgid ""
">>> pack(\"@ccc\", b'1', b'2', b'3')\n"
"b'123'\n"
">>> pack(\"@3s\", b'123')\n"
"b'123'"
msgstr ""
">>> pack(\"@ccc\", b'1', b'2', b'3')\n"
"b'123'\n"
">>> pack(\"@3s\", b'123')\n"
"b'123'"
msgid "Unpacked fields can be named by assigning them to variables or by wrapping the result in a named tuple::"
msgstr "میتوان فیلدهای واگشاییشده را با انتساب آنها به متغیرها یا با قرار دادن نتیجه در یک تاپل نامدار (named tuple) نامگذاری کرد::"
msgid ""
">>> record = b'raymond \\x32\\x12\\x08\\x01\\x08'\n"
">>> name, serialnum, school, gradelevel = unpack('<10sHHb', record)\n"
"\n"
">>> from collections import namedtuple\n"
">>> Student = namedtuple('Student', 'name serialnum school gradelevel')\n"
">>> Student._make(unpack('<10sHHb', record))\n"
"Student(name=b'raymond ', serialnum=4658, school=264, gradelevel=8)"
msgstr ""
">>> record = b'raymond \\x32\\x12\\x08\\x01\\x08'\n"
">>> name, serialnum, school, gradelevel = unpack('<10sHHb', record)\n"
"\n"
">>> from collections import namedtuple\n"
">>> Student = namedtuple('Student', 'name serialnum school gradelevel')\n"
">>> Student._make(unpack('<10sHHb', record))\n"
"Student(name=b'raymond ', serialnum=4658, school=264, gradelevel=8)"
msgid "The ordering of format characters may have an impact on size in native mode since padding is implicit. In standard mode, the user is responsible for inserting any desired padding. Note in the first ``pack`` call below that three NUL bytes were added after the packed ``'#'`` to align the following integer on a four-byte boundary. In this example, the output was produced on a little endian machine::"
msgstr "ترتیب نویسههای قالب ممکن است در حالت بومی بر اندازه تأثیر بگذارد، زیرا پرکننده (padding) ضمنی است. در حالت استاندارد، کاربر مسئول درج هرگونه پرکننده دلخواه است. توجه داشته باشید که در اولین فراخوانی ``pack`` در زیر، ۳ بایت NUL پس از ``'#'`` بستهبندیشده اضافه شدند تا عدد صحیح بعدی روی مرز ۴ بایتی تراز شود. در این مثال، خروجی روی یک ماشین با ترتیب بایت کمارزش در ابتدا (little endian) تولید شده است::"
msgid ""
">>> pack('@ci', b'#', 0x12131415)\n"
"b'#\\x00\\x00\\x00\\x15\\x14\\x13\\x12'\n"
">>> pack('@ic', 0x12131415, b'#')\n"
"b'\\x15\\x14\\x13\\x12#'\n"
">>> calcsize('@ci')\n"
"8\n"
">>> calcsize('@ic')\n"
"5"
msgstr ""
">>> pack('@ci', b'#', 0x12131415)\n"
"b'#\\x00\\x00\\x00\\x15\\x14\\x13\\x12'\n"
">>> pack('@ic', 0x12131415, b'#')\n"
"b'\\x15\\x14\\x13\\x12#'\n"
">>> calcsize('@ci')\n"
"8\n"
">>> calcsize('@ic')\n"
"5"
msgid "The following format ``'llh0l'`` results in two pad bytes being added at the end, assuming the platform's longs are aligned on 4-byte boundaries::"
msgstr "قالب زیر ``'llh0l'`` منجر به افزوده شدن دو بایت پرکننده (pad bytes) در انتها میشود، با فرض تراز بودن نوع long پلتفرم روی مرزهای ۴ بایتی::"
msgid ""
">>> pack('@llh0l', 1, 2, 3)\n"
"b'\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x03\\x00\\x00'"
msgstr ""
">>> pack('@llh0l', 1, 2, 3)\n"
"b'\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x03\\x00\\x00'"
msgid "Module :mod:`array`"
msgstr "ماژول :mod:`array`"
msgid "Packed binary storage of homogeneous data."
msgstr "ذخیرهسازی دودویی فشرده از دادههای همگن."
msgid "Module :mod:`json`"
msgstr "ماژول :mod:`json`"
msgid "JSON encoder and decoder."
msgstr "کدگذار و کدگشای JSON."
msgid "Module :mod:`pickle`"
msgstr "ماژول :mod:`pickle`"
msgid "Python object serialization."
msgstr "سریالسازی شیء پایتون."
msgid "Applications"
msgstr "برنامههای کاربردی"
msgid "Two main applications for the :mod:`!struct` module exist, data interchange between Python and C code within an application or another application compiled using the same compiler (:ref:`native formats<struct-native-formats>`), and data interchange between applications using agreed upon data layout (:ref:`standard formats<struct-standard-formats>`). Generally speaking, the format strings constructed for these two domains are distinct."
msgstr "دو کاربرد اصلی برای ماژول :mod:`!struct` وجود دارند: تبادل داده بین کد پایتون و C در یک برنامه یا برنامهای دیگر که با همان کامپایلر کامپایل شده است (:ref:`قالبهای بومی <struct-native-formats>`)، و تبادل داده بین برنامههایی که از چیدمان دادهی مورد توافق استفاده میکنند (:ref:`قالبهای استاندارد <struct-standard-formats>`). بهطور کلی، رشتههای قالب ساختهشده برای این دو حوزه با یکدیگر تفاوت دارند."
msgid "Native Formats"
msgstr "قالبهای بومی"
msgid "When constructing format strings which mimic native layouts, the compiler and machine architecture determine byte ordering and padding. In such cases, the ``@`` format character should be used to specify native byte ordering and data sizes. Internal pad bytes are normally inserted automatically. It is possible that a zero-repeat format code will be needed at the end of a format string to round up to the correct byte boundary for proper alignment of consecutive chunks of data."
msgstr "هنگام ساخت رشتههای قالب که چیدمانهای بومی را تقلید میکنند، کامپایلر و معماری ماشین ترتیب بایتها و پرکنندهگذاری را تعیین میکنند. در چنین مواردی، باید از نویسهی قالب ``@`` برای مشخص کردن ترتیب بایت بومی و اندازههای داده استفاده شود. بایتهای پرکننده داخلی معمولاً بهطور خودکار درج میشوند. ممکن است در انتهای یک رشته قالب به یک کد پیشساخته با تکرار صفر نیاز باشد تا به مرز بایت صحیح گرد شود و تراز مناسب تکههای متوالی داده فراهم گردد."
msgid "Consider these two simple examples (on a 64-bit, little-endian machine)::"
msgstr "این دو مثال ساده را در نظر بگیرید (روی یک ماشین ۶۴بیتی، کوچکاندیان)::"
msgid ""
">>> calcsize('@lhl')\n"
"24\n"
">>> calcsize('@llh')\n"
"18"
msgstr ""
">>> calcsize('@lhl')\n"
"24\n"
">>> calcsize('@llh')\n"
"18"
msgid "Data is not padded to an 8-byte boundary at the end of the second format string without the use of extra padding. A zero-repeat format code solves that problem::"
msgstr "بدون استفاده از پد (padding) اضافی، دادهها در انتهای دومین رشتهی قالب تا یک مرز ۸ بایتی پد نمیشوند. یک کد قالب با تکرار صفر این مشکل را حل میکند::"
msgid ""
">>> calcsize('@llh0l')\n"
"24"
msgstr ""
">>> calcsize('@llh0l')\n"
"24"
msgid "The ``'x'`` format code can be used to specify the repeat, but for native formats it is better to use a zero-repeat format like ``'0l'``."
msgstr "میتوانید از کد قالب ``'x'`` برای مشخص کردن تعداد تکرار استفاده کنید، اما برای قالبهای بومی بهتر است از یک قالب با تکرار صفر مانند ``'0l'`` استفاده کنید."
msgid "By default, native byte ordering and alignment is used, but it is better to be explicit and use the ``'@'`` prefix character."
msgstr "بهطور پیشفرض، از ترتیب بایتها و ترازبندی بومی استفاده میشود، اما بهتر است صریح باشید و از نویسهی پیشوند ``'@'`` استفاده کنید."
msgid "Standard Formats"
msgstr "قالبهای استاندارد"
msgid "When exchanging data beyond your process such as networking or storage, be precise. Specify the exact byte order, size, and alignment. Do not assume they match the native order of a particular machine. For example, network byte order is big-endian, while many popular CPUs are little-endian. By defining this explicitly, the user need not care about the specifics of the platform their code is running on. The first character should typically be ``<`` or ``>`` (or ``!``). Padding is the responsibility of the programmer. The zero-repeat format character won't work. Instead, the user must explicitly add ``'x'`` pad bytes where needed. Revisiting the examples from the previous section, we have::"
msgstr "هنگام تبادل داده فراتر از فرایند خود، مانند شبکه یا ذخیرهسازی، دقیق باشید. ترتیب بایت، اندازه و ترازبندی را دقیقاً مشخص کنید. فرض نکنید که آنها با ترتیب بومی یک ماشین خاص مطابقت دارند. برای مثال، ترتیب بایت شبکه بزرگاندیان (big-endian) است، در حالی که بسیاری از پردازندههای رایج کوچکاندیان (little-endian) هستند. با تعریف صریح این موارد، نیازی نیست کاربر به جزئیات سکویی که کدش روی آن اجرا میشود توجه کند. اولین نویسه معمولاً باید ``<`` یا ``>`` (یا ``!``) باشد. مسئولیت پر کردن (padding) بر عهدهی برنامهنویس است. نویسهی قالب با تکرار صفر کار نمیکند. در عوض، کاربر باید بهصراحت بایتهای پرکنندهی ``'x'`` را در صورت نیاز اضافه کند. با مرور مثالهای بخش پیشین، داریم::"
msgid ""
">>> calcsize('<qh6xq')\n"
"24\n"
">>> pack('<qh6xq', 1, 2, 3) == pack('@lhl', 1, 2, 3)\n"
"True\n"
">>> calcsize('@llh')\n"
"18\n"
">>> pack('@llh', 1, 2, 3) == pack('<qqh', 1, 2, 3)\n"
"True\n"
">>> calcsize('<qqh6x')\n"
"24\n"
">>> calcsize('@llh0l')\n"
"24\n"
">>> pack('@llh0l', 1, 2, 3) == pack('<qqh6x', 1, 2, 3)\n"
"True"
msgstr ""
">>> calcsize('<qh6xq')\n"
"24\n"
">>> pack('<qh6xq', 1, 2, 3) == pack('@lhl', 1, 2, 3)\n"
"True\n"
">>> calcsize('@llh')\n"
"18\n"
">>> pack('@llh', 1, 2, 3) == pack('<qqh', 1, 2, 3)\n"
"True\n"
">>> calcsize('<qqh6x')\n"
"24\n"
">>> calcsize('@llh0l')\n"
"24\n"
">>> pack('@llh0l', 1, 2, 3) == pack('<qqh6x', 1, 2, 3)\n"
"True"
msgid "The above results (executed on a 64-bit machine) aren't guaranteed to match when executed on different machines. For example, the examples below were executed on a 32-bit machine::"
msgstr "تضمین نمیشود که نتایج بالا (اجراشده روی یک ماشین ۶۴ بیتی) هنگام اجرا روی ماشینهای مختلف مطابقت داشته باشند. برای مثال، مثالهای زیر روی یک ماشین ۳۲ بیتی اجرا شدهاند::"
msgid ""
">>> calcsize('<qqh6x')\n"
"24\n"
">>> calcsize('@llh0l')\n"
"12\n"
">>> pack('@llh0l', 1, 2, 3) == pack('<qqh6x', 1, 2, 3)\n"
"False"
msgstr ""
">>> calcsize('<qqh6x')\n"
"24\n"
">>> calcsize('@llh0l')\n"
"12\n"
">>> pack('@llh0l', 1, 2, 3) == pack('<qqh6x', 1, 2, 3)\n"
"False"
msgid "Classes"
msgstr "کلاسها"
msgid "The :mod:`!struct` module also defines the following type:"
msgstr "ماژول :mod:`!struct` همچنین نوع زیر را تعریف میکند:"
msgid "Return a new Struct object which writes and reads binary data according to the format string *format*. Creating a ``Struct`` object once and calling its methods is more efficient than calling module-level functions with the same format since the format string is only compiled once."
msgstr "یک شیء Struct جدید برمیگرداند که دادههای دودویی را بر اساس رشته قالب *format* مینویسد و میخواند. ایجاد یک شیء ``Struct`` بهصورت یکبار و فراخوانی متدهای آن کارآمدتر از فراخوانی توابع سطح ماژول با همان قالب است، زیرا رشته قالب تنها یکبار کامپایل میشود."
msgid "The compiled versions of the most recent format strings passed to the module-level functions are cached, so programs that use only a few format strings needn't worry about reusing a single :class:`Struct` instance."
msgstr "نسخههای کامپایلشدهی آخرین رشتههای قالب ارسالشده به توابع سطح ماژول در نهانگاه ذخیره میشوند، بنابراین برنامههایی که تنها از چند رشتهی قالب استفاده میکنند، نیازی نیست نگران استفادهی مجدد از یک نمونه از :class:`Struct` باشند."
msgid "Compiled Struct objects support the following methods and attributes:"
msgstr "اشیای Struct کامپایلشده از متدها و ویژگیهای زیر پشتیبانی میکنند:"
msgid "Identical to the :func:`pack` function, using the compiled format. (``len(result)`` will equal :attr:`size`.)"
msgstr "یکسان با تابع :func:`pack`، با استفاده از قالب کامپایلشده. (``len(result)`` برابر با :attr:`size` خواهد بود.)"
msgid "Identical to the :func:`pack_into` function, using the compiled format."
msgstr "کاملاً مشابه تابع :func:`pack_into`، با استفاده از قالب کامپایلشده."
msgid "Identical to the :func:`unpack` function, using the compiled format. The buffer's size in bytes must equal :attr:`size`."
msgstr "دقیقاً مانند تابع :func:`unpack`، با استفاده از قالب کامپایلشده. اندازهی بافر بر حسب بایت باید برابر با :attr:`size` باشد."
msgid "Identical to the :func:`unpack_from` function, using the compiled format. The buffer's size in bytes, starting at position *offset*, must be at least :attr:`size`."
msgstr "کاملاً مشابه تابع :func:`unpack_from` است و از قالب کامپایلشده استفاده میکند. اندازه بافر بر حسب بایت، از موقعیت *offset* به بعد، باید حداقل :attr:`size` باشد."
msgid "Identical to the :func:`iter_unpack` function, using the compiled format. The buffer's size in bytes must be a multiple of :attr:`size`."
msgstr "یکسان با تابع :func:`iter_unpack`، با استفاده از قالب کامپایلشده. اندازهی بافر بر حسب بایت باید مضربی از :attr:`size` باشد."
msgid "The format string used to construct this Struct object."
msgstr "رشته قالب استفادهشده برای ساخت این شیء Struct."
msgid "The format string type is now :class:`str` instead of :class:`bytes`."
msgstr "نوع رشتهی قالببندی اکنون :class:`str` است، نه :class:`bytes`."
msgid "The calculated size of the struct (and hence of the bytes object produced by the :meth:`pack` method) corresponding to :attr:`format`."
msgstr "اندازهی محاسبهشدهی ساختار (و بنابراین اندازهی شیء bytes تولیدشده بهوسیلهی متد :meth:`pack`) متناظر با :attr:`format`."
msgid "The *repr()* of structs has changed. It is now:"
msgstr "نمایش *repr()* ساختارها تغییر کرده است. اکنون به این صورت است:"
msgid "C"
msgstr "C"
msgid "structures"
msgstr "ساختارها"
msgid "packing"
msgstr "بستهبندی"
msgid "binary"
msgstr "دودویی"
msgid "data"
msgstr "داده"
msgid "@ (at)"
msgstr "@ (at)"
msgid "in struct format strings"
msgstr "در رشتههای قالب struct"
msgid "= (equals)"
msgstr "= (برابر)"
msgid "< (less)"
msgstr "< (کمتر)"
msgid "> (greater)"
msgstr "> (بزرگتر)"
msgid "! (exclamation)"
msgstr "! (علامت تعجب)"
msgid "? (question mark)"
msgstr "? (علامت سؤال)"