PinnedMy Top 10 Articles for Python (Updated in August, 2021)Some helpful Python tips — Greetings, readers! It’s been one and half years since I started blogging on Medium, and thank you all for the continous support. Here’s a list of my top 10 articles for Python. I hope you’ll find some of them useful. 30 Simple Tricks to Level Up Your Python Coding: a…Python2 min read
Published in Better Programming·4 days agoRunning Python Scripts on the Web Using PyScriptIs it the next big thing? Probably if it continues to evolve — During the 2022 PyCon US conference, one of the keynote speakers Peter Wang unveiled PyScript — a way to write Python script directly within HTML. If you don’t know Peter, you may have heard of Anaconda, which is one of the most popular distributions of Python and R with a…Python6 min read
Published in Better Programming·May 134 Domains of Knowledge You Should Know About Strings in PythonA high-level review of your knowledge about Python strings — Texts are the most fundamental form of information exchange. No matter what applications you’re building, you’ll inevitably deal with textual information in some ways. Thus, it’s critical for you to have a good understanding of the essential techniques in using and processing strings in Python. In this article, I’d like…Python9 min read
May 10Want to Level up Your Python Skills ?— Check Out My New BookLearn pragmatic Python skills — It’s a book about learning pramatic Python skills using solid code examples that address real-life coding problems. It’s current under development, with a planned size of 14 — 15 chapters. You can find more about this book through Manning Early Access Program. I’ll provide updates frequently about the book development…Python2 min read
Published in Better Programming·May 24 New Type Annotation Features in Python 3.11A detailed tutorial — from installation to code examples — On Apr 25, 2022, Python published the latest alpha — 3.11.0a7, which represents the last release for the alpha phase for the 3.11 development. It’ll be moving to the beta phase early in May and the final official version of 3.11 is expected to be released in Oct 2022. I…Python9 min read
Published in Better Programming·Apr 186 Things to Know About Subclassing in Python — Why and HowTouching base on some core features in Python as an OOP language — At its core, Python is an OOP language by design. It has everything implemented as objects, packages, modules, classes, functions, and certainly instance objects of classes. …Programming9 min read
Published in Better Programming·Apr 43 Alternatives for Regular Custom Classes in PythonUse them when appropriate — Most time in any project, we’re working to define a variety of classes to model our data. Thus, building proper classes is an essential technique to make your project robust and maintainable. In general, a custom class takes the following form: class CustomClass # the body of the class pass …Programming5 min read
Published in Better Programming·Mar 30How to Make JSON and Python Talk to Each OtherProcessing and creating JSON data in Python — JavaScript Object Notation (JSON) is a popular data format that is commonly used in data interchanges between different systems. For instance, many APIs return results in the format of JSON data. Given JSON’s remarkable readability and its object-like structure, it’s useful to know how Python handles JSON data. …Programming8 min read
Published in Better Programming·Feb 2How to Write Proper Docstrings for a Python FunctionLearn the best practices for defining a function’s docstrings — When we come across a new function, we often need to look up its documentation to figure out how to use it. For example, we come across the built-in id function and we know that we can check an object’s memory address. However, chances are that we don’t know how…Programming5 min read
Published in Better Programming·Jan 1Know Python Functions Better: Going Beyond 4 Special AttributesHave a deeper understanding of Python functions — Functions are the underlying driving force for any application. They are responsible for processing the data in your application. Thus, we should have a good understanding of Python functions in general. As an object-oriented programming language, Python functions are objects too. It means that it has its own attributes, just…Python4 min read