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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #60 · 31 мар.

Вторая по частоте future-функция, которую я использовал, это абсолютный импорт from __future__ import absolute_import Что она делает? Изменения, которые вносит эта инъекция описаны в PEP328 Покажу простой пример. Допустим, есть такой пакет: /my_package /__init__.py /main.py /string.py Смотрим код в my_package/main.py # main.py import string Простой пример готов) Вопрос в том, какой модуль импортируется в данном случае? Есть два варианта: 1. модуль в моём пакете my_package.string 2. стандартный модуль string И вот тут вступает в дело приоритет импортов. В Python2 порядок следующий: помимо иных источников, раньше ищется модуль внутри текущего пакета, а потом в стандартных библиотеках. Таким образом мы импортнём my_package.string. Но в Python3 это поведение изменилось. Если мы указываем просто имя пакета, то ищется именно такой модуль, игнорируя имена в текущем пакете. Если мы хотим импортнуть именно подмодуль из нашего пакета то, мы должны теперь явно это указывать. from my_package import string или относительный импорт, но с указанием пути относительно текущего модуля main from . import string Еще одной неоднозначностью меньше 😎 Подробней про импорты здесь: https://docs.python.org/3/tutorial/modules.html #2to3#pep#basic

Резултати

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

Пребарај: #afterthoughts

当前筛选 #afterthoughts清除筛选
Quiet World 🍁

@QuietWorld · Post #6965 · 24.11.2019 г., 01:31

“what you see depends mostly on what you're looking for.” if you're looking for the negatives, that's what you'll see, that's what you'll feel, that's what you'll get. & if you're looking for the positives, then that's what you'll focus on, that's what you'll see, that's what you'll get and that's what you'll feel. and I I allow myself to look at both. it's what makes life. the negatives make us appreciate the positives, and the positives make us value the positives even more. & together, both makes our life more meaningful. but don't let yourself stay in the negatives for too long because it could drown you 😉 #afterthoughts@quietworld🍃

Quiet World 🍁

@QuietWorld · Post #7439 · 23.06.2020 г., 14:03

I felt hurt recently like earlier this month and only by chances, I found this kitten in need of adoption. Adopting her, providing and caring for her distracted me from thinking & focusing on the hurt I felt. & creating this Youtube channel for fun helps me a lot too! in moving on from my crush 😂 tsk. tsk . but I didn't do all of those with the intention to help me move on 😂 I just feel like doing it and only after doing so I realize “Hey, wasn't I broken hearted? Wasn't I disappointed? Wasn't I was about to be sad & gloomy?”😂 & of course, when I think about it, I do feel the little void in my heart; feeling of a little loss, but I'm fine ☺ & I know that I'm gonna be better sooner 😊 #thoughts#afterthoughts @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #7400 · 14.06.2020 г., 06:56

Well.. I just realized that I'm finally doing what I've always wanted to do. I've been putting off from adopting a cat for so long.. & I've been putting off from creating a Youtube channel for quite a while too. & I'm glad that I finally do what I've always wanted to do 🥰 Take it slow, just for fun ☺ Find & have enough hobbies to keep yourself occupied, to keep you looking forward to wake up the next day. Trust me, it feels like a therapy and good for our mental health. ❤ #thoughts#afterthoughts @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #7291 · 30.04.2020 г., 07:11

sometimes it just takes us to write down and count as much as blessings we have to remember how blessed we are. once you started and focus on the good, you'll be surprised at how blessed you are than you really think. you don't need to compare yourself with anyone else, & in no time you will realize you have written more than you thought you could if you just make sure you didn't let negative thoughts get in the way. #afterthoughts#thoughts @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #6999 · 30.11.2019 г., 04:39

💭 Have you ever notice the difference between when you feel happiness after happiness and when you feel happiness after sadness? I don't know about you but I personally feel that the happiness that comes after sadness is often more meaningful and satisfying - and often it comes with more value; usually a lesson to learn from or/and some sort of renewal in self. & I realized that.. How beautiful it is, this life; to be able to feel happy, joy, love, excitement and all - including sadness, boredom, disappointment, apathy and all. I look back and I felt grateful for all those feelings, because without the negatives, I wouldn't & couldn't appreciate the positives. #thoughts#afterthoughts @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #6847 · 02.11.2019 г., 00:17

💭 you can't just say someone is less mature just because they mess up a lot. because if they mess up a lot but they own up to all or almost all of their mistakes and clean after the mess themselves, it is still such a big difference compared to someone who only make one mistake but having someone else to clean up after that mess. #thoughts#afterthoughts @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #6837 · 31.10.2019 г., 13:01

💭 people nowadays often vent their problems out in social media, some really just want attention, some are real. & other people be judgmental and bashing those kind of people – and I used to be guilty of that too; being judgmental. But it hit me back when I realize that, even when you carefully picked just one or two people to share your problems with in real life, they don't actually listen. Maybe that's why some go to social media as a medium to vent out, and as for me, this channel 🙂 #thoughts#afterthoughts @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #6635 · 05.10.2019 г., 01:58

Now that I am in my 20s, I don't want to say that I have regret on anything that had happened all my life, because I believe I learned something from all of them. But if I really have to say something that I regret or kinda regret, it would be for all the time, energy & meaningless thoughts I wasted on puppy love during my teenage years 😂 because now I realize just how much more to this life that I could explore & learn during my teenage years rather than trifle stuffs as such – I should have make the most of the time learning about things that weren't taught in school & practice on my hobbies. But nvm, I learned something or maybe quite a lot from those seemingly trifle stuffs too, plus, there's nothing I could do to change the past right? & I know that I can still start today, this moment, to learn about all the things I want to learn, read about all things that I want to know, & see all that I can that the world has to offer. Although it is better to start earlier, but still, late is better than never 😊 Take note kids & teenagers, it's okay to fall in love be it puppy love or whatever, but remember to focus more on loving & building yourself - you won't regret it, because finding & creating yourself is more important than finding love from another person.😉 #afterthoughts#thoughts @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #6620 · 28.09.2019 г., 03:58

How much money is enough? – Have you ever ask yourself that question? As human, we all have our needs & desires. Our needs are finite while our desires are infinite. Just look around and observe how many people around you or even in social media are so obsessed about wanting to be rich or look rich. There are also people who already have what they need, but because they want more, they forgot what's more important & eventually get lost in the run of chasing material wealth. So, this is a reflection on The Story of The Mexican Fishermen - it's a short story you can search it on Youtube; Sometimes, all we need and all we want is to be able to support our living, spend time with family and friends, sleep late, stroll in the nature & sips wine, but sometimes we can overlook these most important & valuable things in life by chasing all the money that we don't really need; along the way, we don't realize that we've spent too much time and energy, working towards money - sacrificing our health and time for family & friends.. So, how to avoid this? Reflect and re-evaluate your priority frequently. Have a clear vision on what you are looking towards, so that when you have achieved it, you know it and able to say I HAVE ENOUGH. #afterthoughts#life@quietworld🍃

Quiet World 🍁

@QuietWorld · Post #7344 · 06.06.2020 г., 02:52

“The moment you accept that pain is inevitable because there'll be good times and bad times, happiness and sadness, pain and pleasure, the easier you'll be able to go through things and the less you suffer; because you'll be aware that those are all parts of life, bad times will pass, and there'll be time for everything.” #afterthoughts#thoughts#life @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #6839 · 31.10.2019 г., 13:01

🌸 and somehow I remember a quote; 🔖 if someone can't appreciate your presence, let them appreciate your absence.. I'll take that and I call it self-care. The more you tolerate people who don't appreciate your presence, the more you unconsciously tell yourself that you are less & not worthy – just because people around you can't see your value. If that so, then why cry if I have to go? Why even bother begging me to stay when I want to go? #afterthoughts#thoughts#quotes@quietworld🍃

ПретходнаСтраница 1 од 3Следна