Первая директория в 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
A LETTER FOR YOU
A letter which describe how much u r to me
A letter saying that I miss u in every conversation I have someone. Thinking about how would have react, say. How we have laugh
A letter saying that how I plan to go on every vacations with u
A letter saying that whenever we fight.. How I check whether u r online or not every now and then
A letter confessing you that I imagine u in every love story I see I read.. N u r shaping in my romantic fanasty
A letter confessing u that u r not much to me.. U r whole of me.... U r the one whom I want everyday
A letter from my heart saying ....u r my everything and nothing together
#review#pain#PSP
A LETTER FOR YOU
A letter which describe how much u r to me
A letter saying that I miss u in every conversation I have someone. Thinking about how would have react, say. How we have laugh
A letter saying that how I plan to go on every vacations with u
A letter saying that whenever we fight.. How I check whether u r online or not every now and then
A letter confessing you that I imagine u in every love story I see I read.. N u r shaping in my romantic fanasty
A letter confessing u that u r not much to me.. U r whole of me.... U r the one whom I want everyday
A letter from my heart saying ....u r my everything and nothing together
#review#pain#PSP
#Elezioni#Singapore
Risultati definitivi:
Affluenza: 92,47% (-3,34 rispetto al 2020)
#PAP|Centro-destra secolare: 87 seggi (+4)
#WP|Centro-sinistra: 12 (+2)
#PSP|Centro progressista: 0 (-2)
Totale seggi: 97 + 2 Parlamentari non Circoscrizionali
Attuale governo (PAP): 87 seggi (✅maggioranza mantenuta✅)
Nota: I due parlamentari guadagnati dal WP sono Parlamentari non Circoscrizionali, eletti in parlamento in virtù dell'essere stati "migliori sconfitti".
@OsservatorioEsteri
Проект парковой скульптуры с Wi-Fi-сетью,
смешанная техника, арт-группа Doping Pong, 2011 год
Перед вами концепт-арт уличных скульптур, раздающих бесплатный интернет в wi-fi зонах, развернутых в парках для сетевых серферов и геймеров.
Объекты:
Classic Version 1.0
Twitter girl №1,
Twitter girl №2,
PSP boy №1,
PSP boy №2
Toy Version 2.0
Twitter dolls: Green & Orange
PSP soldiers: Green & Blue
Проект не был реализован.
#dopingpong#freewifi#sculpture#project#boy#girl#twitter#psp#unrealized
#Elezioni#Libano
99 seggi assegnati su 128:
Per coalizioni:
Alleanza dell'8 marzo (#FPM-#Amal-#Hezbollah-#Marada-#ARF-#PNO-#UP-#Baath)|Grande tenda pro-Siria: 47 seggi
Alleanza del 14 marzo (#LF-#Kataeb-#IM-#Taqaddm)|Grande tenda anti-Siria: 28
Indipendenti: 11
Altri (#PSP-#NLP-#TW-#Sabaa-#ReLebanon-#Osos): 11
@UltimoraPolitics