All posts by Mike

PyDev of the Week: Cheukting Ho

This week we welcome Cheukting Ho (@cheukting_ho) as our PyDev of the Week. Cheuk is an organizer for EuroPython and various Python sprints. You can find our more about her accomplishments on her website or see what open source projects she is a part of over on Github.

Let’s take some time to get to know her better!

Can you tell us a little about yourself (hobbies, education, etc):

I am Cheuk, pronoun she/ her. I came from a Physics research background but had changed my career to become a data scientist when I moved from Hong Kong to London. Now, I had made a change again and work as a developer advocate. This is the result of my love to be involved in the tech community. My newest hobby is to stream coding tutorials and building websites with JAMstack. Continue reading PyDev of the Week: Cheukting Ho

Type Checking in Python

Type checking or hinting is a newer feature of Python that was added in Python 3.5. Type hinting is also known as type annotation. Type hinting is adding special syntax to functions and variable declarations that tell the developer what type the argument or variable is.

Python does not enforce the type hints. You can still change types at will in Python because of this. However some integrated development environments, such as PyCharm, support type hinting and will highlight typing errors. You can also use a tool called Mypy to check your typing for you. You will learn more about that tool later on in this article.

You will be learning about the following:

  • Pros and Cons of Type Hinting
  • Built-in Type Hinting / Variable Annotation
  • Collection Type Hinting
  • Hinting Values That Could be None
  • Type Hinting Functions
  • What To Do When Things Get Complicated
  • Classes
  • Decorators
  • Aliasing
  • Other Type Hints
  • Type Comments
  • Static Type Checking

Let’s get started! Continue reading Type Checking in Python

An Overview of Profiling Tools for Python

What does it mean to profile ones code? The main idea behind benchmarking or profiling is to figure out how fast your code executes and where the bottlenecks are. The main reason to do this sort of thing is for optimization. You will run into situations where you need your code to run faster because your business needs have changed. When this happens, you will need to figure out which parts of your code are slowing it down.

This article will only cover how to profile your code using a variety of tools. It will not go into actually optimizing your code. Let’s get started! Continue reading An Overview of Profiling Tools for Python

PyDev of the Week: Mike Pirnat

This week we welcome Mike Pirnat (@mpirnat) as our PyDev of the Week! Mike is an organizer for PyOhio and an active member of the Python community. You can catch up with Mike on his website. Let’s spend some time getting to know Mike!

Mike Pirnat

Can you tell us a little about yourself (hobbies, education, etc):

Sure! I grew up in a small mountain town in southwest Colorado and moved to Cleveland in the mid-90s to study computer engineering at Case Western Reserve University. A major highlight of my college days was having a radio show for a couple of years. I met my wife there too, so that turned out pretty well. I also enjoyed being part of the team that launched the original online version of the Encyclopedia of Cleveland History. After graduation, I worked for IBM for a little bit, then spent 19 years in the ecard group at American Greetings—mostly in engineering and a few years on the management side—and I’m now happy to be a backend engineer at Zapier. Along the way I discovered that public speaking is pretty fun, wrote a small book, and became a conference organizer.

These days I enjoy a little bit of video gaming, a lot of Dungeons & Dragons, doing day hikes in Cleveland’s lovely metroparks, neglecting my photography processing backlog, and aggravating and embarrassing my 12 year old daughter. And it’s a total “white guy in my early 40s” cliché, but my best hobby decision in recent years was getting myself a guitar and starting to play. I’m not great, but I love it, and it’s definitely paid huge dividends for my mental health in these turbulent times. Whatever kind of instrument you’re interested in, I can guarantee you’re not too old to start! Continue reading PyDev of the Week: Mike Pirnat

Python 101 – Working with Strings

You will be using strings very often when you program. A string is a series of letters surrounded by single, double or triple quotes. Python 3 defines string as a “Text Sequence Type”. You can cast other types to a string using the built-in str() function.

In this article you will learn how to:

  • Create strings
  • String methods
  • String formatting
  • String concatenation
  • String slicing

Let’s get started by learning the different ways to create strings!

Continue reading Python 101 – Working with Strings

PyDev of the Week: Pablo Galindo Salgado

This week we welcome Pablo Galindo Salgado (@pyblogsal) as our PyDev of the Week! Pablo is a core developer of the Python programming language. He is also a speaker at several Python related conferences. If you’d like to see what projects he is contributing to, you can check out his Github profile.

Let’s spend some time getting to know Pablo better!

Can you tell us a little about yourself (hobbies, education, etc):

I am currently working at Bloomberg L.P. in the Python infrastructure team, supporting all our Python developers and providing critical infrastructure and libraries to make sure everyone has better experience programming in Python. But before working on the Software industry I used to be in academia as a theoretical physicist researching general relativity and in particular, black hole physics. This is something that I still do as a hobby (although without the pressures of publication and funding) because I still love it! For instance, I have given some talks in some Python conferences related to this
(https://www.youtube.com/watch?v=p0Fc2jWVbrk) and I continue developing and researching improved algorithms to simulate and visualize different spacetimes. For example, here you have some simulated Kerr Newman black holes with accretion disks around them I have worked on recently:
Continue reading PyDev of the Week: Pablo Galindo Salgado

Python 101 – Learning About Dictionaries

Dictionaries are another fundamental data type in Python. A dictionary is a key, value pair. Some programming languages refer to them as hash tables. They are described as a mapping object that maps hashable values to arbitrary objects.

A dictionary’s keys must be immutable, that is, unable to change. Starting in Python 3.7, dictionaries are ordered. What that means is that when you add a new key, value pair to a dictionary, it remembers what order they were added. Prior to Python 3.7, this was not the case and you could not rely on insertion order.

You will learn how to do the following in this chapter:

  • Create dictionaries
  • Access dictionaries
  • Dictionary methods
  • Modifying dictionaries
  • Deleting from your dictionary

Let’s start off by learning about creating dictionaries! Continue reading Python 101 – Learning About Dictionaries

PyDev of the Week – Abigail Mesrenyame Dogbe

This week we welcome Abigail Mesrenyame Dogbe (@MesrenyameDogbe) as our PyDev of the Week! Abigail is active with the PyLadies organization in Africa and has also helped organize PyCon Africa. Abigail is also a fellow of the Python Software Foundation.

Abigail Dogbe

Let’s spend some time getting to know Abigail better!

Can you tell us a little about yourself (hobbies, education, etc):

I worked with the Internal Audit Department at the Ghana Community Network Services Limited (GCNet) after obtaining a BSc in Computer Science and Engineering from the University of Mines and Technology in Tarkwa, Ghana. Growing up, I struggled with Mathematics and did lots of drawings, paintings, and singing during my hobbies. My hobbies became numerous as I matured so much that I no longer make drawings and paintings but I’ve found happiness in playing with African beads to make accessories and I still sing a lot, although mostly to smaller groups or to myself.

I have a great interest in sports such as volleyball, football and swimming as well. During my final year at the university, I was elected as the captain of the women’s volleyball team. We had lots of training sessions and won a few matches. I am actually impressed with how far the team has come after I completed school.

Also, I have a keen interest in Tech Community Building and I find joy in helping others grow in their career. Continue reading PyDev of the Week – Abigail Mesrenyame Dogbe

Python 101 – Learning About Tuples

Tuples are another sequence type in Python. Tuples consist of a number of values that are separated by commas. A tuple is immutable whereas a list is not. Immutable means that the tuple has a fixed value and cannot change. You cannot add, delete or modify items in a tuple. Immutable objects are useful when you need a constant hash value. The most popular example is the key to a Python dictionary.

In this article, you will learn how to:

  • Create tuples
  • Work with tuples
  • Concatenate tuples
  • Special case tuples

Let’s find out how to create tuples! Continue reading Python 101 – Learning About Tuples

Stuck at Home Python Book Sale

Python is one of the most popular languages in the world. I have been using it myself for over a decade and am still constantly learning new things.

Since so many people are stuck at home, I thought it might be a good time to do a book sale. Now is great time to learn Python or learn a new skill using Python.

With that in mind, I have all my books for sale. Just use the special links below to get the sale price:

There are free chapters available at each of the links. You can download the sample by clicking on the Read Free Sample button on the left.

Feel free to ask me any questions you might have about the books.