Первая директория в 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
The sunrays taking;
All the darkness away,
Love taking all hatred away,
Miniature hopes in shapes of stars,
Now subsiding in beautiful destiny,
Happiness taking all the pain away.
In midst the beautiful world,
I laid here,
Breathless,
My sould taken away by you,
My heart given to beat in someones
Else's cage,
My body drifted with fire,
My voice taken away by deafening silence,
My memories now, washed away,
Fading away with new ones.
This is how,
A beautiful day began,
Changing my life,
To be dreadful forever,
In midst the beautiful world,
I laid here as a dead lover.
#tyler#review
She's like a poem,
Waiting to be read.
She's like a song,
Waiting to be sung.
She's like a melody,
Waiting to be heard.
She's like a book,
Waiting to be understood.
She's like a dance,
Waiting to be performed.
She's like a beauty,
Waiting to be cherished.
She's like art,
Waiting to be crafted.
She's you,
Waiting to be found.
She's you,
Waiting to be loved.
She's not just a girl,
She's within all of you,
She resides somewhere inside,
Somewhere the golden rays don't reach,
Somewhere the silver shine doesn't work,
Somewhere in you,
She stays,
Waiting to be acknowledged.
#tyler#review
She's like a poem,
Waiting to be read.
She's like a song,
Waiting to be sung.
She's like a melody,
Waiting to be heard.
She's like a book,
Waiting to be understood.
She's like a dance,
Waiting to be performed.
She's like a beauty,
Waiting to be cherished.
She's like art,
Waiting to be crafted.
She's you,
Waiting to be found.
She's you,
Waiting to be loved.
She's not just a girl,
She's within all of you,
She resides somewhere inside,
Somewhere the golden rays don't reach,
Somewhere the silver shine doesn't work,
Somewhere in you,
She stays,
Waiting to be acknowledged.
#tyler#review
During a dreadful night,
I managed to put up a fight.
Maybe the strong me died,
And weak me survived.
The constant voices in my ears,
Here I am living in my fears.
Like a painful reminder of that night,
Where I lost a outnumbered fight.
Wondering if I am even right,
While holding myself tight.
The night is long dead,
Here my tears still wetting my bed.
That dreadful night,
The cause of my fright.
These thoughts make me shiver,
The fear making me quiver.
My painful screams,
Still haunting my dreams.
Maybe the strong in me died,
And weak me survived.
I haven't given up the fight,
Because I know,
I can still make it right.
#tyler#review
The correspondence of Tyler Robinson, a suspect in the murder of Charlie Kirk, with his transgender lover, with whom he lived, has been published. The name of the roommate is not mentioned.
#correspondence#tyler#robinson#suspect
#Trump#Democrats
👂More on Trump's Ear ⚠️