TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #281 · 18 авг.

Что-то вы гоните насчет "привычного вида формата 755 и 644". Я вот вообще не понял что это!😳 Действительно, что означают цифры которые мы получили в прошлом посте? Это кодировка, заключающая в себе режимы доступа к файлу. Подробней можно почитать в статье про chmod. Там можно увидеть альтернативное обозначение того же самого с помощью символов r w x, что значит чтение, запись, исполнение. Чтобы преобразовать восьмеричное число в такое обозначение в Python есть готовая функция >>> stat.filemode(0o755) '?rwxr-xr-x' Мы видим 3 группы по 3 символа, дающие 3 типа доступа для 3 типов юзеров. А что за знак вопроса в начале? Давайте передадим в эту функцию необрезанное значение от os.stat >>> stat.filemode(os.stat(path).st_mode) 'drwxr-xr-x' Это данные, которые мы безжалостно обрезали в прошлый раз😼 Первый символ обозначает тип объекта. Это может быть файл (-), директория (d) или симлинк (l). Вот простая схема данной кодировки [1][3][3][3] │ │ │ │ │ │ │ └──> Others Permissions │ │ └─────> Group Permissions │ └────────> Owner Permissions └───────────> File Type (разверните экран если вы с телефона) Если вы попробуете получить пермишены для симлинка то получите пермишены для файла >>> path = '.venv/bin/python3' >>> stat.filemode(os.stat(path).st_mode) '-rwxr-xr-x' Чтобы получить свойства именно симлинка, нужно это явно указать >>> stat.filemode(os.stat(path, follow_symlinks=False).st_mode) 'lrwxrwxrwx' #tricks#basic

Резултати

Пронајдени 3 слични објави

Пребарај: #truewisdom

当前筛选 #truewisdom清除筛选
1 English learning materials

@englishmeta1 · Post #250 · 26.06.2024 г., 10:40

Question ppl ask me often How can I improve my writing skills? Here is my reply Improving your writing skills is a valuable endeavor that can benefit you in many areas of life. Here are several strategies you can use to become a better writer: 1. Read Regularly: - Diverse Materials: Read a variety of genres, including fiction, non-fiction, journalism, and academic papers. This exposes you to different styles and vocabularies. - Analyzing: Pay attention to how authors construct sentences, develop ideas, and build arguments. Reflect on what makes their writing effective or ineffective. 2. Write Daily: - Journaling: Keep a daily journal to practice writing regularly. It doesn’t have to be formal; the goal is to make writing a habit. - Prompts: Use writing prompts to challenge yourself and spark creativity. Websites and books often offer daily prompts. 3. Learn the Basics: - Grammar and Syntax: Brush up on grammar and syntax rules. Resources like "The Elements of Style" by Strunk and White can be very useful. - Vocabulary: Expand your vocabulary through reading and using tools like a thesaurus. 4. Seek Feedback: - Peer Review: Share your writing with friends, colleagues, or writing groups to get constructive feedback. - Professional Feedback: Consider hiring a writing coach or taking a writing course. 5. Revise and Edit: - Multiple Drafts: Don’t be afraid to write multiple drafts. Revision is a crucial part of the writing process. - Editing: Learn to edit your work critically. Look for clarity, coherence, conciseness, and correctness. 6. Study Writing Techniques: - Workshops and Courses: Enroll in writing workshops or online courses. Websites like Coursera, Udemy, and edX offer courses on various aspects of writing. - Books on Writing: Read books about writing, such as "On Writing" by Stephen King or "Bird by Bird" by Anne Lamott. 7. Practice Different Styles: - Genres: Experiment with different genres (e.g., poetry, essays, short stories, technical writing) to find your strengths and preferences. - Perspectives: Write from different perspectives and in various voices to develop versatility. 8. Use Writing Tools: - Software: Use tools like Grammarly, Hemingway Editor, or ProWritingAid to help with grammar and style. - Outlining: Use outlining tools to organize your thoughts before you start writing. 9. Stay Motivated: - Set Goals: Set specific, achievable writing goals (e.g., write 500 words a day, complete a short story in a month). - Celebrate Progress: Acknowledge and celebrate your progress to stay motivated. 10. Read Aloud: - Hearing Your Writing: Reading your work aloud can help you catch errors and awkward phrasing that you might miss when reading silently. Improving your writing skills is a continuous process, and persistence is key. By integrating these strategies into your routine, you'll gradually become a more confident and effective writer. #sirjimmy#teamjimmy#writingskills#englishmadeeasy#truewisdom

English With Natives*

@sirjimmy · Post #31107 · 26.06.2024 г., 08:19

Question ppl ask me often How can I improve my writing skills? Here is my reply Improving your writing skills is a valuable endeavor that can benefit you in many areas of life. Here are several strategies you can use to become a better writer: 1. Read Regularly: - Diverse Materials: Read a variety of genres, including fiction, non-fiction, journalism, and academic papers. This exposes you to different styles and vocabularies. - Analyzing: Pay attention to how authors construct sentences, develop ideas, and build arguments. Reflect on what makes their writing effective or ineffective. 2. Write Daily: - Journaling: Keep a daily journal to practice writing regularly. It doesn’t have to be formal; the goal is to make writing a habit. - Prompts: Use writing prompts to challenge yourself and spark creativity. Websites and books often offer daily prompts. 3. Learn the Basics: - Grammar and Syntax: Brush up on grammar and syntax rules. Resources like "The Elements of Style" by Strunk and White can be very useful. - Vocabulary: Expand your vocabulary through reading and using tools like a thesaurus. 4. Seek Feedback: - Peer Review: Share your writing with friends, colleagues, or writing groups to get constructive feedback. - Professional Feedback: Consider hiring a writing coach or taking a writing course. 5. Revise and Edit: - Multiple Drafts: Don’t be afraid to write multiple drafts. Revision is a crucial part of the writing process. - Editing: Learn to edit your work critically. Look for clarity, coherence, conciseness, and correctness. 6. Study Writing Techniques: - Workshops and Courses: Enroll in writing workshops or online courses. Websites like Coursera, Udemy, and edX offer courses on various aspects of writing. - Books on Writing: Read books about writing, such as "On Writing" by Stephen King or "Bird by Bird" by Anne Lamott. 7. Practice Different Styles: - Genres: Experiment with different genres (e.g., poetry, essays, short stories, technical writing) to find your strengths and preferences. - Perspectives: Write from different perspectives and in various voices to develop versatility. 8. Use Writing Tools: - Software: Use tools like Grammarly, Hemingway Editor, or ProWritingAid to help with grammar and style. - Outlining: Use outlining tools to organize your thoughts before you start writing. 9. Stay Motivated: - Set Goals: Set specific, achievable writing goals (e.g., write 500 words a day, complete a short story in a month). - Celebrate Progress: Acknowledge and celebrate your progress to stay motivated. 10. Read Aloud: - Hearing Your Writing: Reading your work aloud can help you catch errors and awkward phrasing that you might miss when reading silently. Improving your writing skills is a continuous process, and persistence is key. By integrating these strategies into your routine, you'll gradually become a more confident and effective writer. #sirjimmy#teamjimmy#writingskills#englishmadeeasy#truewisdom