Anatomy of String Formatting in Python
Python Geeks
by Python Geeks
4y ago
Python is a modern scripting language, so it offers us a flexible and readable coding. Therefore, we can do one thing in many different ways. That’s why until now we have even 4 main methods to format a string: “Classic Style” String Formatting “Modern Style” String Formatting “Latest Style” String Formatting “Standard Style” String Formatting In this post, we walk through every style of string formatting, do an example for each style, and get understand how it works. At the end of this post, we understand well everything about the string formatting methods in Python. And hopefully, it wil ..read more
Visit website
Step by step to store data locally in Flutter
Python Geeks
by Python Geeks
4y ago
Introduction Most mobile apps need to store persistence data locally. There are many reasons to do so, from restoring the app state at the last session, to improve app performance. Therefore, Flutter offers us several ways to accomplish this feature. In this post, I will introduce to you 3 different ways to store persistence data in Flutter: Store key-value to shared_preference Saving data to a local database Writing and reading a file Prerequisites Before starting, I assume you already know the very basic Flutter things as below: Getting Start Guide. Have your own favorite IDE and alread ..read more
Visit website
How to make a clickable Container in Flutter
Python Geeks
by Python Geeks
4y ago
Many times while you are working in Flutter, you would like to allow onTap in the Container widget. However, the Container widget doesn’t have onTap or onPress method. So this post is exactly for you, at the end of this post we will know 2 ways to enable onTap method in a Container. By default, there is no onTap method in the Container widget. So it can make some developers, including me, confuse a lot because don’t know how to make a clickable Container. I will introduce you 2 ways to do it easily: Wrap Container with InkWell widget Using GestureDetector to detect a click Using In ..read more
Visit website
Python *args & **kwargs in depth
Python Geeks
by Python Geeks
4y ago
Today, in Python explained, we are welcome to see one of the most mysterious things with a new Python learner. It is *args and **kwargs variables. We will figure out below questions: What is *args and **kwargs variables? When SHOULD and SHOULD NOT use *args and **kwargs The * and ** (asterisk) operators in *arg and **kwargs By answering questions, we step by step to understand these two special variables. And I strongly believe that you will be confident to use it in your next project. What is *arg? *args represents for arguments, it means we can pass many arguments to a functio ..read more
Visit website
Python là gì? Có nên học Python? Bí quyết học Python từ cơ bản đến nâng cao
Python Geeks
by Python Geeks
4y ago
Python là gì? Có nên học Python? Bí quyết học Python từ cơ bản đến nâng cao Python là ngôn ngữ lập trình rất thịnh hành trong những năm gần đây. Và đặc biệt là có nhiều tin đồn rằng làm lập trình viên Python lương rất cao, cao hơn so với những ngôn ngữ lập trình có vẻ lâu đời hơn như C/C++, .Net or PHP. Vậy Python là gì và sự thật có như lời đồn? Bài viết này sẽ chia sẻ cơ bản Python là gì, điểm mạnh, điểm yếu của ngôn ngữ này. Thêm vào đó sẽ là các bí quyết để có thể học và sử dụng Python thành thạo. Ngoài ra cung cấp thêm các số liệu về thị trường Python trên thế giới. Python là gì? Pyth ..read more
Visit website
3 Different Methods To Reverse Python List
Python Geeks
by Python Geeks
4y ago
In-place reverse, slicing list, and reverse iterator are three main methods to reverse a list or array in Python. In this article, we see how to do every single method via the examples. Method #1: In-Place Reverse List According to Python Document, we can use the built-in reverse() method to reverse a list in place. It’s easy, however, we should notice the “in-place”. It means this method will modify your original list directly. >>>A = [1, 2, 3, 4, 5] >>>print(A.reverse()) None >>>A [5, 4, 3, 2, 1] As you can see in the example, A.reverse() will return N ..read more
Visit website
How to duplicate a page in wordpress
Python Geeks
by Python Geeks
4y ago
While creating a new page can cost you a lot of time from design to make it done, duplicated it is a lot easier. In this post, I will give you 2 super easy methods to duplicate a page in WordPress. Although there are many ways out there to duplicate a page in WordPress, we can group it in 2 main types. I would like to name these types as plugin fans and programming fans. Each type of method has its own pros and cons. In scope of this article, I just show you how to do it as a plugin fan. However, if you love to do it by editing the WordPress codebase, try a method in this article. How pl ..read more
Visit website
How To Drop A Column In Pandas
Python Geeks
by Python Geeks
4y ago
It is a common situation when we have to drop one or multiple columns in Pandas Dataframe. The Pandas library offers us a built-in function, DataFrame.drop(), to do it easily. Prerequisite Any example in Pandas will start with creating a DataFrame. We assume that you have the essential knowledge of Pandas. If you haven’t, you can visit our Python Pandas for Beginner Tutorial. And now, creating a new DataFrame for the examples: import numpy as np import pandas as pd dates = pd.date_range('20191001', periods=6) dataframe = pd.DataFrame(np.random.randn(6, 4), index=dates, columns=li ..read more
Visit website
Python Tips #1: Generator And Yield Keyword In 5 Minutes
Python Geeks
by Python Geeks
4y ago
Python Tips #1: Generator And Yield Keyword In 5 Minutes Python generator gives us a lazy iterator that is introduced in PEP255. We probably guess the idea from the “lazy” term. It means we are able to evaluate the piece of code whenever you want. It’s hard to understand clearly, right? For easier to understand the idea behind the lazy iterator. Imagine that we have a book, 100 pages, but we have many things to do today and we can’t read all day. So we decided that we will read 1-page per day, mark the current page with a bookmark and stop reading. Every single step will be repeated ..read more
Visit website
Sending Email With Python
Python Geeks
by Python Geeks
4y ago
Sending Email with Python Sending email is a very common task in any system. You probably found this tutorial because you want to send emails using Python. In this tutorial, we will learn how to send emails with and without attachment/HTML contents in Python. After complete the tutorial, I have combined all code example to one beautiful CLI. Check out the project repository to get the full code example, and you can see a beautiful CLI as below: Sending Email With Python CLI Getting Started To get started with the tutorial, we have to set up an SMTP Server and log in to send out the em ..read more
Visit website

Follow Python Geeks on FeedSpot

Continue with Google
Continue with Apple
OR