Definitionپێناسە
The letters given to open() that say what a program will do with a : read (r, the default), write (w), append (a), create a new file (x), read and write (+), binary (b) or text (t, the default). The mode decides whether a missing file is created, whether old content is erased and where reading or writing starts.
ئەو پیتانەی دەدرێنە open() و دەڵێن چی لە دەکات: خوێندنەوە (r، بنەڕەتییەکە)، نووسین (w)، زیادکردن بۆ کۆتایی (a)، دروستکردنی نوێ (x)، خوێندنەوە و نووسین (+)، دووانی (b) یان دەق (t، بنەڕەتییەکە). دۆخەکە بڕیار دەدات ئایا نەبوو دروست دەکرێت، ئایا ناوەڕۆکی کۆن دەسڕدرێتەوە و خوێندنەوە یان نووسین لە کوێوە دەست پێ دەکات.
Exampleنموونە
"a" adds to the end and never erases; "w" erases the old content first.
"a" بۆ کۆتایی زیاد دەکات و هەرگیز ناسڕێتەوە؛ "w" سەرەتا ناوەڕۆکە کۆنەکە دەسڕێتەوە.
log = open("log.txt", "a", encoding="utf-8")Other Kurdish renderings in useوەرگێڕانە کوردییەکانی تر
دۆخی فایل، دۆخی کردنەوەکە، دۆخەکانی کردنەوە، دۆخێکی کردنەوە، دۆخی کردنەوەی
Note on the Kurdish termتێبینی دەربارەی زاراوە کوردییەکە
«دۆخ» for 'mode' as in the registry's dark mode «دۆخی تاریک»; «کردنەوە» because the mode is chosen when the file is opened. Proposed by the py-files writer (PYDW1).