@djangoproject · Post #151 · 03.09.2016 г., 18:42
https://jeffknupp.com/blog/2013/04/07/improve-your-python-yield-and-generators-explained/ Improve Your Python: '#yield' and #Generators Explained #asyncio
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #210 · 3 фев.
Что делать если нужно поставить какую-то Python-библиотеку а root-прав нет? То есть в систему библиотеку никак и ничего не поставить. Есть как минимум два способа это решить правильно! 🔸 Сделать виртуальное окружение и ставить там что угодно. Это позволит создать полностью независимое исполняемое окружение для ваших приложений. Все библиотеки будут храниться в домашней директории юзера а значит доступ на запись имеется. Создать очень просто: python3 -m venv ~/venvs/myenvname Теперь активируем окружение # Linux source ~/venvs/myenvname/bin/activate # Windows %userprofile%\venvs\myenvname\Scripts\activate.bat Можно ставить любые библиотеки и запускать приложение. Это стандартный метод работы с любым проектом. Если еще не используете его, то пора начинать. Даже при наличии root доступа! 🔸 Бывает, что нет возможности запустить приложение из своего виртуального окружения. Например, его запускает какой-то сервис от вашего юзера и вставить активацию окружения вы не можете. В этом случае можно установить библиотеки для Python не глобально в систему, а только для юзера. Выполните этот код в консоли: python3 -m site Вы получите что-то такое: sys.path = [ '/home/user', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/home/user/.local/lib/python3.7/site-packages', ... ] USER_BASE: '/home/user/.local' USER_SITE: '/home/user/.local/lib/python3.7/site-packages' ENABLE_USER_SITE: True Нас интересует параметр USER_SITE. Это путь к пользовательским библиотекам, которые доступны по умолчанию, если они есть. Именно сюда будут устанавливаться модули если добавить флаг --user при установке чего-либо через pip pip install --user requests Для этой команды не нужны root-права. После неё можно запускать системный интерпретатор без виртуальных окружений и установленная библиотека будет доступна для текущего юзера. Параметр USER_BASE показывает корневую директорию для хранения user-библиотек. Её можно изменить с помощью переменной окружения PYTHONUSERBASE export PYTHONUSERBASE=~/pylibs python3 -m site ... USER_BASE: '/home/user/pylibs' USER_SITE: '/home/user/pylibs/lib/python3.7/site-packages' Получается некоторое подобие виртуального окружения для бедных 😁 которое можно менять через эту переменную (не делайте так!Лучше venv!) 🔸 Дописывание пути в PYTHONPATH Этот способ не входит в список "двух правильных", но тоже рабочий. Здесь придётся сделать всё несколько сложней. Сначала ставим библиотеку в любое место указывая путь установки pip3 install -t ~/mylibs modulename Библиотека установится без привязки к какому-либо интерпретатору. То есть по умолчанию не будет видна. Теперь в нужный момент добавляем этот путь в sys.path или в PYTHONPATH. Не буду советовать так делать. Единственный раз когда этот способ мне пригодился и решил поставленную задачу, это при создании общей библиотеки для кластера компьютеров. Модули лежат в сети и подгружаются для всех из одного и того же места. То есть обновлять файлы требуется только один раз а не на всех хосты отдельно. Минусы такого подхода: ▫️Нужно всем хостам пробить нужный путь в .bashrc или ещё куда-то чтобы он сетапился на старте. ▫️Чем больше хостов тем больше нагрузка на сеть. Иногда такой способ не подходит именно по этой причине. Тогда Ansible вам в помощь. ▫️Не очень подходит если хосты с разными операционками. Некоторые библиотеки различаются для Linux и Windows (там, где есть бинарники) и приходится мудрить более сложные схемы. #tricks#basic
Пребарај: #yield
@djangoproject · Post #151 · 03.09.2016 г., 18:42
https://jeffknupp.com/blog/2013/04/07/improve-your-python-yield-and-generators-explained/ Improve Your Python: '#yield' and #Generators Explained #asyncio
Hashtags
@tonevents_en · Post #1662 · 04.07.2025 г., 19:50
☕️ Swap Coffee x 🏳️ FIVA Good news: Swap Coffee has been integrated into the FIVA app🎉 This update makes working with YT and PT tokens a lot easier — they can now be swapped with significantly less volatility than during the early launch days. 💻Don’t forget about FIVA’s giveaway iPhone 16 Pro, PS5 Pro, the legendary Durov’s Hat, 10 x $100 - prizes are waiting! Right now, you can lock in up to 16.3% on USDT and 12.2% on TON for 60 days. ☕️And what about yield onSwap Coffee DEX? Currently offering boosted APRs of up to 10% for supplying liquidity to classic V2 pools. Sure, it’s not as efficient as V3, but it’s a great starting point for users who are just getting familiar with this type of DeFi tool. Swap Coffee app | FIVA app #DeFi#FIVA#SwapCoffee#Yield#TON#CryptoNews
@TapSwap · Post #125 · 02.06.2021 г., 11:43
How about a New UI and New Farm this #HOTDEFISUMMER ? Quench your Thirst of Yields by staying to our Lake Farms! MATIC-BUSD, BANANA-BNB , $BAKE and $Burger farm and BSC CORE Locked LP! What a exciting week ahead of us. #TAPSWAP#YIELD#APESWAP
@venturevillagewall · Post #4256 · 27.02.2025 г., 04:00
First Solana Futures ETFs Now Listed DTCC lists first Solana futures ETFs: SOLZ and SOLT by Volatility Shares. An important step toward spot ETFs. More info here. Apollo Global Management offers liquidity creation for investors in Apollo’s ACRED via Securitize, unlocking DeFi access and yield opportunities. #Solana#ETF#Crypto#DTCC#DeFi#Investing#Finance#DigitalAssets#Yield
@tonevents_en · Post #1682 · 11.07.2025 г., 07:38
😇EVAA Updates: New Integrations, Expanded Features & Security Focus 🪙Integration with SafePal EVAA is now available in the TON DeFi Collection section of the SafePal wallet. Through #TON Connect, users can work with basic assets, take and issue loans, as well as use lending in various LP pairs. The team has prepared a detailed text guide on connecting and using the protocol. ☕️Partnership with Swap Coffee The protocol is integrated into the Swap Coffee aggregator. In the #Yield tab, you can now: • track the current APR for EVAA pools; • deposit and withdraw assets; • manage deposits and loans. 🪙Temporary suspension of collateral in $CATI Since Friday, July 11, support for the $CATI token in the ALTs pool has been temporarily disabled due to low liquidity. All active positions are safe and not subject to liquidation; however, opening new collateral in $CATI is currently not allowed. This decision was made to increase the protocol's stability. 🛡Trail of Bits audit completed EVAA successfully passed the final stage of the audit at Trail of Bits. Despite recent criticism of this company's address due to an incident with another project, the #EVAA team emphasizes that reliability and transparency remain its priority. EVAA app | News | Chat | Website #EVAA#SafePal#CATI#Audit#Security#DeFi#Toncoin
@tonevents_en · Post #1655 · 02.07.2025 г., 16:44
🏦TON DeFi Yields & New Players Since the start of the year, 12 new DeFi protocols have launched, and developers are actively experimenting with solutions that combine the convenience of Telegram with the principles of decentralized finance. Top APRs: 🏆Bidaskoffers 22% APR in the tgUSD/USDT pair and 41.6% APR in Bemo bmTON/TON. 🏆TONCOprovides ~37.7% APR — among the highest yields on the platform. 🏆Storm Tradeoffers Vault to TON and USDT with yields of ~10–13% APR. 🏆FIVA Protocolhas revamped its app for simplicity and even added a game mode — 11.25% APR in USDT. New & Rising Projects: 🔓 Factorial has rebranded to Affluent, focusing on straightforward investment tools. 🔓 Titan introduced Colossus — a high-speed concentrated liquidity market-maker. 🔓Syde.fi launched an alpha version and is in testing; the team has gathered feedback and is about to unveil a new synthetic token-asset product. 🔓Swap.coffee opened Coffee DEX — a fully open-source decentralized exchange. 🔓Torch launched tgUSD, a stablecoin pegged 1:1 to USDT, offering ~10% APR. #DeFi#Yield#APR#APY#Farming#TON#Tonco#Bidask#Torch
@CryptoM · Post #65071 · 10.04.2026 г., 18:54
🚀 Crypto Yields Lag Behind Traditional Cash Products Aave is currently offering yields of 1.84% on USDT deposits and 2.61% on USDC deposits. According to NS3.AI, these rates are lower than the returns of 3.14% to 4.21% typically seen in traditional cash products. Additionally, Ethereum staking yields have decreased to approximately 2.7%. In contrast, tokenized Treasury products are averaging around 3.38% over a seven-day period. #Crypto#Aave#USDT#USDC#Ethereum#Staking#TreasuryProducts#Yield#CashProducts#TraditionalFinance#ETH
@CryptoM · Post #64723 · 09.04.2026 г., 16:05
🚀 USDA Maintains Soybean Production Forecast for 2025/2026 The United States Department of Agriculture (USDA) has maintained its forecast for the 2025/2026 soybean production at 4.262 billion bushels, unchanged from its March estimate. According to Jin10, the USDA also projects the ending stocks for the same period to be 350 million bushels, slightly above the market expectation of 349 million bushels, and consistent with the March forecast. Additionally, the USDA anticipates the soybean yield to remain at 53 bushels per acre, the same as the previous month's projection. #USDA#Soybean#Agriculture#Production#Forecast #2025 #2026 #Yield#EndingStocks#USAgri
@venturevillagewall · Post #4205 · 21.02.2025 г., 04:00
FraxUSD Transforms Into Fully Fiat-Backed Stablecoin FraxUSD has transitioned to a fully fiat-backed model with 1:1 redeemability, enhancing its competitive stance in the stablecoin market. It boasts deep DeFi integration, institutional-grade reserves, and generates native yield through sfrxUSD. For a detailed analysis, visit Leviathan News. #FraxUSD#Stablecoin#DeFi#Bitcoin#Crypto#Finance#Blockchain#Tokenomics#DigitalAssets#Investment#Innovation#Yield#Redemption#FinancialServices#MarketTrends#InstitutionalInvesting#OnChain#CryptoNews#VC#Fintech
@venturevillagewall · Post #3889 · 16.01.2025 г., 04:00
Thai SEC Considers Bitcoin ETF Approval The Thai Securities and Exchange Commission is evaluating a proposal to approve a Bitcoin ETF for listing on its local exchange. Currently, Thai investors can only access overseas Bitcoin ETFs through a fund of funds product launched in mid-2024. Read more #Thailand#Bitcoin#ETF#Crypto#Investing#Finance#USDC#fxUSD#XRP#WhaleAlert#Assets#Trading#Decentralized#Yield#Securities#Exchange#LocalMarket#DigitalAssets#BlueChip#Stablecoin#VC
@venturevillagewall · Post #3598 · 20.12.2024 г., 15:24
CrossCurve Boosts TON Liquidity CrossCurve by EYWA aims to create a unified marketplace for cross-chain liquidity on the Curve protocol, attracting investment from Curve founder Misha Egorov. Soon, TON integration will allow asset exchanges with tokens from Torch and Crouton. Additionally, CrossCurve offers a $300k incentive program following their upcoming TON integration. A podcast episode discussing their unique solution is available here. #CrossCurve#TON#Curve#EYWA#Liquidity#EVM#Stablecoins#DeFi#Podcast#Crypto#Blockchain#Incentives#Investment#Token#Torch#Crouton#Farming#Staking#Yield#Grants
@venturevillagewall · Post #4178 · 18.02.2025 г., 04:00
DeFi Tuna Exposes Fund Manipulation Scheme Moty, founder of DeFi Tuna, accuses Kelsier of orchestrating a scheme to siphon significant funds from M3M3. Meteora leaders, including Ben, allegedly facilitated numerous KOLs, allowing them to purchase tokens early before the official launch. This led to massive profits for these investors. 📈Read more here. #DeFi#Crypto#VC#M3M3#marketmanipulation#KOLs#funds#memecoin#profit#Moty#Kelsier#Meteora#Ben#Hayden#launchpad#staking#Bitcoin#yield#institutional#collateral#Maple