In this step-by-step tutorial, you'll learn about generators and yielding in Python. You'll create generator functions and generator expressions using multiple Python yield statements. You'll also learn how to build data pipelines that take advantage of these Pythonic tools.
In this course, you’ll learn all about Thonny, a free Python Integrated Development Environment (IDE) that was especially designed with the beginner Pythonista in mind. It has a built-in debugger and allows you to do step-through expression evaluation.
This step-by-step tutorial gives you the tools you need to start making asynchronous programming techniques a part of your repertoire. You'll learn how to use Python async features to take advantage of IO processes and free up your CPU.
This week we welcome Peter Farrell (@hackingmath) as our PyDev of the Week! Peter is the author Math Adventures with Python and two other math related Python books. You can learn more about Peter by visiting his website. Let’s take a few moments to get to know Peter! Can you tell us a little about yourself (hobbies, education, etc): I was brought up in the US, earned a B.A. in Math and taught Math for 8 years in big and small schools. I always wanted to show students the real-world applications of the stuff they were learning, all of which turned out to be computer-related. I learned to program in my 30’s in Logo by going page-by-page through Samuel Papert’s brilliant book Mindstorms. After that I taught all my math classes turtle programming. A student turned me on to Python and I never looked back. Away from the computer, I like to play guitar and watch documentaries. Continue reading PyDev of the Week: Peter Farrell →
A code kata is a fun way for computer programmers to practice coding. They are also used a lot for learning how to implement Test Driven Development (TDD) when writing code. One of the popular programming katas is called FizzBuzz. This is also a popular interview question for computer programmers. The concept behind FizzBuzz is as follows: Write a program that prints the numbers 1-100, each on a new line For each number that is a multiple of 3, print “Fizz” instead of the number For each number that is a multiple of 5, print “Buzz” instead of the number For each number that is a multiple of both 3 and 5, print “FizzBuzz” instead of the number Now that you know what you need to write, you can get started! Continue reading Python Code Kata: Fizzbuzz →
There are several ways to represent integers in Python. In this quick and practical tutorial, you'll learn how you can store integers using int and str as well as how you can convert a Python string to an int and vice versa.
In this hands-on course, you'll learn the basics of using pdb, Python's interactive source code debugger. pdb is a great tool for tracking down hard-to-find bugs, and it allows you to fix faulty code more quickly.
In this step-by-step tutorial, you'll learn how to use PyGame. This library allows you to create games and rich multimedia programs in Python. You'll learn how to draw items on your screen, implement collision detection, handle user input, and much more!
This week we welcome Veronica Hanus (@veronica_hanus) as our PyDev of the Week! Veronica is a regular tech speaker at Python and other tech conferences and meetups. You can see some of her talks and her schedule on her website. She has been active in the Python community for the past few years. Let’s take a few moments to get to know her better! Can you tell us a little about yourself (hobbies, education, etc): I enjoy writing and taking pictures. For me, the challenge is to help someone feel what I was feeling when I decided the moment was picture- or story-worthy, and both take a combination of skill-that-you-can-study and plain-old-caring that I find immensely rewarding. Photo-taking excursions are one of my favorite ways to spend time with friends, because they’re a nice combination of “quiet, contemplative side-by-side activity” and “let’s get out and do something”! I once carved out time to take silly pictures with a new conference friend in a funny upside-down room at the conference venue. It amazed me how nice it felt to be fussed over after the stress of my first conference talk. As I started speaking more, I started offering to take pictures of conference attendees and many shared the same sentiment. Many people find conferences overwhelming and it’s nice to take a few minutes and relax, make a new friend, and maybe go home with new headshots. My education often surprises people because it violates many people’s expectations: I don’t hold a CS degree, and I never attended a bootcamp. In college, I studied Geology with a combined geochemical and planetary science twist. Since shifting into software, I have heard countless times “Geology!? That must have been such a… change”. Even today, comments like that feel challenging and exclusionary and early in my career shift it felt terrible. We hear again and again that having folks from diverse backgrounds help teams innovate, but when meeting someone who doesn’t fit our expectations, most of us still do a double-take. If I get that as a white degree-touting former-scientist, imagine the uncomfortable responses folks in groups with more bias encounter when we express our surprise! It turns out that my winding path toward programming has allowed me to make some of my most useful contributions. We don’t talk about it enough, but many use programming skills even if they haven’t written a line of code. If you’re considering development but are wondering how you will fit in, I encourage you to take a peek at communities like Write the Docs (their Slack), #CodeNewbie (their Twitter), or send me a hello via my Twitter or email. Continue reading PyDev of the Week: Veronica Hanus →
In this intermediate-level article, you'll explore the similarities and differences you'll find when comparing Python vs C++. You'll learn about memory management, virtual machines, object-oriented programming differences, and much more!
This week we welcome Aymeric Augustin (@aymericaugustin) as our PyDev of the Week. Aymeric is a core developer of Django, a Python web framework. He is also an entrepreneur and speaker at several Django related conferences. You can catch up with Aymeric over on his website or check out his FOSS contributions on Github. Let’s take a few moments to get to know him better! Can you tell us a little about yourself (hobbies, education, etc): Do you know how to spot a Frenchman? That’s always the first thing they mention! Now that’s out of the way… These days my hobbies center around being the dad of three wonderful girls 🙂 We’re doing a lot of physical activity together: swimming, cycling, gardening, playing music, etc. I’m managing a software engineering department of about 200 people at CANAL+, a French audiovisual media group that operates TV services in several countries. I was trained as a generalist engineer, eventually specializing in Computer Science and Information Technology, but I learnt most of what I do on the job. Continue reading PyDev of the Week: Aymeric Augustin →
The Portable Document Format (PDF) is a well-known format popularized by Adobe. It purports to create a document that should render the same across platforms. Python has several libraries that you can use to work with PDFs: ReportLab – Creating PDFs PyPDF2 – Manipulating preexisting PDFs pdfrw – Also for manipulating preexisting PDFs, but also works with ReportLab PDFMiner – Extracts text from PDFs There are several more Python PDF-related packages, but those four are probably the most well known. One common task of working with PDFs is the need for merging or concatenating multiple PDFs into one PDF. Another common task is taking a PDF and splitting out one or more of its pages into a new PDF. You will be creating a graphical user interface that does both of these tasks using PyPDF2. Continue reading wxPython – Creating a PDF Merger / Splitter Utility →
There are times when you want to rotate images or other objects in ReportLab while creating a PDF. For example, you might want to rotate an image by 45 degrees for watermarking purposes. Or you might need an image that runs vertically along one of the edges of the PDF. You can rotate images by using ReportLab’s canvas methods or by using its higher level Flowables that you can find in the platypus. module. Let’s start by looking at how to do this with the canvas directly! Rotating Images Using Canvas Rotating images using the canvas is kind of confusing. The reason being that when you rotate the canvas, you may end up inadvertently rotating other elements on your canvas if you’re not careful. Let’s take a look at the code: Continue reading Rotating Images in ReportLab →
In this step-by-step tutorial, you'll learn how to use args and kwargs in Python to add more flexibility to your functions. You'll also take a closer look at the single and double-asterisk unpacking operators, which you can use to unpack any iterable object in Python.
I was a guest on the Profitable Python podcast this week. You can check it out here: During the interview, I was asked how I would like to have Python runnable in the browser and I couldn’t recall the name of a product that makes this sort of thing possible. The product I was thinking of was Anvil, which while still not quite having Python in the browser, it’s close. The other product I was thinking of was Microsoft’s Silverlight browser plugin that you can use IronPython in. Or at least you used to be able to. I haven’t looked into that in a while. Here are some links to other things mentioned in this episode: Talk Python and my episode on there: Episode #156: Python History and Perspectives Pyowa: The Iowa Python User Group My books on Leanpub and Amazon One Punch Man manga Test Driven Development in Python website It was great to be on the show. I always enjoy talking about Python. Feel free to ask me any questions about anything mentioned in the Podcast or about the Podcast itself.
This week we welcome Katherine Kampf (@kvkampf) as our PyDev of the Week! Katherine is a Program Manager at Microsoft, specifically for Azure Notebooks, which is Microsoft’s version of Jupyter Notebook. She also recently gave a talk at EuroPython 2019. Let’s take a few moments getting to know Katherine better! Can you tell us a little about yourself (hobbies, education, etc): Sure! I am currently a Program Manager for Azure Notebooks at Microsoft. I joined the company in 2017 and started working on the Big Data team. After some time there, I decided to move closer towards notebooks and Python which led me to the Python Tools team which has been a blast. Before starting at Microsoft, I graduated from the University in Michigan where I studied Computer Science. I also grew up Ohio so the Midwest was home for quite a while and will always have my heart. While at UofM, I was also lucky enough to TA our introductory computer science course which covered both C++ and Python. I loved helping folks learn new concepts, and I’m so glad I get to continue this in some form by speaking at conferences! Nowadays, I’m based in Seattle and love living the stereotypical Pacific Northwest life. I tend to spend my weekends skiing in the winter and hiking in summer. In between those, I love to travel around and am working on visiting all the U.S. National Parks! I’m also a dog-enthusiast and am always working on being friends’ go-to dog sitter Continue reading PyDev of the Week: Katherine Kampf →
I was recently interviewed on the Lucid Programming Podcast by Vincent Russo about writing books about Python. You can listen to the audio here: If you’d like to know more about how I write books, you might enjoy this article I wrote on the topic. I also wrote an article on the Pros and Cons of Indy Publishing. Last week, I was honored to be on the Profitable Python podcast. Related Podcasts Other podcasts I have been on: Last week, I was honored to be on the Profitable Python podcast. Talk Python Episode #156: Python History and Perspectives Podcast.__init__ – Mike Driscoll And His Career In Python – Episode 169
This week we welcome Raphael Pierzina (@hackebrot) as our PyDev of the Week! Raphael is a core developer of pytest, a popular testing framework for Python. You can learn more about Raphael by visiting his blog or checking out his Github profile. Let’s take a few moments to get to know Raphael! Can you tell us a little about yourself (hobbies, education, etc) My background is in 3D visualization and animation. After graduating from university with a Bachelor of Arts in Design, I worked as a software developer for a visual effects company for a few years and built applications for digital artists. Fast forward to today, after having worked at a few other software companies, I’m now at Mozilla where I work on Firefox Telemetry. I manage projects to reduce Telemetry related blind-spots in our Firefox browser products and support our Software Engineers and Data Engineers in increasing the automated test coverage for the Firefox Telemetry component and our Firefox Data Platform. I wrote about my first year at Mozilla on my blog earlier this year in February, if you’d like to find out more about my work. For fun, I like to run fast, read books, and enjoy the outdoors. 🏔 Continue reading PyDev of the Week: Raphael Pierzina →
In this series of videos you'll get an overview of the features of the Real Python platform, so you can make the most of your membership. Follow along and get tips on: How to find the most valuable learning resources for your current skill level, how to meet and interact with other students and the RP Team, how to learn effectively, and more.
Twitter is a popular social network that people use to communicate with each other. Python has several packages that you can use to interact with Twitter. These packages can be useful for creating Twitter bots or for downloading lots of data for offline analysis. One of the more popular Python Twitter packages is called Tweepy. You will learn how to use Tweepy with Twitter in this article. Tweepy gives you access to Twitter’s API, which exposes the following (plus lots more!): Tweets Retweets Likes Direct messages Followers This allows you to do a lot with Tweepy. Let’s find out how to get started! Getting Started The first thing that you need to do is create a Twitter account and get the credentials you will need to access Twitter. To do that, you will need to apply for a developer account here. Once that is created, you can get or generate the following: Consumer API Key Consumer API Secret Access token Access secret If you ever lose these items, you can go back to your developer account and regenerate new ones. You can also revoke the old ones. Note: By default, the access token you receive is read-only. If you would like to send tweets with Tweepy, then you will need to make sure you set the Application Type to “Read and Write”. Continue reading Using Twitter with Python and Tweepy →
In this Python tutorial, you'll learn what you need to know to manage users in Django admin. Out of the box, Django admin doesn't enforce special restrictions on the user admin. This can lead to dangerous scenarios that might compromise your system.
This week we welcome Eric Matthes (@ehmatthes) as our PyDev of the Week! Eric is the author of the popular book, Python Crash Course. He also created a neat set of Python Flash Cards that I reviewed earlier this year. You can catch up with Eric on his website or check out some of his work on Github. Let’s take a few moments to get to know Eric better! Can you tell us a little about yourself (hobbies, education, etc): Sure! I grew up in southern New Hampshire, on the outskirts of Boston in the early 1980s. My father was a software engineer at DEC around that time, and I first learned to program on a kit computer in our basement back then. I am so grateful to my father for sharing the technology he had at home, instead of telling me to keep away from it all. It has been amazing to watch computers evolve from the early days of almost no one having a home computer to almost everyone having multiple computers in their lives. I loved math and science in high school, and I went into undergrad as a chemical engineering major because I loved AP Chemistry. But I soon found that engineering was really about learning to solve other people’s problems. I enjoyed my physics classes though, because they were all about understanding the universe, from the very large to the very small. For a while I naively worried that if I stayed with physics long enough I’d start to find the world less interesting as I understood it on a deeper level. It was a joy to discover that the opposite was true: the more I learned, the more fascinating everything around me became. I continued to learn new programming languages throughout my educational experiences. I took a variety of programming classes, and always had a few projects going for fun. I wrote a 3d graphing program in C during spring break one year in college. I wanted to be a particle physicist, but I didn’t want to be a student forever. I decided to try teaching for a couple years, and quickly found that the intellectual challenge of trying to reach every student in my classes was just as satisfying as doing hard science. I loved teaching, and decided to stay with it. In 2011 my son was born, and a month later my father died. It was a really hard time, but it was also a formative experience for me. My mother asked me to look through my father’s computer and let her know if there was anything worth saving. It was a really intimate experience, looking through all the projects he was working on, and reading through his notes. I used to visit him in his office whenever I went home, and as long as his computer was open and running that day I still felt directly connected to him. It was sad to realize these projects would never be finished, and would never be used by anyone. In the weeks that followed I realized that if I died you’d find a bunch of half-finished projects on my computer as well. I made a commitment to start using the skills I’d learned to build something meaningful. I wanted to build tools that would bring greater equity to public education. I gave a talk at PyCon 2013 about how much the educational world could gain from the open source model, and Bill Pollock of No Starch Press approached me afterwards. “I hope you build what you described, and if you ever want to write a technical book let me know.” I went back to my classroom and saw a poster hanging on my wall: “What’s the least you need to know about programming in order to start building meaningful projects?” It was a list I had made for my students of the smallest set of things they needed to know in order to be able to build the things they cared about like games, data visualizations, and simple web apps. I realized that was the book I wanted to write, and the question on that poster became the guiding question for Python Crash Course. I hadn’t intended to write a book, but I realized that in five years of trying to teach programming to high school students, all the resources I found were either aimed at young kids, or assumed more technical knowledge and experience than my students had. I decided to write a book for anyone old enough to not want a kids book. It has been immensely satisfying to see that Python Crash Course works for almost everyone in that anticipated audience: young kids motivated enough to want a more serious book, high school students, undergrads in all majors, grad students, working adults, and retired people who are curious to learn programming at an older age. I was surprised to find it even works well for people who are already fluent in another language, and want to pick up Python quickly. Continue reading PyDev of the Week: Eric Matthes →
In this tutorial for Python developers, you'll take your first steps with Spark, PySpark, and Big Data processing concepts using intermediate Python concepts.
Введение в uWSGI
Выход в свет: как собрать пакет с Python-приложением
This week we welcome Ines Montani (@_inesmontani) as our PyDev of the Week! Ines is the Founder of Explosion AI and a core developer of the spaCy package, which is a Python package for Natural Language Processing. If you would like to know more about Ines, you can check out her website or her Github profile. Let’s take a few moments to get to know her better! Can you tell us a little about yourself (hobbies, education, etc): Hi, I’m Ines! I pretty much grew up on the internet and started making websites when I was 11. I remember sitting in school and counting the hours until I could go back home and keep working on my websites. I still get that feeling sometimes when I’m working on something particularly exciting. I wasn’t quite sure what to do with my life, so I ended up doing a combined degree of media science and linguistics and went on to work in the media industry for a few years, leading marketing and sales. But I always kept programming and building things on the side. In 2016, I started Explosion, together with my co-founder Matt. We specialise in developer tools for Machine Learning, specifically Natural Language Processing – so basically, working with and extracting information from large volumes of text. Our open-source library spaCy is a popular package for building industrial-strength, production-ready NLP pipelines. We also develop Prodigy, an annotation tool for creating training data for machine learning models. I’m based in Berlin, Germany, and if I’m not programming, I enjoy bouldering 🧗♀️, eating good food 🥘 and spending time with my pet rats . Continue reading PyDev of the Week: Ines Montani →
It’s summer time and now is a great time to learn Python! To help with that, I am running a sale of my Python books for the next week. The sale ends August 6th. All books are $9.99-$14.99 on Leanpub! Creating GUI Applications with wxPython Creating GUI Applications with wxPython is my latest book. In it you will learn how to create cross-platform desktop applications using wxPython. Use this link or click the image above to get a discount. Jupyter Notebook 101 The Jupyter Notebook is a great teaching tool and it’s a fun way to use and learn Python and data science. I wrote a nice introductory book on the topic called Jupyter Notebook 101. ReportLab – PDF Processing with Python Creating and manipulating PDFs with Python is fun! In ReportLab – PDF Processing with Python you will learn how to create PDFs using the ReportLab package. You will also learn how to manipulate pre-existing PDFs using PyPDF2 and pdfrw as well as a few other handy PDF-related Python packages. Python 201: Intermediate Python Python 201: Intermediate Python is a sequel to my first book, Python 101 and teaches its readers intermediate to advanced topics in Python.
In this video course, you'll learn why and how to get started with Python's powerful logging module to meet the needs of beginners and enterprise teams alike.
In this step-by-step tutorial, you'll learn how to use the NumPy arange() function, which is one of the routines for array creation based on numerical ranges. np.arange() returns arrays with evenly spaced values.
This week we welcome Cris Medina (@tryexceptpass) as our PyDev of the Week! Cris is the author behind the popular tryexceptpass blog. He is also the maintainer of sofi and korv. You can catch up with Chris’s other projects on Github. Let’s spend some time getting to know him better! Can you tell us a little about yourself (hobbies, education, etc): I was born in the Dominican Republic. I finished highschool there and went to Puerto Rico to study Computer Engineering, specializing in hardware. But I’ve been writing software in some form since I can remember. My dad introduced me to IBM System 360 Basic as my first language. Go figure! Most of my professional career (going on 17 years now) was spent doing test engineering, along with developing all the hardware and software tools required to execute those tests and maintain their infrastructure. The rest of the time I’ve held formal software engineering roles. I like to spend some of my free time with music. My mother is a music teacher and she got me into piano early on. Though I moved into string instruments as I got older. Today I mostly play classical guitar, but I own several types of guitars and dabble in other string instruments. I also enjoy cooking. My family is from various parts around the Mediterranean, so most of my meals have that flare. Cooking reminds me a little of the dev process: you have some idea of what you want, you follow a basic set of instructions on how to get there, but there’s usually some extra flavor you throw in to make it yours and it can take several iterations to get it just right. Continue reading PyDev of the Week: Cris Medina →