ترفندهای برنامه‌نویسی
163 subscribers
27 photos
3 videos
22 files
615 links
Download Telegram
Note: In Python 2.x, filter() returns list objects. This behavior changed in Python 3.x. Now the function returns a filter object, which is an iterator that yields items on demand. Python iterators are well known to be memory efficient.
Note There is a subtlety when the sequence is being modified by the loop (this can only occur for mutable sequences, e.g. lists). An internal counter is used to keep track of which item is used next, and this is incremented on each iteration. When this counter has reached the length of the sequence the loop terminates. This means that if the suite deletes the current (or a previous) item from the sequence, the next item will be skipped (since it gets the index of the current item which has already been treated). Likewise, if the suite inserts an item in the sequence before the current item, the current item will be treated again the next time through the loop. This can lead to nasty bugs that can be avoided by making a temporary copy using a slice of the whole sequence, e.g.,
for x in a[:]:
if x < 0: a.remove(x)
سلام دوستان، دوتا عکس از یک کد براتون میفرستم، ببخشید که تایپش نکردم.
سه تا پکیج هست نصب میکنید
بعد عکس دیگری کدهای داخل یه فایل sh. هست. اونم بنویسید و ذخیره کنید
بعد از توی دسکتاپ مثلا sytemsettings5 برای kde یا ستینگز گنوم یک کیبورد شورت‌کات اختصاص میدین که با زدنش اسکریپت نوشته شده (یعنی همین فایل) اجرا بشه.

حالا این چی هست؟ این یک پاپ‌آپ باز میکنه که آخرین متنی که کپی کرده باشین و توی کلیپ‌بوردتون باشه رو براتون با استفاده از گوگل‌ترنسلیت ترجمه میکنه😄. یعنی یه متن رو انتخاب میکنید کنترل+سی و بعد شورت‌کات خودتون رو بزنید ترجمه‌ش رو می‌بینید