Первая директория в 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
🎮TapSwaphas reached a new level - beta is already online!
Now skill games are available to the first users directly in Telegram. No downloads - everything is fast, convenient and already with $TAPS integration .
What's in beta:
• 🎮 3 play-to-skill games — it’s not clicks that matter, but real skill
• 💸 Using and testing $TAPS in action
• 🧩 Convenient Telegram mini-app — launch in a couple of seconds
⚠️Beta is available only to a limited number of users.
If you've gained access, you're among the first to test the mechanics before the mass launch and possibly earn an advantage.
📅 Public release - already in early June.
Get ready:TapSwapis a game changer.
#TapSwap#CryptoGaming#SkillToEarn#Web3UA
Bot link:tapswap_bot📱
Crypto Drop Club 👉 SUBSCRIBE
😱 Are you missing everything again?
This is the last chance to get into the TapSwap beta test before it goes mainstream!
We've almost assembled a select group of people - those who will be the first to see how TapSwap works from the inside.
Want to go there? Then go for it!
In beta:
🎯 Games where it's important not to poke, but to think
🪙 $TAPS is not a toy, but a currency
📲 Everything via Telegram — no downloads, no headaches
Leave your nickname and we will find you (in a good way):
👉https://forms.gle/Wdp8ZsofBM6Xzjyk6
Bot link: tapswap_bot📱
#TapSwap#Бета#SkillToEarn#TONGaming
Crypto Drop Club 👉 SUBSCRIBE
⚠️ Final call to join the TapSwap beta!
We are finalizing the formation of the early access group.
If you haven't sent your Telegram nickname yet, now is the time to do it.📱
As part of the beta version you will receive:
- Access to skill-based mechanics
— Possibility to test $TAPS in operation
— Participation directly through Telegram, without unnecessary installations
📩 Leave your nickname here so we can add you to the list:
👉https://forms.gle/Wdp8ZsofBM6Xzjyk6
Bot link: tapswap_bot📱
#TapSwap#Бета#SkillToEarn#TONGaming
Nigeria Football Hub
⚠️Last chance to get into the TapSwap beta test
We are finalizing the formation of the early access group.
If you haven't sent your Telegram nickname yet, now is the time to do it.📱
As part of the beta version you will receive:
- Access to skill-based mechanics
— Possibility to test $TAPS in operation
— Participation directly through Telegram, without unnecessary installations
📩 Leave your nickname here so we can add you to the list:
👉https://forms.gle/Wdp8ZsofBM6Xzjyk6
Bot link: tapswap_bot📱
#TapSwap#Бета#SkillToEarn#TONGaming
INSIDER USA 👉🏻 Subscribe