PythoFF

Menu

Sign in:

read us on

home/2019/04/29/95f6ae9f70fd0b84e71eebc985cc5b879f3d3419.jpg

How to Get the Most Out of PyCon

In this article, you'll learn how you can get the most out of PyCon. Whether you're a first-timer or a seasoned attendee, this guide will help you get ready to have a great PyCon.

PyDev of the Week: Neil Muller

This week we welcome Neil Muller as our PyDev of the Week! Neil is an organizer for Cape Town Python User Group and PyCon ZA. He also speaks at conferences! You can learn more about his open source projects over on Github. Let’s take a few moments to get to know Neil better! Can you tell us a little about yourself (hobbies, education, etc): I’m an Applied Mathematician with interests in image processing and numerical computation, currently living and working in the Cape Town area, South Africa. I followed an interest in facial recognition into a PhD from the University of Stellenbosch, and that led to working on a variety of image processing and numerical modelling problems at iThemba LABS. These days I split my working time between iThemba LABS and Praelexis, a machine learning company (mainly using Python) in Stellenbosch. In my spare time, I am obsessed with board and card games, especially Vampire: The Eternal Struggle. Continue reading PyDev of the Week: Neil Muller →

home/2019/04/25/92e0b5c09d74ec8fae7e8b3daaf0d932949d5862.jpg

Conditional Statements in Python (if/elif/else)

In this step-by-step tutorial you'll learn how to work with conditional ("if") statements in Python. Master if-statements step-by-step and see how to write complex decision making code in your programs.

home/2019/04/24/1c987d03edd483a23794bcf1a5b38021044c8f9d.jpg

Python KeyError Exceptions and How to Handle Them

In this tutorial, you'll learn how to handle Python KeyError exceptions. They are often caused by a bad key lookup in a dictionary, but there are a few other situations when a KeyError can be raised as well. Knowing how to handle these exceptions is essential to writing good Python code.

home/2019/04/22/6ac4712b82b5b1822545d121c560409898b3521b.jpg

A Beginner’s Guide to the Python time Module

In this tutorial, you'll learn how to use the Python time module to represent dates and times in your application, manage code execution, and measure performance.

PyDev of the Week: Dane Hillard

This week we welcome Dane Hillard (@easyaspython) as our PyDev of the Week! Dane is the author Practices of the Python Pro, an upcoming book from Manning. He is also a blogger and web developer. Let’s take some time to get to know Dane! Can you tell us a little about yourself (hobbies, education, etc): I’m a creative type, so many of my interests are in art and music. I’ve been a competitive ballroom dancer, and I’m a published musician and photographer. I’m proud of those accomplishments, but I’m driven to do most of this stuff for personal fulfillment more than anything! I enjoy sharing and discussing what I learn with others, too. When I have some time my next project is to start exploring foodways, which is this idea of exploring food and its cultural impact through written history. I’ve loved cooking (and food in general) for a long time and I want to get to know its origins better, which I think is something this generation is demanding more from industries as a whole. Should be fun! Continue reading PyDev of the Week: Dane Hillard →

Mozilla Announces Pyodide – Python in the Browser

Mozilla announced a new project called Pyodide earlier this week. The aim of Pyodide is to bring Python’s scientific stack into the browser. The Pyodide project will give you a full, standard Python interpreter that runs in your browser and also give you access to the browsers Web APIs. Currently, Pyodide does not support threading or networking sockets. Python is also quite a bit slower to run in the browser, although it is usable for interactive exploration. The article mentions other projects, such as Brython and Skulpt. These projects are rewrites of Python’s interpreter in Javascript. Their disadvantage to Pyodide is that they cannot use Python extensions that were written in C, such as Numpy or Pandas. Pyodide overcomes this issue. Anyway, this sounds like a really interesting project. I always thought the demos I used to see of Python running in Silverlight in the browser were cool. That project is basically dead at this point, but Pyodide sounds like a really interesting new hack at getting Python into the browser. Hopefully it will go somewhere.

Creating a GUI Application for NASA’s API with wxPython

Growing up, I have always found the universe and space in general to be exciting. It is fun to dream about what worlds remain unexplored. I also enjoy seeing photos from other worlds or thinking about the vastness of space. What does this have to do with Python though? Well, the National Aeronautics and Space Administration (NASA) has a web API that allows you to search their image library. You can read all about it on their website. The NASA website recommends getting an Application Programming Interface (API) key. If you go to that website, the form that you will fill out is nice and short. Technically, you do not need an API key to make requests against NASA’s services. However they do have rate limiting in place for developers who access their site without an API key. Even with a key, you are limited to a default of 1000 requests per hour. If you go over your allocation, you will be temporarily blocked from making requests. You can contact NASA to request a higher rate limit though. Interestingly, the documentation doesn’t really say how many requests you can make without an API key. The API documentation disagrees with NASA’s Image API documentation about which endpoints to hit, which makes working with their website a bit confusing. For example, you will see the API documentation talking about this URL: https://api.nasa.gov/planetary/apod?api_key=API_KEY_GOES_HERE But in the Image API documentation, the API root is: https://images-api.nasa.gov For the purposes of this tutorial, you will be using the latter. Continue reading Creating a GUI Application for NASA’s API with wxPython →

home/2019/04/18/96150078ff4181e706def6e9aaaea3fdc2149bd0.jpg

Immutability in Python

In Python, immutable vs mutable data types and objects types can cause some confusion—and weird bugs. With this course you'll see what the difference between mutable and immutable data types is in Python, and how you can use it to your advantage in your own programs.

home/2019/04/17/b82e517e3e5122c6de80d414646b4f761904ee0a.jpg

How to Work With a PDF in Python

In this step-by-step tutorial, you'll learn how to work with a PDF in Python. You'll see how to extract metadata from preexisting PDFs . You'll also learn how to merge, split, watermark, and rotate pages in PDFs using Python and PyPDF4.

Основные концепции журналирования в Python

По мере того, как усложняется структура приложения, ведение логов (журналирование) становится всё полезнее для разработчика. Логи не только пригодятся в процессе отладки, но и помогут обнаружить скрытые проблемы проекта, а также отследить его производительность.

home/2019/04/16/b841af8c938beee1af14181040509d9d93665ef3.jpg

Hands-on Python 3 Concurrency With the asyncio Module

Learn how to speed up your Python 3 programs using concurrency and the asyncio module in the standard library. See step-by-step how to leverage concurrency and parallelism in your own programs, all the way to building a complete HTTP downloader example app using asyncio and aiohttp.

Пишем одностраничное приложение с Flask и Vue.js

Эта статья — пошаговое руководство по настройке базового CRUD-приложения с помощью Vue и Flask. Начнём с создания нового приложения Vue, используя Vue CLI, а затем перейдём к выполнению основных операций CRUD с помощью RESTful API на бэкенде под управлением Python и Flask.

home/2019/04/15/762e665f1413e6f8b00ff449b23ec53ae5f3339d.jpg

Linear Regression in Python

In this step-by-step tutorial, you'll get started with linear regression in Python. Linear regression is one of the fundamental statistical and machine learning techniques, and Python is a popular choice for machine learning.

PyDev of the Week: Pierre Denis

This week we welcome Pierre Denis as our PyDev of the Week! Pierre is the creator of Lea, a probabilistic programming package in Python. He can be found on LinkedIn where you can see his CV and learn more about some of the things he is up to. Let’s take a few moments to get to know Pierre better! Can you tell us a little about yourself (hobbies, education, etc): I’ve a Master in Computer Science from UCL Louvain-la-Neuve, Belgium, where I reside. I’m working since 20 years as software engineer in [Spacebel](http://www.spacebel.be), a company developing systems for Space. Basically, I like everything creative and elegant. Beside arts, music, literature, I ‘m looking for this in physics, algorithmic, GUI and mathematics. I love programming, especially in Python. So far, I have initiated three open-source Python projects: UFOPAX (textual virtual universe), Unum (quantities with unit consistency) and Lea (probabilistic programming). For these developments, I tend to be perfectionist and consequently slow: I’m the kind of guy that re-write the same program ten times, just for the sake of inner beauty! Beside programming, I’m doing research in number theory (twin primes conjecture). Also, I’m writing short stories in French, my mother tongue, with some reference to the ‘Pataphysics of Alfred Jarry and a lot of nonsense. Incidentally and fortunately, programs can be good for producing nonsense, as I showed in my bullshit generator! Continue reading PyDev of the Week: Pierre Denis →

home/2019/04/14/6d917c4499fd3512c7a4c1286dfa62cde2005fe5.jpg

Python String Formatting Tips & Best Practices

Learn the four main approaches to string formatting in Python, as well as their strengths and weaknesses. You'll also get a simple rule of thumb for how to pick the best general purpose string formatting approach in your own programs.

Python Used to Take Photo of Black Hole

Scientists have used a new algorithm to take a photo of a black hole. One of the most exciting parts about it to me is that they used a lot of Python libraries to do the magic. Here’s a list mentioned in their paper: Numpy (van der Walt et al. 2011) Scipy (Jones et al. 2001) Pandas (McKinney 2010) Jupyter (Kluyver et al. 2016) Matplotlib (Hunter 2007). Astropy (The Astropy Collaboration et al. 2013, 2018) They also used their own custom Python code which is available on Github If you’re interested in a more laymen’s explanation of the ideas behind taking the photo, there’s a nice TED talk on it from one of the researchers: Related Links Reddit Python group discussing these developments A Photo of the researcher that appears to show Matplotlib running.

home/2019/04/09/a1f949e84cb8a3fc620f80f3dc408657a2dd39c0.jpg

Running Python Scripts

This step-by-step course will guide you through a series of ways to run Python scripts, depending on your environment, platform, needs, and skills as a programmer.

ReportLab: Adding a Chart to a PDF with Python

The ReportLab toolkit supports adding many different charts and graphs to your PDFs. In fact, I have covered some of them in a previous article. However most of the examples I have seen, including the ones in my own article, do not show how to insert a chart as a Flowable. What that means is that most examples show you how to create a PDF with a single page that contains the chart in it. Most developers would want to be able to create some text, perhaps a table and insert the chart along with those elements. You would also usually have additional text following the chart. For this article, you will learn how to do just that. Continue reading ReportLab: Adding a Chart to a PDF with Python →

home/2019/04/08/37b50864a3c49d87b1786bad7821a3bb9eb11626.jpg

Python REST APIs With Flask, Connexion, and SQLAlchemy – Part 3

In Part 3 of this series, you'll learn how to add relationships to the database created in Part 2 and extend the API to support CRUD operations on those relationships using SQLAlchemy and Marshmallow.

PyDev of the Week: Abdur-Rahmaan Janhangeer

This week we welcome Abdur-Rahmaan Janhangeer as our PyDev of the Week! Abdur-Rahmaan is the French translator of Think Python. You can see what he is up to on his blog as well as 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): I’m Abdur-Rahmaan Janhangeer from Mauritius, a paradise island in the Indian Ocean and currently one of the best tourist destinations. I have an IT business and i am shyly becoming a Python Trainer. I am mostly self-taught in programming. Concerning Python, I’m the Arabic Coordinator for the Python docs, translator of Think Python into French (publishing soon) and organising member for the py user-group of Mauritius. I also did some really tiny contributions to LinuxMint, Numpy and Odoo. As “hobby”, i like to dig into Compiler Theory and code some toy langs in my spare time. Being a gallery moderator, I use InkScape to design logos and business cards for people. Playing around with graphics! Continue reading PyDev of the Week: Abdur-Rahmaan Janhangeer →

home/2019/04/04/89fe5039a52a329d89f8abd6c4d1f9af75b55c9f.jpg

Python Development in Visual Studio Code (Setup Guide)

In this course, you'll learn how to use Visual Studio Code for Python development. By following examples, you'll cover everything from how to install and configure Visual Studio Code for Python development to how to run tests and debug application, so you can use this powerful tool.

home/2019/04/03/07adb53fc0c78a7843cf0acca01ac1c503845e78.jpg

What Is Pip? A Guide for New Pythonistas

What is pip? In this beginner-friendly tutorial, you'll learn how to use pip, the standard package manager for Python, so that you can install and manage additional packages that are not part of the Python standard library.

home/2019/04/02/8a71065e3ad9e6c48b1fd8c7d38410430cd83d14.jpg

Idiomatic Pandas: Tricks & Features You May Not Know

In this course you'll see how to use some lesser-used but idiomatic Pandas capabilities that lend your code better readability, versatility, and speed.

Product Review: Python Flash Cards

No Starch Press is best known for creating books on computer programming. However they recently released a new product called Python Flash Cards by Eric Matthes, the author of Python Crash Course. I thought this was a unique product and decided to ask for a review copy. The cards and their box are high quality. I like the card stock they used quite a bit. The cards themselves target Python 3.7. Each card is marked with a color along their top that matches their category: The cards are also numbered. This is useful for the times where the cards make reference to other cards in their section or other sections entirely. It makes referring to different cards nice and straight-forward. Of course, flash cards are by their very nature, short and to the point. So the testing and packaging sections of cards feel too brief to me. On the other hand, they are flash cards, so the medium doesn’t allow them to be fleshed out the way I would want them to be. If you need more details, Google is never far away. While I am certainly not the target market for these cards, I think they will work well for high school students and possibly even freshmen in college that want to learn. They are certainly useful for refreshing yourself on the basics of Python. If you have students, this set may prove quite useful for them. Python Flash Cards by Eric Matthes Amazon, No Starch Book Reviews Book Review – Mission Python: Code a Space Adventure Game! by Sean McManus Serious Python: Black-Belt Advice on Deployment, Scalability, Testing, and More by Julien Danjou Python Testing with pytest by Brian Okken Module Programming with Python by Erik Westra Python Playground – Geeky Projects for the Curious Programmer by Mahesh Venkitachalam IPython Notebook Essentials by L. Felipe Martins

home/2019/04/01/7dd3e2a57262c040192633d8a5975821f8865152.jpg

Get Started With Django Part 1: Build a Portfolio App

In this step-by-step tutorial, you'll learn the basics of creating powerful web applications with Django, a Python web framework. You'll build a portfolio application to showcase your web development projects, complete with a fully functioning blog.

My Cover Story for Creating GUI Applications with wxPython Book

I thought it would be fun to write a bit about the cover art for my new book, Creating GUI Applications with wxPython. I had meant to post about that during the actual Kickstarter campaign. My original idea for the cover was to have the mouse directing a Phoenix to attack a snake. The Phoenix is a reference to the code name for wxPython 4 before it was released and you can still see references to Phoenix in the documentation and the artwork on some of the pages for the wxPython project. In fact, I commissioned that cover to be done. Here’s a sketch of it: Original cover concept art As you can see, the artist had trouble remembering that the snake should be a Python. He continued to make lazy mistakes in the finished product and I ended up scrapping that cover. I am not sure if I will use that cover for a future book or not. I personally like the look of the mouse and Phoenix, but the Python will always bother me. So I ended up hiring Varya Kolesnikova again for the actual cover of the book. She is the artist who did my Python 201 cover art. You can view more of her art on Behance or Instagram. Here is her original sketch of my new concept, which was to have the mouse riding the Phoenix and carrying the Python: Actual cover concept art sketch I liked her approach much better, although her idea of a Phoenix was very different than my original vision for it. Here is a color version of the concept art: Color concept art sketch I liked Varya’s approach to the art and she ended up finishing the artwork as you know today: Final cover art I am hard at work wrapping up the last few chapters of the book. If you are interested in getting early access to the book, you can pre-order it now on Leanpub. The final version of the book will be released in May 2019.

PyDev of the Week: Kyle Stratis

This week we welcome Kyle Stratis (@KyleStratis) as our PyDev of the Week! He is an active contributor at Real Python but also maintains his own website. You can catch up with his projects on Github as well. Let’s take a few moments to get to know Kyle! Can you tell us a little about yourself (hobbies, education, etc): I’m a self-taught developer, I actually studied neuroscience up through graduate school, with a focus on mechanisms of attention in the auditory system. The coding I had to do at every step of the experimental process rekindled my early love of the craft, and a good friend stepped in as a mentor – so I taught myself and got my first job while I was writing my master’s thesis. While I do a lot of programming on the side, I also enjoy weightlifting (my father was a bodybuilder and gym-owner, with 4x Mr. Olympia Jay Cutler starting at his gym, so maybe it’s genetic), skateboarding, and surfing, which I do noticeably less of now that I live in Boston. I’m also a bit of a metalhead, so on any given weekend you’ll be likely to find me at a dingy club with a battlevest on and cheap beer in hand. I’d be remiss to not mention spending time with my wife, which usually is spent reading, hiking, and playing with our 2 cats. Continue reading PyDev of the Week: Kyle Stratis →