Первая директория в 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
Only 3 Days Until FRUIT CIRCUS PARTY! 🍉🎪
Why wait for the fun? The Buy Bonus feature lets you jump straight into the bonus round, where multiplicative multipliers never reset between spins. More spins, more multipliers, more mayhem! 🎢
Tick-tock, the madness begins in just 3 days. June 27th – mark the date!
➡️DEMO: https://bit.ly/demo-fcp
#FruitCircusParty#MultiplicativeMultipliers#BuyBonus#TrueLab#TrueGames#TrueSlots
Step Right Up! Step right up! There's a new circus hitting town!
Tired of bland fruits? Us too. Meet FRUIT CIRCUS PARTY – where cascading wins, high volatility, and multipliers up to x10,000 make your average fruit game look like a snooze fest. 😴💣
Why? CASCADING MULTIPLICATIVE MULTIPLIERS, that's why. 🔥
We're talking 243 Ways to Win, Cascading multipliers and a bonus buy to get you right into the action.
This isn't your average circus. Launching 27th June. 🗓️
#CircusFruitParty#MultiplicativeMultipliers#BuyBonus#ComingSoon#TrueLab#TrueSlots#TrueLab
BOOM! The Fruit Circus Party is in town tonight! 💥
The wait is over, so It's finally time to unleash those unlimited multiplicative multipliers and kick off the mayhem!
Use the Buy Bonus to plunge straight into the bonus round, where multipliers only head in one direction - UPWARDS. Because who needs limits, right?
Fruit Circus Party is OUT NOW! 🚀
➡️ SPIN IT: https://bit.ly/demo-fcp
#FruitCircusParty#OUTNOW#MultiplicativeMultipliers#BuyBonus#TrueLab#TrueGames#TrueSlots
Tired of boring fruit games? We’ve got you covered. Our latest game, FRUIT CIRCUS PARTY, features multiplicative multipliers with no limits! That’s right, endless chaos and infinite potential!
🎢 Charge the multipliers by landing wins and triggering cascades. The more you win, the crazier it gets, and we mean CRAZIER! You can even use the Buy Bonus to head straight into the bonus round, where multipliers don't reset and only head upwards. Because who needs stability, right? 🎪💥
We’re just 10 days away from launching this fruity frenzy. Mark your calendars for June 27th!
Can't wait? Hit up the demo right here!
➡️https://bit.ly/demo-fcp
#FruitCircusParty#MultiplicativeMultipliers#CascadingWins#BuyBonus#TrueLab#TrueGames#TrueSlots