💡🐍 How to Remember Useful Code Snippets to Make Your Code More Pythonic?

preview_player
Показать описание

Have you ever encountered a Python code example you had no immediate use for but you really wanted to remember it because it seemed useful?

In this video I'll reply to a question about remembering Pythonic code snippets and other code examples I got on YouTube from ambiyou:

"If I discover more useful pythonic way of doing something (eg from your book) but it doesn't make sense to use it in any of my current projects to practice, how can I remember to use it in the future when it is relevant? I have FOMO for that sort of thing."

Super interesting question and in my answer I'm sharing how I approach this problem in my life as a Python dev. This is also useful if you're learning Python right now and you're struggling to remember everything you've learned so far.

Links I mentioned in the the video:

* * *

FREE Python Coding Tutorials & News:
Рекомендации по теме
Комментарии
Автор

Might be an old video but was still nice to see. I'll go with Notion :)

GregorSchafroth
Автор

Thanks for the answer Dan, I'm happy that this is pretty much what I have ended up doing, although I've just been dumping everything in a markdown file in a semi-organized way. A dedicated snippet app would probably be better for searchability. It's really nice to hear that this is approach is used, and works. Never fails to boost my confidence!

akimboanansi
Автор

I keep a large shortcut file of 10, 000+ shortcuts. I number them all in chronological order and give them typeable synonyms.
Example: Typing: "for-loop-js" "js-loop" pastes a basic javascript loop.
I also use it to open documentation.

I've found information has a habit of branching out in so many directions is becomes unmanagable.
So by indexing every piece of information I've been exposed to, it becomes easier to re-visit.

JohnMarkIsaacMadison
Автор

why not jupyter notebooks? They are notebooks essentially, you can describe the snippet and paste the code, and when you wanna use it, you can test a little bit before applying it.

Anvesh
Автор

abc.py runs and generated a bunch of files "F" and writes them to disk
def.py read generated files and dumps another set of files "FF" to disk
xyz.py reads "FF" from disk and trains a neural network on it.

how do I do something like
python chain.py

so that abc.py is first executed, and upon successfull completion is followed by def.py and finally after def.py is done, xyz.py runs.


I know I can do it with bash. But I want to do it using python.

vivekmangipudi
Автор

Evernote have great search built in. Make a print screen and with built-in ocr it will find code on it. And some usefull hot keys for pasting clippboard in new note

hawwestin
Автор

Hey Dan are there any design patterns in Python for systems programming ?

gauravsitlani
Автор

Hey Dan, I use Google Keep. It has all you have mentioned.

mkrajaci