๐Ÿ’ก๐Ÿ How to Remember Useful Code Snippets to Make Your Code More Pythonic?

Real Python ยท Beginner ยท๐Ÿ› ๏ธ AI Tools & Apps ยท8y ago

Key Takeaways

The video discusses ways to remember useful Python code snippets, including using note-taking apps like Quiver and Simplenote, and starting a blog to share knowledge and build a public portfolio.

Full Transcript

hey guys I got this question from MBU on YouTube just gonna read out the questions so if I discover more a more useful pythonic way of doing something for example from your book the book is called Python tricks be sure to check it out it's available on Amazon 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 fear of missing out for that sort of thing so I thought that was a really really interesting question so I want to discuss it in this video now what I would encourage you to do because this is you know it's an understandable sort of fear that you're seeing something cool and you want to remember to actually use it what I would encourage you to do is to have some sort of journal some application I don't think it makes sense for this to be paper-based so I I would do that in in some kind of app that you can just add notes and make them searchable I actually blogged about this in the past I'm just the system that I use and maybe I'll do a video on that in the future just kind of run people through it um there are a couple of options that are really great for software developers and the the tool that I used in the past actually just switch to something else but what I use the password he enjoyed was called is called quiver it's a note-taking app for developers and you can do cool things you can add like little I believe you can do UML diagrams then you can just add code snippets and it's kind of all kind of in there and I I think that is a great choice for for keeping your thoughts around I actually well now a while ago I switched to just an app called simple note and I use that to synchronize my notes across all of my devices you know I have a have them on my phone I have it on my iPad I have it on all of my computers and that way I can always access these notes and I can just drop in a new note and at least at the time quiver didn't do that and I really wanted that functionality because I often you know I go for a walk or I sit down in the morning and I just want to add a quick note and I don't want to necessarily like have to walk up to my computer to do that I just want to you know pull out my phone and do it there so I'm using Simplenote now it's a free app you could just go with your phone snow taking app to be honest doesn't really make a big difference if you want to go nuts with this process it probably also starts some kind of personal wiki you know just spin up some wiki wiki system on on on a web server and could also use that and build a system that you can access from anywhere in the world maybe the user experience won't be that great compared to like a native app on your phone for example and what I would do with that is just at these little snippets you know everything every time you find something cool just take a little note like maybe copy and paste some of that code and just put it in there and make it add some keywords just make it searchable you know add some some things that will allow you to fight this again so if this is about like writing more pythonic code whatever your personal definition of that is then you will be able to search for that and find it again so I would definitely encourage you to do this journaling you know it's it's not but maybe journaling is actually it's not the right word for that kind of system it's more like filing these little things and building up sort of a library of these little snippets and little you know hints that that you can use when you're working on a problem and I've absolutely benefited from that you know it's a lot of times it's like my personal version of Stack Overflow and I just punched something in and and I'm like oh yeah I did that in the past and that way I can find it again another really cool option that you could do here is why not start a blog and actually you know share the things that you found like why not talk about this in public because that has a number of benefits hey you're gonna write down the stuff you're gonna find it again and be it's also gonna be you know it's the office is coming back is gonna be coming back to you it because you're building up a public portfolio and you're kind of showing the world that that you're a great programmer because you're sharing your knowledge and you're sharing that the things that you learned and you know it's just it's just a way for for you to to show that expertise and that you care about your craft because many people just don't so this will put you on top of off the pile in a lot of cases right just make you stick out so I know if you feel comfortable with that I don't do it I sort of you know take the best stuff I learn and then turn that into articles and blog posts but I don't like just you know take notes publicly in that sense maybe I should I don't know but that's definitely not another thing and you could you could do let's see here um and yeah I think that that's covered my system or the system that I use so yeah definitely use some kind of app throwing notes in there and then that way you can find them again so yeah let me know how that goes you know leave a comment if you if you see that if you watch this video and I'd be curious to hear about your experience experience using tools like that or just using workflows like that all right take care and happy Pythian ii

Original Description

https://dbader.org/python-tricks โ–บ This is an ongoing experiment: Make your code more Pythonic with short & sweet code examples 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: - https://dbader.org/blog/keep-journals-to-become-a-better-developer - https://dbader.org/blog/rubber-ducking-journal - Quiver: The Programmer's Notebook -- http://happenapps.com/ - https://simplenote.com/ - Also great: http://brettterpstra.com/projects/nvalt/ (integrates with SimpleNote for syncing notes) - Set up a "personal wiki": https://github.com/django-wiki/django-wiki - https://dbader.org/blog/3-reasons-why-you-need-a-programming-blog FREE COURSE โ€“ "5 Thoughts on Mastering Python" https://dbader.org/python-mastery SUBSCRIBE TO THIS CHANNEL: https://dbader.org/youtube * * * โ–บ Python Developer MUGS, T-SHIRTS & MORE: https://nerdlettering.com โ–บ PythonistaCafe โ€“ A peer-to-peer learning community for Python developers: https://www.pythonistacafe.com FREE Python Coding Tutorials & News: ยป Python Tutorials: https://dbader.org ยป Python News on Twitter: https://twitter.com/@dbader_org ยป Weekly Tips for Pythonistas: https://dbader.org/newsletter ยป Subscribe to this channel: https://dbader.org/youtube
Watch on YouTube โ†— (saves to browser)
Sign in to unlock AI tutor explanation ยท โšก30

Playlist

Uploads from Real Python ยท Real Python ยท 0 of 60

โ† Previous Next โ†’
1 A better Python REPL โ€“ bpython vs python interpreter
A better Python REPL โ€“ bpython vs python interpreter
Real Python
2 Introducing large-type.com โ€“ A Utility Website
Introducing large-type.com โ€“ A Utility Website
Real Python
3 Reading Hacker News Without Wasting Tons of Time
Reading Hacker News Without Wasting Tons of Time
Real Python
4 Forward References and Python 3 Type Hints
Forward References and Python 3 Type Hints
Real Python
5 Using Sublime Text as your Git Editor
Using Sublime Text as your Git Editor
Real Python
6 Python Code Linting and Auto-Complete for Sublime Text
Python Code Linting and Auto-Complete for Sublime Text
Real Python
7 Make your Python Code More Readable with Custom Exceptions
Make your Python Code More Readable with Custom Exceptions
Real Python
8 Write Better Tests with Sublime Text's Split Layout Feature
Write Better Tests with Sublime Text's Split Layout Feature
Real Python
9 How to Use Sublime Text from the Command Line
How to Use Sublime Text from the Command Line
Real Python
10 Rename Variables with Multiple Selection in Sublime Text
Rename Variables with Multiple Selection in Sublime Text
Real Python
11 Sublime Text Settings for Writing PEP 8 Python
Sublime Text Settings for Writing PEP 8 Python
Real Python
12 Write Cleaner Python with Sublime Text's Indent Guides
Write Cleaner Python with Sublime Text's Indent Guides
Real Python
13 Sublime Text Whitespace Settings for Python Development
Sublime Text Whitespace Settings for Python Development
Real Python
14 Function Argument Unpacking in Python
Function Argument Unpacking in Python
Real Python
15 Python Code Review: Debugging and Refactoring "Conway's Game of Life" +  Automated Tests
Python Code Review: Debugging and Refactoring "Conway's Game of Life" + Automated Tests
Real Python
16 Using "get()" to Return a Default Value from a Python Dict
Using "get()" to Return a Default Value from a Python Dict
Real Python
17 A Python Shorthand for Swapping Two Variables
A Python Shorthand for Swapping Two Variables
Real Python
18 Python Code Review: Refactoring a Web Scraper, PEP 8 Style Guide Compliance, requirements.txt
Python Code Review: Refactoring a Web Scraper, PEP 8 Style Guide Compliance, requirements.txt
Real Python
19 Click & Jump to Test Failures from the Command Line (iTerm2)
Click & Jump to Test Failures from the Command Line (iTerm2)
Real Python
20 Setting up Sublime Text for Python Developers
Setting up Sublime Text for Python Developers
Real Python
21 Sublime Text + Python Guide Overview
Sublime Text + Python Guide Overview
Real Python
22 Python Code Review: Adding Pytest Tests to an Existing Python Web Scraper
Python Code Review: Adding Pytest Tests to an Existing Python Web Scraper
Real Python
23 Type-Checking Python Programs With Type Hints and mypy
Type-Checking Python Programs With Type Hints and mypy
Real Python
24 A Shorthand for Merging Dictionaries in Python 3.5+
A Shorthand for Merging Dictionaries in Python 3.5+
Real Python
25 Python Code Review Flask Web Security Tutorial + Virtualenvs, requirements.txt
Python Code Review Flask Web Security Tutorial + Virtualenvs, requirements.txt
Real Python
26 My Python Code Looks Ugly and Confusing โ€“ Help!
My Python Code Looks Ugly and Confusing โ€“ Help!
Real Python
27 Setting Up a Programmer Portfolio/Developer Blog โ€“ How To Get Started
Setting Up a Programmer Portfolio/Developer Blog โ€“ How To Get Started
Real Python
28 Do I Need a GitHub/GitLab/Bitbucket Profile as a Developer?
Do I Need a GitHub/GitLab/Bitbucket Profile as a Developer?
Real Python
29 Programmer Portfolio โ€“ Example and Walkthrough
Programmer Portfolio โ€“ Example and Walkthrough
Real Python
30 How to Get Your 1st Speaking Gig at a Tech Conference
How to Get Your 1st Speaking Gig at a Tech Conference
Real Python
31 How to Build Your Public Speaking Skills as a Developer
How to Build Your Public Speaking Skills as a Developer
Real Python
32 The Object-oriented Version of "Spaghetti Code" is "Lasagna Code" ?!
The Object-oriented Version of "Spaghetti Code" is "Lasagna Code" ?!
Real Python
33 Setting up Sublime Text for Python Developers โ€“ Lesson #1
Setting up Sublime Text for Python Developers โ€“ Lesson #1
Real Python
34 Cool New Features in Python 3.6
Cool New Features in Python 3.6
Real Python
35 "is" vs "==" in Python โ€“ What's the Difference? (And When to Use Each)
"is" vs "==" in Python โ€“ What's the Difference? (And When to Use Each)
Real Python
36 Emulating switch/case Statements in Python with Dictionaries
Emulating switch/case Statements in Python with Dictionaries
Real Python
37 Python Function Argument Unpacking Tutorial (* and ** Operators)
Python Function Argument Unpacking Tutorial (* and ** Operators)
Real Python
38 What Code Should I Put On My GitHub/GitLab/BitBucket Profile?
What Code Should I Put On My GitHub/GitLab/BitBucket Profile?
Real Python
39 A Crazy Python Dictionary Expression ?!
A Crazy Python Dictionary Expression ?!
Real Python
40 String Conversion in Python: When to Use __repr__ vs __str__
String Conversion in Python: When to Use __repr__ vs __str__
Real Python
41 Method Types in Python OOP: @classmethod, @staticmethod, and Instance Methods
Method Types in Python OOP: @classmethod, @staticmethod, and Instance Methods
Real Python
42 Optional Arguments in Python With *args and **kwargs
Optional Arguments in Python With *args and **kwargs
Real Python
43 Python Context Managers and the "with" Statement (__enter__ & __exit__)
Python Context Managers and the "with" Statement (__enter__ & __exit__)
Real Python
44 Installing Python Packages with pip and virtualenv / venv
Installing Python Packages with pip and virtualenv / venv
Real Python
45 "For Each" Loops in Python with enumerate() and range()
"For Each" Loops in Python with enumerate() and range()
Real Python
46 Python Code Review: LibreOffice Automation and the Python Standard Library
Python Code Review: LibreOffice Automation and the Python Standard Library
Real Python
47 Managing Python Dependencies With Pip and Virtual Environments โ€“ Lesson #1
Managing Python Dependencies With Pip and Virtual Environments โ€“ Lesson #1
Real Python
48 Python Tutorial: List Comprehensions Step-By-Step
Python Tutorial: List Comprehensions Step-By-Step
Real Python
49 Leveraging Python's Implicit "return None" Statements
Leveraging Python's Implicit "return None" Statements
Real Python
50 What's the meaning of underscores (_ & __) in Python variable names?
What's the meaning of underscores (_ & __) in Python variable names?
Real Python
51 Python Data Structures: Sets, Frozensets, and Multisets (Bags)
Python Data Structures: Sets, Frozensets, and Multisets (Bags)
Real Python
52 Writing automated tests for Python command-line apps and scripts
Writing automated tests for Python command-line apps and scripts
Real Python
53 How to find great Python packages on PyPI, the Python Package Repository
How to find great Python packages on PyPI, the Python Package Repository
Real Python
54 Immutable vs Mutable Objects in Python
Immutable vs Mutable Objects in Python
Real Python
55 PyPI vs Warehouse, the Next-Generation Python Package Repository
PyPI vs Warehouse, the Next-Generation Python Package Repository
Real Python
56 pep8.org โ€” The Prettiest Way to View the PEP 8 Python Style Guide
pep8.org โ€” The Prettiest Way to View the PEP 8 Python Style Guide
Real Python
57 My Experience at PyCon 2017 in Portland
My Experience at PyCon 2017 in Portland
Real Python
58 Pylint Tutorial โ€“ How to Write Clean Python
Pylint Tutorial โ€“ How to Write Clean Python
Real Python
59 "Reverse a List in Python" Tutorial: Three Methods & How-to Demos
"Reverse a List in Python" Tutorial: Three Methods & How-to Demos
Real Python
60 Python Refactoring: "while True" Infinite Loops & The "input" Function
Python Refactoring: "while True" Infinite Loops & The "input" Function
Real Python

The video teaches viewers how to remember useful Python code snippets by using note-taking apps and starting a blog, which can help improve their coding skills and build a public portfolio.

Key Takeaways
  1. Choose a note-taking app like Quiver or Simplenote
  2. Take notes on useful code snippets
  3. Add keywords to make notes searchable
  4. Consider starting a blog to share knowledge and build a public portfolio
  5. Use the blog to share code snippets and experiences
๐Ÿ’ก Using a note-taking app and starting a blog can help programmers remember useful code snippets and build a public portfolio, which can be beneficial for their career.
๐Ÿ”’ Pro feature: Ask AI to explain this lesson โ†’

Related AI Lessons

Up next
How to Open HPL Files (HP-GL Plotter)
File Extension Geeks
Watch โ†’