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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #198 · 6 јан.

Первая директория в sys.path 🔸 Когда вы запускаете Python-интерпретатор в интерактивном режиме, в системные пути (sys.path) в самое начало добавляется текущая рабочая директория >>> for path in sys.path: ... print(f'"{path}"') "" "/usr/lib/python37.zip" "/usr/lib/python3.7" ... Первая строка пустая, что и означает текущую рабочую директорию. 🔸 Если вы запускаете интерпретатор передавая скрипт как аргумент, то история получается иная. На первом месте будет директория в которой располагается скрипт. А текущая рабочая директория игнорируется. Пишем скрипт с таким содержанием: # script.py import sys for path in sys.path: print(f'"{path}"') Запускаем python3 /home/user/dev/script.py Получаем "/home/user/dev" "/usr/lib/python37.zip" "/usr/lib/python3.7" ... 🔸 Если вы запускаете скрипт по имени модуля то на первом месте будет домашняя директория текущего юзера python3 -m script "/home/user" "/usr/lib/python37.zip" "/usr/lib/python3.7" ... Скрипт должен быть доступен для импорта На что это влияет? На видимость модулей для импорта. Если вы ждёте, что, запустив скрипт по пути, сможете импортировать модули из текущей рабочей директории, то вы ошибаетесь. Придётся добавлять путь os.getcwd() в sys.path самостоятельно или заранее объявлять переменную PYTHONPATH. #basic

Hashtags

Резултати

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

Пребарај: #gemswall

当前筛选 #gemswall清除筛选

🪙 TON BuildCon – Defining the Future of TON in 2025! What narratives will shape TON in 2025? What innovations and trends will drive its growth? Let’s find the answers together at TON #BuildCon – an online event by PumpStep & OpenSourceFun, focused on TON Blockchain. 🗓Date: February 12th, 15:00 UTC ➡️Live Twitter Space ➡️Register on Luma What’s on the agenda? ⏺ The $TON Era for #TelegramApps ⏺ Technical Challenges & New Opportunities in TON ⏺ Telegram as an On-Chain Hub for Retail Users 🎙 Featuring industry experts from: #Tonkeeper, #StormTrade, #EVAAProtocol, #GemsWall, and more! ✔️ As an official media partner, we’ll be covering all key insights from the event – stay tuned!

🎁Get your Delea x GemsWallSBT #Gemswall is a quest platform where you can complete tasks, participate in quests, and earn rewards within the Telegram ecosystem. How to get your SBT and share of the $1.5M TON airdrop? ✔️ Go to the Delea quest on GemsWall ✔️ Follow the socials ✔️ Go to Delea App and connect your wallet ✔️ Deposit $20 worth collateral and mint (borrow) 15+ $DONE stablecoin 🏆Pro tip: To boost your rewards, join #TheOpenLeague, where #Delea is competing: Get your SBT badge, earn points for every $20 liquidity position & grab your share of the $1.5M airdrop! 💎Claim your SBT before December 16 — time is runningout! #SBT#stablecoin#LEA#DONE