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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #411 · 9 фев.

reload_flag="" if [[ -n "${DEBUG}" ]]; then reload_flag="--reload" fi if [[ -n "${WORKER_COUNT}" ]]; then workers=${WORKER_COUNT} else workers=2 fi gunicorn --workers ${workers} \ --bind 0.0.0.0:8000 \ ${reload_flag} main.wsgi Писали такие конструкции чтобы проверить наличие флага и сформировать команду правильно? На самом деле можно сделать тоже самое проще. Для этого используются операторы условной подстановки, доступные в оболочках семейства POSIX. :- для установки значений по умолчанию ${WORKER_COUNT:-2} Если переменная не объявлена, то будет дефолтное значение 2. :+ подставляет указанный текст, если переменная не пуста ${DEBUG:+--reload} Если что-то есть в переменной то распечатается текст после символа +, в противном случае - ничего. Удобно для опциональных флагов, как в нашем примере. Итого наш скрипт может выглядеть так: gunicorn --workers ${WORKER_COUNT:-2} \ --bind 0.0.0.0:8000 \ ${DEBUG:+--reload} main.wsgi Есть еще два оператора. := не только подставить дефолтное значение, но и присвоить его переменной, если она пуста # никаких переменных еще нет VAL1=${VAL2:=hello} # теперь доступны обе echo $VAL1 $VAL2 # hello hello :? остановить выполнение с ошибкой, если переменной нет. echo ${MISS:?is required} bash: MISS: is required Код выхода будет 1. #tricks#linux

Резултати

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

Пребарај: #commonmistakes

当前筛选 #commonmistakes清除筛选
Journey to Fluency

@fluencyinenglish · Post #7812 · 01.12.2020 г., 20:11

#commonmistakes @fluencyinenglish 💎چند نمونه اشتباه رایچ که خیلی از دوستان مرتکبش میشن رو در اینجا بررسی میکنیم 1⃣هیچ وقت نگید : Praise for her بگید : Praise her 2⃣هیچ وقت نگید : clap to him بگید : clap him 3⃣هیچ وقت نگید : applaud for him بگید :applaud him 4⃣هیچ وقت نگید : Thank for you بگید : Thank you 5⃣هیچ وقت نگید : I respect for him بگید : I respect him 6⃣هیچ وقت نگید : Pray to him بگید : Pray him 7⃣هیچ وقت نگید : Greet for them بگید : Greet them 8⃣هیچ وقت نگید : Speak for her بگید : Speak her 9⃣هیچ وقت نگید :Congratulate for him بگید : Congratulate him 🔟 هیچ وقت نگید :Write for him بگید : Write him @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #7403 · 07.11.2019 г., 04:45

#commonmistakes @fluencyinenglish ⚪️At the beginning and in the beginning⚪️ 💎برای بیانِ چیزی که درست در شروع یک رویدادی خاص یا در دوره‌ای معین اتفاق می‌افتد از عبارتِ at the beginning of استفاده می‌کنیم: 🔵 At the beginning of the Civil War Fort Sumter was attacked. 🔵 There's a car chase at the beginning (= at the start of the film). 💎 از عبارتِ in the beginning وقتی استفاده می‌کنیم که بخواهیم بگوییم چیزی در مراحلِ آغازینِ یک رخداد یا در آغازِ دوره‌ای طولانی‌تر اتفاق افتاده است: 🔵 In the beginning the South had some success. (یعنی در اوایلِ جنگِ داخلی) 🔵 I was too shy to speak to her in the beginning. (یعنی در چند ملاقاتِ اولیه‌مان) 💎 باید توجه داشت که پس از in the beginning حرفِ اضافه‌ی of به‌کار نمی‌رود. 💎 کلمه‌ی beginning با دو حرفِ n نوشته می‌شود. @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #7248 · 21.07.2019 г., 05:08

#commonmistakes @fluencyinenglish ❇️In comparing two things, the Comparative should be used, The Superlative should not be used. هنگام‌ مقایسه ۲ چیز، از صفات تفضیلی یا همان comparative به کار ببرید. از کاربرد صفات عالی یا همان superlative در این مواقع استفاده نکنید. ❌ Which is the best of the two? ✅ Which is the better of the two? ___________________________ ❇️When two qualities of the same person or thing are compared, the Comparative in 'er' is not used. 'More' is used for this purpose. وقتی خصوصیات یک فرد و یا چیزی را مقایسه می کنیم، بایستی از "more" به جای"er" استفاده کنیم. ❌ He is wiser than brave. ✅ He is more wise than brave. ___________________________ در هنگام استفاده از صفات تفضیلی، بایستی‌مقایسه را با زیر‌ ‌مجموعه های هر دسته بکار‌ببریم. ❌ He is cleverer than any boy in the class. ✅ He is cleverer than any other boy in the class. ___________________________ در هنگام ‌استفاده از صفات عالی، بایستی مقایسه را با دسته اصلی هر موردی‌ بکار‌ببریم. ❌ He is the strongest of all other men. ✅ He is the strongest of all men. __________________________ ❇️Guard against, not from. ❌ : You must guard from bad habits. ✅ : You must guard against bad habits. __________________________ ❇️Omission of the personal pronoun before the infinitive. ❌ I want to tell me the truth. ✅ I want you to tell me the truth. ▪️Express the subject of the infinitive after verbs like want, like, wish, etc , if it is different from that of the main verb. @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #7218 · 03.07.2019 г., 03:54

#commonmistakes @fluencyinenglish ⚪️Succeed in + -ing. ❌: Paula succeeded to win the prize. ✅: Paula succeeded in winning the prize. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ ⚪️Take an exam, not give an exam. ❌ : The pupil gave his exam. ✅ : The pupil took his exam. 🔵Note: The teacher gives or sets the exam. The student takes the exam or sits the exam. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ ⚪️To be right or wrong, not to have right or wrong. ❌ : You've right or You've wrong. ✅ : You're right or You're wrong. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ ⚪️Succeed in, not at. ❌ : I hope he'll succeed at his work. ✅ : I hope he'll succeed in his work. 🔵Note: A person succeeds to a property, a title, or an office: Queen Elizabeth II succeeded to the throne in 1952. Also one person can succeed another. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ ⚪️To be busy, not to have work. ❌ : I have much work this morning. ✅ : I'm very busy this morning. 🔵Note: We can say: I have a lot of work to do this morning. @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #7105 · 11.05.2019 г., 12:48

#commonmistakes @fluencyinenglish Too much or Very much? 🔴 She likes the cinema too much. He's too much stronger than I am. ✅ She likes the cinema very much. He's very much stronger than I am. 🔵🔵 Use very much instead of much for greater emphasis. Too much denotes an excessive quantity or degree: She ate too much, and felt ill. @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #6974 · 19.03.2019 г., 09:10

#commonmistakes @fluencyinenglish 👉Go on (continue) + -ing. ❌: The music went on to play all day. ✅: The music went on playing ail day. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ 👉Mind (object to) + -ing. ❌: Would you mind to open the door? ✅: Would you mind opening the door? ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ 👉Practise + -ing. ❌: You must practise to speak English. ✅: You must practise speaking English. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ 👉Remember + -ing. ❌: I don't remember to have seen him. ✅: I don't remember seeing him. Or: ✅I don't remember having seen him. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ 👉Risk + -ing. ❌: We couldn't risk to leave him alone. ✔️: We couldn't risk leaving him alone. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ 👉Stop + -ing. ❌: The wind has almost stopped to blow. ✅: The wind has almost stopped blowing. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ 👉Busy+ -ing. ❌: He was busy to revise the exams. ✅: He was busy revising for the exams. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ 👉Worth + -ing. ❌: Is today's film worth to see? ✅: Is today's film worth seeing? @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #6892 · 22.02.2019 г., 05:11

#commonmistakes @fluencyinenglish Prepositions often confused: For for About ❌: The teacher spoke for bad habits. ✅: The teacher spoke about bad habits. Don't use "for" in the sense of "about". The chief use of "about" is to convey the idea of being in favour of. If we say that the teacher spoke for bad habits it's like saying that he/she spoke in favour of bad habits ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ Using who, whom, or which after the superlative, instead of that. ❌: It's the best which I've seen. ✅: It's the best (that) I've seen. Use the relative that (not who, whom, or which) after a superlative. It can, however, be omitted. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ Travel by train, etc., not with the train, etc: ❌: He traveled with the train yesterday. ✅: He traveled by train yesterday. Note: We say: by train, by boat, by plane, by bike; also, by land, by sea, by air, by bus; on a bus or in a bus; by car or in a car, by taxi or in a taxi; on horseback, on a donkey, on a bicycle; on foot. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ Conform to, not with. ❌ :'We must conform with the rules. ✅: We must conform to the rules. @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #6888 · 21.02.2019 г., 04:55

#commonmistakes @fluencyinenglish ❇️Uses of adverbs 'Much' is used before past participles and Adjectives or Adverbs of comparative degree. 'Very' is used before the present participles and Adjectives and Adverbs of positive degree. ❌ - The news is much surprising. ✅ - The news is very surprising. ❌ - I was very surprised at hearing the news. ✅ - I was much surprised at hearing the news. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ ❇️Prepositions often confused Beautiful for Handsome or Good-looking. ❌ : He's grown into a beautiful young man. ✅ : He's grown into a handsome young man. 👉We usually say that a man is handsome or good-looking, and that a woman is beautiful, lovely, good looking or pretty. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ ❇️Use of the gerund Object to + -ing. ❌ : I object to be treated like this. ✅: I object to being treated like this. ▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️▪️ ❇️Using the wrong preposition Repent of, not from. ❌ : He repented from his crime. ✅ : He repented of his crime. 👉Note: Repentance takes for: He fee/5 repentance for his sin. @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #7875 · 09.06.2025 г., 15:07

📚 Common Mistake | اشتباه رایج 🔹 Alone vs Lonely @fluencyinenglish 1️⃣ alone = without other people around you 👨‍🏫 کلمه‌ی alone یعنی کسی اطرافمان نیست و تنها هستیم، اما این لزوماً به معنی ناراحتی یا احساس بد نیست. ✅ Example: • I've thought about getting married, but I prefer living alone. من در مورد ازدواج کردن فکر کرده‌ام، اما تنهایی زندگی کردن را ترجیح می‌دهم. 🔸 Notice: "alone" is about the situation (physical), not about your feelings. @fluencyinenglish --- 2️⃣ lonely = feeling sad because you are alone 👨‍🏫 lonely یعنی تنها باشیم و احساس کنیم کسی به ما علاقه ندارد و مورد توجه نیستیم. ✅ Examples: • I didn't know anyone in Boston and felt very lonely. من هیچ کسی را در بوستون نمی‌شناختم و خیلی احساس تنهایی می‌کردم. • Sarah hated the long lonely days in the empty house. سارا از روزهای طولانی و تنهایی در آن خانه‌ی خالی متنفر بود. 🔸 Notice: "lonely" is about the emotion, not just the physical condition. 🔻 Incorrect Sentence: ❌ I was very alone at first but then I made some friends. 🔺 Corrected: ✅ I was very lonely at first but then I made some friends. من در ابتدا خیلی احساس تنهایی می‌کردم، اما بعد چند تا دوست پیدا کردم. 📌 Remember: "Alone" ≠ "Lonely" You can be alone and feel fine — or you can be lonely even in a crowd. 🎯 یادگیری دقیق تفاوت‌ها باعث می‌شه انگلیسی‌ات طبیعی‌تر باشه. @fluencyinenglish #EnglishTips#Vocabulary#CommonMistakes#WritingandGrammar#fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #7908 · 17.02.2026 г., 19:57

Difference Between “drop out” and “be dropped out” Many people make this mistake: ❌ I was dropped out This sentence is grammatically incorrect. The correct structure is: ✅ I dropped out. Meaning: I voluntarily left or withdrew from school/university. Why “was dropped out” is wrong “Drop out” is an intransitive verb. It does not take an object, so it cannot be used in the passive voice. ❌ You cannot say: I was dropped out of university. Because dropping out is something you do yourself. Correct Usage If it was your decision: I dropped out of university. If it wasn’t your decision: Use other verbs to express that: I was expelled from university. I was forced to leave university. @fluencyinenglish #EnglishGrammar#GrammarTips#DropOut#PassiveVoice#IntransitiveVerbs#IELTSGrammar#CommonMistakes#LearnEnglish#TEFL