Monday, December 31, 2018

Tryton News: Newsletter January 2019

@ced wrote:

The last month saw a lot of improvements for the developers. Those improvements follow the same trend of consolidating and unifying the Tryton design.

Contents:

Changes For The User

Since the addition of phone number validation, it requires to put the international prefix. But it is usual that users forget it. So now we try to validate the number using the prefix of the address country of the party or the companies party. Then the first valid prefix is stored with the number.

We have removed country code from all default languages. This eases to reuse them as base language for country specific, thanks to the translation cascading mechanism of Tryton.
– Remember, you can help :heart: translate Tryton on https://pootle.tryton.org/

Changes For The Developer

As search and sort on ModelView-only is not supported, the methods are automatically deactivated to avoid the client to emit calls that would fail and raise an error message to the user.

In account module the tax update from template was improved. When updating the chart from template on replacing taxes, former taxes are now de-activated instead of decoupled from the template.

The shipment reports (e.g. delivery note) now uses the correct moves for shipments.
When the inventory moves are empty, – which happen when the shipment locations are the same, – the other moves field will be used.
When a transit location is used for the internal shipment, the used moves field depends on the state. If it is already shipped, then the incoming moves are used to know where to store products. If it is not yet shipped, then the outgoing moves are used to pick the products.

Normally a party should have only one SEPA identifier but in order to ease extension we removed the unique constraint.

Until now the ModelStorage.read-API allows to read the field of the model but also the fields of Many2One and Reference targets. The API has been extended to read related xxx2Many fields. Reading a xxx2Many field results in a list of dictionaries with the requested values and always the id. The name of the key is suffixed by a dot, to avoid name space collisions. :warning: The former API for Many2One has been changed to stay consistent.

We always try to reduce the gap between web and desktop client. So we have implemented the widget attributes: expand, height and width into Sao.

By convention negative ids are reserved for non stored records. The client uses this convention when calling methods on unsaved records. We have decided to enforce this convention with a SQL constraint on every table which checks that the ID column contains a positive integer.

We changed the fallback unit of measure when calling get_sale_price. Before the default unit of the product was used but now it is the sale unit. This is performance improvement because we can now make a single call and retrieve the prices in the right unit for all the products. Before it would require to make a call per unit of measure. This new behavior is not adapted to the purchase module, because when purchasing it is the supplier which defines the unit of measure and not the buyer.

We finally solved a long standing issue with the error messages. The error messages on Model are replaced by records of the new model ir.message. A message can be retrieved translated and formatted by calling gettext method with the XML-ID.
User errors and warnings are now just exceptions raised with messages as arguments. This allows to create custom exceptions by inheriting the base ones for better control and testing.

We implemented the filtering of available models for the model selection of the Reference field, to fix a bug in domain inversion, when the client validates and forces a value depending on the domain.

Posts: 1

Participants: 1

Read full topic



from Planet Python
via read more

Graham Dumpleton: Administration features of JupyterHub

You have seen now in the last post how you can use JupyterHub to deploy a multi user workshop environment where each user is given access to their own interactive shell environment in their web browser. This is by having JupyterHub spawn a terminal application instead of the usual Jupyter notebooks it would be used for.The aim in being able to provide this out of the box experience, is that it

from Planet Python
via read more

Python URL Shortener

Python URL Shortener

happy new year 2019

It was late evening on new years eve – or Old Years Night as they call it in the West country – and to pass some time I was rummaging through Python articles on the Internet at random, looking for ideas for a new project.

I didn’t get inspired much, but I thought for a moment that a Bitly URL shortener with  GUI might make a neat little app.

Ass Pain Instansiator

There are Python modules that use Bitly’s API, but when you go to get an API key it says, API keys are deprecated, use OAuth.

python bitly-oauth api deprecated

Somehow they have contrived to try and make it complicated for my pea-sized brain, cobblers to it, I’ll Pyautogui it instead of learning what OAuth is (great attitude Steve, you knob jockey!).

No API And No Sign Up

Here is the quick bit of code that I knocked up that sends a user selected URL to Bitly, and then returns the result of a shortened URL.  No API, and no sign up nonsense required.

By the way, Bitly accepts Mailinator email addresses, so you could use my Dismal app to sign up anonymously in 4 clicks and 4 seconds (steady on there Steve), if you do feel the need to sign up to Bitly.

Say what you want about my crap coding, but I do use my own programs ha-ha.

Double click inside code box to select all.

import webbrowser
import pyautogui
import time
import pyperclip
from tkinter import Tk, simpledialog

ROOT = Tk()
# Stop naff GUI window from showing, for now.
ROOT.withdraw()

bitly_url = "https://bitly.com/"

# Ask user for the URL to shorten via GUI input.
users_url = simpledialog.askstring(title='Bitly', prompt='Enter URL:')

#copy users URL to the system clipboard
pyperclip.copy(users_url)

#open bitly.com in default web browser
webbrowser.open(bitly_url)
time.sleep(2)

#paste users url into bitly
pyautogui.hotkey('ctrl', 'v')  # ctrl-v to paste
time.sleep(2)

# copy bitlys response to clipboard
pyautogui.hotkey('ctrl', 'c')  # ctrl-c to copy

#get the newshortned url from clipboard
short_url = pyperclip.paste()

print (users_url)
print (short_url)

It works well enough, though you may need to adjust the pauses if you have a slow connection or your browser loads slower than mine.

I haven’t added the GUI yet, the above code was to see if it works, it does, but now I am having second thoughts on weather it is actually worth pursuing this project.

It’s All Pretty Pointless Really

I mean, it’s almost just as easy to got to bitly.com yourself and type or paste the URL in there, at the moment this code is pretty pointless and I have learnt nothing I didn’t already know writing it.

Having said all that, I have an idea of  a GUI with a listbox displaying all your URLs with their shortened version so that you can copy them at will to the clipboard for pasting to wherever.

I’m still not convinced it is worth my time or effort to write something I have not much interest in, or will ever be likely to use myself.  I don’t think anyone else will want the GUI either, so there it is, I’ve decided not to continue this project as its worthless and I will not learn anything new from it.

Well, that’s left this article a bit flat then hasn’t it!  I had hoped to do a special long post for the first day of 2019, but it has turned out to be bit of a damp squib.

One last thing, I did find a nice little snippet of code on my travels:

import os
newlist = [f for f in os.listdir('.') if f.endswith('.txt')]
print (newlist)

The above code will search the current directory for any .txt files and print the files names.

Pretty neat code I thought, I have never come across .endswith before, it would definitely of been of use in some of my previous projects.

Of course you can change the directory and the file type to search for easy enough to make this a useful snippet.

This Article .endswith

I started this blog during August 2018.  I deleted it in November, and was going to give up programming for good, as I know I’ll never be good enough to write something worthwhile.  But after a week’s rest I came back and asked WordPress to undelete it, and here we are.

Sometimes I push myself too hard, and that is the result.  I blow up like a drama queen and give up, and then come back stronger for it, yes I know, what a weirdo.

Blog Report Update

On January the 1st 2019 I have 30 subscribers. It is not many, but nearly all of those people are Python people, so look genuine subs.

I am at last starting to get a few hits from Google search here and there, so I’m hoping this will bring in new readers this coming year.

I decided from the start not to worry too much about SEO, apart from the standard post layout, do a few external and internal links, add an image or two and not to worry about keywords and such.

I used to do all that stuff on my old blogs over the years and it made no difference, all it did was cause a lot of extra work and leave me less time to write articles.

It would be nice to have lots of readers to chip in with comments and ideas but I am willing to wait, after all, this blog was originally me just writing notes to myself about my Python learning journey.

Have a great 2019 y’all.

Using Python V3.6.5(32 bit) on Windows 7, (64 bit).

Previous post:  Project Py-Meme

Advertisements


from Python Coder
via read more

Brett Cannon: An update on Python's governance

This post is meant to act as a summary of the current state of Python's governance as of the end of 2018. If you want to see an alternative take on what I present here, LWN has an article.

What did Guido provide us?

When discussing how the Python project used to run, you need to understand what services our BDFL, Guido van Rossum, provided us on the core team.

Design guidance

From the language perspective of the project, Guido ultimately dictated the "feel" of Python, typically through the PEP process. Sometimes Guido would delegate decision powers on a PEP to what is known as a "BDFL delegate" (and what has slowly been renamed a "PEP delegate"). But other times Guido himself would take on the role of whether a PEP would be accepted or not. But regardless of whether Guido or someone else was making the final decision, Guido would often provide feedback on a PEP which provided guidance to the rest of us on what he was thinking about a topic.

Guido would also espouse his opinion on occasion, implicitly communicating how he felt the language should feel. This could be anything from shutting down conversations on python-ideas which he felt were dead-ends to simply commenting on something. Either way, Guido communicated in various ways about what should be considered Pythonic as his brain has the closest definition of what that truly entails.

Project lead

Guido also provided a backstop position for all decisions regarding the project. If there was ever a disagreement, Guido could step in and make it be known what the resolution would be and that was that. Granted that didn't happen very often (day-to-day running of the project hasn't needed Guido for quite a long time), but it did provide some form of stability to know that there was a higher power to appeal to in order to reach a final decision when it came to the project itself.

On July 12, 2018 ...

Up until 2018-07-12 the role Guido played was what was discussed above. But then we got a fateful email one morning from Guido where he announced that he was taking an indefinite vacation from being the BDFL (although in my opinion I view the "FL" part of "BDFL" as true and still consider Python to be Guido's language, he's just letting others run things even more now on his behalf). When Guido announced his retirement he also said that he was not going to make any final decision about how we as a group were going to govern ourselves moving forward, and so we had to figure that part out on our own.

How we dealt with the problem

We quickly decided as a group that we would solicit PEPs that proposed how to govern ourselves and that we would vote on which one to accept. We accepted PEPs up until November 01 (although that was not the initial date as things slipped), and then voted December 01 - 16 (once again, later than planned due to things slipping).

In the end we ended up with 7 governance proposals. They varied from an elected dictator structure to anarchy. Since we know the result of the vote I'm not going to go into each of them (I'll discuss the results later).

As for voting, we came up with PEP 8001. We ended up using a ranked ballot and the Condorect method to determine the winner (there's a couple ways to calculate the winner using the Condorcet method, but the winner won regardless of method details so specifics don't really matter here). Voting was open to all core developers as we couldn't come up with a reasonable criteria that we all agreed to as to what defined an "active" core dev and we kept it to core devs since they would be the most impacted by the results of the vote.

And the winner is ...

In the end PEP 8016, the steering council proposal, won. The details of the vote are available, but the key thing is that the PEP clearly won no matter what way you calculated the winner and it was a decisive win against second place. Out of 96 eligible voters we had 62 votes cast, and so I feel there's no real questioning of the legitimacy of the outcome of the vote (which we worried about since we didn't want to give people a reason to complain about the outcome's legitimacy).

So what does PEP 8016 give us? The PEP is heavily modeled on the Django project's organization (to the point that the PEP had stuff copy-and-pasted from the original Django governance proposal). What it establishes is a steering council of five people who are to determine how to run the Python project. Short of not being able to influence how the council itself is elected (which includes how the electorate is selected), the council has absolute power. But the PEP does say the expectation is that the council will work to minimize having to do anything, essentially devolving power as much as possible when reasonable.

But it's the council's mandate which really defines what they are supposed to do. Remember earlier where we said that Guido acted as a project lead and language designer? Based on what PEP 8016 says, the council directly provides us the former, but not the latter. That means the result of the vote prevents us from ever having the Python project be leaderless again, it doesn't directly solve how to guide the language's design.

My guess is the vote turned out this way because PEP 8016 was most people's second or third choice. So when people split between PEP 8011 and PEP 8012, most people seemed to agree on PEP 8016 as their alternative. And I think people did that as a way to potentially still get the approach they prefer.

What's next?

The next step is we elect the council. It's looking like nominations will be from Monday, January 07 to Sunday, January 20 and voting from Monday, January 21 to Sunday, February 03.

After the election the council will start figuring out how the Python project is going to function. Implicitly that also includes figuring out how the design of the language will be handled. That already doesn't seem to please some people who have PEPs they want to be pronounced on as that whole process will have to be chosen before any pronouncement can occur.

But a key point I hope people understand is that while we solved the issue of project management that stemmed from Guido's retirement, the council will need to be given some time to solve the other issue of how to manage the design of Python itself.



from Planet Python
via read more

tryexceptpass: Integrating Pytest Results with GitHub

When joining a new engineering team, one of the first things I do is familiarize myself with the dev and test processes. Especially the tools used to enforce them. In the past 5 years or so, I’ve noticed that a lot of organizations still use older tools that haven’t yet evolved to support modern practices. Even teams that purely develop software can find themselves working around cumbersome systems that hinder instead of enable.

What do I mean by that? Very few of these tools include useful interfaces to leverage integrations with other systems (like REST APIs). Most have no concept of modern dev practices like continuous integration or containerization. Almost all of them want to record pass / fail at a step by step basis as if you’re executing manually. The vast majority are built around a separation between test and dev (some even emphasize it). And a lot of them require the organization to hire “specialists” for the purpose of “customizing” the tool to the team. In my opinion, these types of systems coerce the organization to emphasize blame over quality and team boundaries over productivity.

I’ve been very successful at building long-lived alternatives to these systems in several organizations. I’ve done it enough to know which features are worth including, and which to leave to the test / dev engineers, especially after the advent of continuous integration and delivery.



from Planet Python
via read more

Mike Driscoll: The Packt Python Humble Bundle 2019

Packt Publishing is partnering with Humble Bundle for a Python bundle for 2019.

You can check out the full list of titles here: https://www.humblebundle.com/books/python-packt-2019-books

One of the books is my very own Python Interviews book

Python Interviews book cover

There are quite a few other books in this bundle that look interesting. I know the books by Steven Lott and Dusty Philips are most likely good.

The other nice thing about the bundle is that you can support the Python Software Foundation by getting a bunch of fun Python books!



from Planet Python
via read more

Vinta Software: Happython 2019!

Happy PyHolidays and Happy New Year! We are approaching the end of the year 2018! And as it turns out this was an incredible year for Python! Even though Guido stepped out of his role as BDFL (this alone is worth a couple of blogposts so this one will not extend the discussion), there are a lot of happy recollections from this year. In 2017 StackO

from Planet Python
via read more

Talk Python to Me: #193 Data Science Year in Review 2018 Edition

This year, 2018, is the year that the number of data scientists doing Python equals the number of web developers doing Python. That's why I've invited Jonathon Morgan to join me to count down the top 10 stories in the data science space.

from Planet Python
via read more

Stack Abuse: Course Review: Hands On Computer Vision with OpenCV & Python

Introduction

Course Review: Hands On Computer Vision with OpenCV & Python

In this article I will be providing a review of the Udemy course Hands On Computer Vision with OpenCV & Python by Shrobon Biswas featured on the Udemy online learning site. At the time of this writing I would say that the course is moderately successful with a total of 146 ratings averaging to 4.1/5 stars along with a total enrollment of 851 students.

According to the description, this course is introductory in nature and geared towards novice to intermediate programmers with a basic understanding of the Python programming language. At the time I began this course I had very little background knowledge of image processing or computer vision and no experience with OpenCV making me the ideal target audience for this course.

In the following sections I will be reviewing and discussing the various content areas providing my opinion of the material.

Review of Course Section

Introduction & Installation

This section has the typical introductory content that most courses of this nature cover, like a basic explanation of the course and outline was covered. Installation was presented in the form of a simple writeup of how to install the Anaconda environment along with OpenCV. In my opinion it would have been good to give a video demonstration of installing the required software rather than the instructions writeup provided.

Image Basics

In this section the author of the course describes the basics of reading and writing images to and from disk along with how to grab an image from a web resource over HTTP.

n addition to basic file IO, he nicely explains the concept of image channels for Red, Green, and Blue color images. In addition to his explanation of image channels there are a few good examples of using the Python programming language and the OpenCV library to select and manipulate channels individually as well as convert back and forth between color and grayscale images. Lastly, there is coverage of how to display images using both the OpenCV library as well as the matplotlib visualization library.

Overall my opinion of this section is quite positive. I feel that there was an adequate balance of explanation and coding examples to sufficiently describe how to read in as well as persist image data using disk.

In addition, I think the inclusion of how to read in an image over HTTP was a great practical decision, but the author did not make it clear here that the library being used was not OpenCV, but instead a submodule of the Scikit-Learn library installed along with the Anaconda installation package. The discussion of the notion of image channels was well thought out and demonstrated with a simple yet elegant example.

Histograms

Here the author discusses the use of histograms to represent the distribution of intensities along single channels of a color image, as well as for a grayscale image. There are examples that show how to use the OpenCV library to manipulate the pixel data contained in a digital image into data structures appropriate for displaying as a histogram using the matplotplib library.

Although the coverage in this section is short, it is to the point and lays the foundation for later topics in the course.

Pixel Manipulation and Geometry

In this section the author starts off by demonstrating that the digital image data that OpenCV presents to the user is nothing more than a multi-dimensional numpy array of integers. This is then further elaborated via examples of manipulating individual pixel values using the familiar numpy indexing. Then the author segues into how to use the OpenCV library to draw simple lines and other geometric shapes.

After demonstrating how to draw basic geometrics shapes the author goes further into image manipulation. The topics of flipping, scaling, and rotating are covered using more coding examples.

It was during this section I noticed that I did start to get a little frustrated. There were moments when the author seemed a bit rushed and moved briskly over the specifics of various library method parameters. There also was a break in consistency in this section. For example, in the sections leading up to this one all images and scripts used in the examples were provided as downloadable resources. However, in this section a couple images were left out of the available resource and several of the example scripts were not provided, making it more difficult to follow along, but not impossible. I should note that when I did follow along coding up the examples and they did work perfectly fine using an alternate image.

Project - Snipping Utility

This section is a demonstration of to use the OpenCV library to capture mouse events on a displayed image to select and generate a cropped image of the original.

I was quite happy to see this section in the course. I personally like it when a course takes the time to demonstrate the utilities of a technology to produce something that demonstrates functionality as in the case of a primitive snipping tool in this section.

Filtering, Blurring and, Noise Removal

I found this section to be quite fascinating. Perhaps this is because the concept of applying filtering techniques to enhance digital images is one that I find remarkable. However, I do feel the instructor does a sufficiently sound job of explaining why it is useful and demonstrates how to accomplish it. Unfortunately, there is again a break in consistency in that the author does not provide the image or the example script used.

All About Thresholding

This section starts off with a simple explanation of what thresholding is. After that the instructor challenges the student with a coding exercise to create a thresholded image manually without the aid of the OpenCV library. Of course, the instructor provides a solution, but I always like it when these types of challenges are made in courses. Not only does it reinforce the "how to" part of a concept, but it also demonstrates "why" a library like OpenCV is so valuable.

Project - Making a Custom Glitter Filter

In this section the instructor demonstrates how to create a filter of an image using adaptive filtering techniques. In addition to filtering he demonstrates how to modify an image by changing individual pixel color values, again driving home the three dimensional data structure of digital images and the fact they they are simply a multi-dimensional arrays of numbers.

This section felt a bit rushed but, the content was presented with a solid example and both the code and the images being manipulated were provided so the student has the ability to further explore the topic.

Superimposing Images

Again, this section was a little rushed and I would have liked to have better explanations of what parameters were being tweaked as well as their impact on the layering of images. There was again a break in consistency whereby the example code and images were not provided which leaves the student a little out of the loop in their ability to follow along.

Working With Videos

In this section the instructor demonstrates how to use the OpenCV library to interact with a webcam. First off he shows how to capture frames and display them in a window. Then he goes on to show how to manipulate the color representation of the video feed based off of keyboard inputs.

Once again, the coding examples are not provided for this section.

Mastering Contours

As the title suggests, this section covers the notion of contours bounding objects in an image. Here the instructor does a rather good job of using some fairly simple home-made images of plain mono-chromatic shapes to simplify the concepts.

However, similar to some of other sections of this course, I feel that a significant amount of detail was glossed over in the explanation of the various parameters being used to tune the results of OpenCV methods. I find this a bit frustrating and feel that simply stating that a topic "is complicated and you should play around with values until you get a desired result" is not a sufficient explanation.

Project - Vehicle Detection

The final section of this course demonstrates how to build an application that detects vehicles from traffic image data. As I alluded to earlier, I really appreciate it when courses build a functional application that demonstrates real world value of the technology being taught. I commend the author for including this section even though it was a bit complex and difficult to comprehend but, I definitely got value out of it.

Conclusion

In this article I have striven to give a fair and balanced overview of the course Hands On Computer Vision with OpenCV & Python by Shrobon Biswas on Udemy. In doing so, my goal has been to describe the content covered while being careful not to divulge the specifics of the actual content, as I feel the instructor has provided value to the online learning community.

As stated in the beginning, I came into this course with very little understanding of Computer Vision concepts, armed only with a reasonable understanding of the Python programming language. That being said, I feel that I was able to learn a commendable amount about how to use the OpenCV library to interact with and manipulate both image and video content. In my opinion, I think that there could have been better coverage of the specifics of some of the library's functionality and the underlying theory, but I am not sure that was the main goal of this course.

I do have some complaints about the organizational aspect of the course structure and content as it seemed a bit thrown together in certain parts. For example, there were more than a few instances where example images and scripts were not provided and the author mentions coming back to cover different topics, later which never occur.

Overall, I would say this course is a good buy if you can catch it on sale but, the base price of $199 is probably too high for the value provided.

As always, thanks for reading and don't be shy about commenting or critiquing below.



from Planet Python
via read more

Real Python: Python Community Interview With Corey Schafer

For this week’s community interview, I am joined by Corey Schafer, of YouTube fame.

Corey is a full-time content creator publishing regular Python tutorials on YouTube. In this interview, we talk to Corey about his YouTube channel and his advice for budding YouTubers and content creators, getting his first developer job, and his passion for woodworking.

Ricky: Welcome to Real Python! We might as well start at the beginning. How’d you get into programming, and when did you start using Python?

Corey Schafer

Corey: Thanks for having me. I actually got started programming a little later in life than most people you’ve probably interviewed. I used to be a little self-conscious about getting started later, but now I try to be upfront about it so that others aren’t as intimidated if they are just getting started at an “older” age.

I suppose I technically got started in college when I began my degree in Computer Science, but even at that time, I wasn’t taking it very seriously. I would do enough to pass tests, but I wasn’t absorbing any of the information. I definitely wasn’t doing any side projects or using coding in any real-world applications.

It wasn’t until my mid-20s that I randomly applied to an internship for NASA at Kennedy Space Center and started to take programming seriously. To my surprise, I was chosen for the internship. Imposter syndrome set in full-force on day 1. I was definitely out of my league.

But the longer I worked there, the more I realized that these people weren’t superhuman. These were people just like me, with the exception that they’ve spent much more time putting in the work to master their skill.

I thought to myself, “If they can do it, there’s no reason I can’t.” So I left Cape Canaveral with a newfound motivation to really dive into programming and learn as much as I could. I really didn’t feel like I could call myself an actual programmer until my late 20s. I am in my early 30s now, so I feel like I haven’t even scratched the surface in terms of the skills I would like the master.

As far as learning Python, I didn’t start using it until about 4 years ago. I was a full-time front-end JavaScript developer at the West Virginia University GIS Technical Center doing some mapping work. We were using Python for some of the backend scripts, and I was assigned to maintain/update some of those. I found that I enjoyed that much more than the front-end JavaScript work and began using Python on a daily basis.

Ricky: You mentioned that you came to programming a little later in life (though still young). With that context in mind, what was your experience getting your first junior developer job, and do you have any advice for anyone looking for their first developer job later in life?

Corey: I got my first development job in my mid-20s, after my internship in Cape Canaveral. That job was at a small research company in West Virginia (WV). The competition isn’t as fierce in WV as it is in places like San Francisco or Silicon Valley, so I was able to land a position without much prior experience.

I was extremely intimidated when I first started there. I never wanted anyone to see any code that I had written out of fear that it would expose me as not knowing nearly as much as anyone else. I later came to find out that this is a common fear within the community.

Actually working as a developer full-time taught me much more than anything I had learned in school or self-study. Knowing the fundamentals is definitely helpful, but there’s no replacement for actually writing real-world applications and having your code critiqued by people who have been doing this for years.

It’s definitely uncomfortable for your mistakes to be on display for your coworkers to see, but once you get over that discomfort, you come out on the other side less likely to make the same mistakes in the future. Many of my viewers ask me, “How do you just know how to solve these problems?” Well, the truth is, many problems in programming are very similar.

Once you solve problems incorrectly over the years and are shown better and better ways, you eventually learn to recognize certain patterns and use the most efficient methods from the start. This isn’t a skill that most people have naturally. It is developed over years of trial and error.

Ricky: Most of our readers might recognize you from your very popular YouTube channel. I certainly heard of you through it. Not only is it on our Ultimate List of Python YouTube Channels, but I regularly watch your videos and even built one of my most recent Flask apps as a direct result of your Flask course. How have you found YouTube as a platform from a teaching point of view? Any surprising lessons learned?

Corey: Thanks. I was honored to have my channel featured in your article. YouTube is a terrific platform for learning, and I’m excited to see where online learning evolves in the future. Websites like YouTube have definitely lowered the barrier-to-entry for anyone who wants to create content.

Many people think you need a nice recording studio or some financial backing before you get started, but that is no longer the case. As long as you have a computer and a cell phone then you basically have all of the tools you need to get started. I have upgraded my equipment over time, but I first started on YouTube by doing screen recordings on a cheap laptop using the built-in laptop microphone.

For anyone who is thinking about starting a YouTube channel or creating content in general, I do have some lessons I’ve learned over time. I believe the most important lesson I’ve learned is that you should make content for yourself. I try not to create tutorials for topics for the sole purpose of them being popular or what will get the most views… I instead try to create the lessons that I wish I had when learning that topic.

Take notes while you learn certain subjects and keep track of what you found difficult to digest and why. If you get stuck on something, then most likely others are getting stuck on it as well. And once you find solutions to these problems, then you can look back and see if there is a way anyone could have explained it to you that would have helped you understand more easily. If there is, then be sure to pass that on to others.

I really believe that advice carries over into other fields. If you’re an educator, then make content that you personally would have found helpful. If you are a musician, then make music that you personally enjoy. If you’re a comedian, then tell jokes that you think are funny. If you do that, then most likely there are many people out there like yourself who will share your same mindset and love your content.

Ricky: What’s next for the YouTube channel going forward? Any plans to branch out into paid courses or other forms of teaching?

Corey: At the moment, I am sticking to YouTube courses. I feel very fortunate to have a platform that allows me to put my content out there for free and be funded by ad revenue. This allows people who can’t afford courses or who can’t pay for content at the moment to get access to all of my content.

Ideally, my content will always remain free as long as I have enough coming in to live on. It also wouldn’t be possible without generous supporters contributing through sites like Patreon and YouTube Channel Memberships. They support me financially on a monthly basis so that the content can remain free for those who can’t afford it. I would love to continue with this model into the future for as long as I can.

As far as branching out into other forms of teaching, I have thought about creating an online learning platform of some kind. I have used a lot of tools in my personal life that have helped me learn topics quickly. Tools such as spaced-repetition-learning applications and daily coding challenges.

I would love to tackle a project that brought these concepts to a learning platform in a way that would help students absorb material more quickly and fully. Any type of project like that will be something I wouldn’t work on for some time though. For now, I am focused on creating video content.

Ricky: You, sir, are a talented woodworker! Your stuff looks impressive. Is this a new hobby or a long-time passion of yours? How did you get started?

Corey: Oh, thank you for saying that. It is a hobby that I wish I had more time to explore. It is something I have been toying with for many years now. Personally, it is a fantastic way to clear my mind and drain any stress that’s built up.

Woodworking and programming can be similar in many ways. Sometimes I will start a woodworking project and have an idea of what I want the finished product to look like, but not a detailed understanding of where to begin. So you start by jotting down some outlines, then knock out the smaller components, and then after many hours of work you can combine all of that together into the result you were hoping for. There’s a lot of pride that comes with finishing those types of projects.

Ricky: Now for my last question. What else do you get up to in your spare time? What other hobbies and interests do you have, aside from Python? Any you’d like to share and/or plug?

Corey: Since I spend my professional career at a computer, I like to spend my spare time outside as much as possible. This includes hiking, kayaking, camping, swimming, and trips to the dog park. Now that I am working from home and have a more flexible schedule, my girlfriend and I would love to start traveling more. I believe I might mark some international PyCons on my calendar and use those as an excuse to visit some places we have wanted to see for a very long time, with the added bonus of meeting more folks from the Python community.


Thank you, Corey, for joining me this week. You can find Corey’s YouTube channel here. You can get in touch with him via Twitter or his website. And if you’ve benefited from Corey’s videos, consider supporting his efforts with via Patreon.

If there’s someone you’d like me to interview from the Python community, then reach out to me in the comments below, or send me a message on Twitter.


[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]



from Planet Python
via read more

Python Community Interview With Corey Schafer

For this week’s community interview, I am joined by Corey Schafer, of YouTube fame. Corey is a full-time content creator publishing regular Python tutorials on YouTube. In this interview, we talk to Corey about his YouTube channel and his advice for budding YouTubers and content creators, getting his first developer job, and his passion for […]

The post Python Community Interview With Corey Schafer appeared first on PyBloggers.



from PyBloggers
read more

Python Community Interview With Corey Schafer

For this week’s community interview, I am joined by Corey Schafer, of YouTube fame.

Corey is a full-time content creator publishing regular Python tutorials on YouTube. In this interview, we talk to Corey about his YouTube channel and his advice for budding YouTubers and content creators, getting his first developer job, and his passion for woodworking.

Ricky: Welcome to Real Python! We might as well start at the beginning. How’d you get into programming, and when did you start using Python?

Corey Schafer

Corey: Thanks for having me. I actually got started programming a little later in life than most people you’ve probably interviewed. I used to be a little self-conscious about getting started later, but now I try to be upfront about it so that others aren’t as intimidated if they are just getting started at an “older” age.

I suppose I technically got started in college when I began my degree in Computer Science, but even at that time, I wasn’t taking it very seriously. I would do enough to pass tests, but I wasn’t absorbing any of the information. I definitely wasn’t doing any side projects or using coding in any real-world applications.

It wasn’t until my mid-20s that I randomly applied to an internship for NASA at Kennedy Space Center and started to take programming seriously. To my surprise, I was chosen for the internship. Imposter syndrome set in full-force on day 1. I was definitely out of my league.

But the longer I worked there, the more I realized that these people weren’t superhuman. These were people just like me, with the exception that they’ve spent much more time putting in the work to master their skill.

I thought to myself, “If they can do it, there’s no reason I can’t.” So I left Cape Canaveral with a newfound motivation to really dive into programming and learn as much as I could. I really didn’t feel like I could call myself an actual programmer until my late 20s. I am in my early 30s now, so I feel like I haven’t even scratched the surface in terms of the skills I would like the master.

As far as learning Python, I didn’t start using it until about 4 years ago. I was a full-time front-end JavaScript developer at the West Virginia University GIS Technical Center doing some mapping work. We were using Python for some of the backend scripts, and I was assigned to maintain/update some of those. I found that I enjoyed that much more than the front-end JavaScript work and began using Python on a daily basis.

Ricky: You mentioned that you came to programming a little later in life (though still young). With that context in mind, what was your experience getting your first junior developer job, and do you have any advice for anyone looking for their first developer job later in life?

Corey: I got my first development job in my mid-20s, after my internship in Cape Canaveral. That job was at a small research company in West Virginia (WV). The competition isn’t as fierce in WV as it is in places like San Francisco or Silicon Valley, so I was able to land a position without much prior experience.

I was extremely intimidated when I first started there. I never wanted anyone to see any code that I had written out of fear that it would expose me as not knowing nearly as much as anyone else. I later came to find out that this is a common fear within the community.

Actually working as a developer full-time taught me much more than anything I had learned in school or self-study. Knowing the fundamentals is definitely helpful, but there’s no replacement for actually writing real-world applications and having your code critiqued by people who have been doing this for years.

It’s definitely uncomfortable for your mistakes to be on display for your coworkers to see, but once you get over that discomfort, you come out on the other side less likely to make the same mistakes in the future. Many of my viewers ask me, “How do you just know how to solve these problems?” Well, the truth is, many problems in programming are very similar.

Once you solve problems incorrectly over the years and are shown better and better ways, you eventually learn to recognize certain patterns and use the most efficient methods from the start. This isn’t a skill that most people have naturally. It is developed over years of trial and error.

Ricky: Most of our readers might recognize you from your very popular YouTube channel. I certainly heard of you through it. Not only is it on our Ultimate List of Python YouTube Channels, but I regularly watch your videos and even built one of my most recent Flask apps as a direct result of your Flask course. How have you found YouTube as a platform from a teaching point of view? Any surprising lessons learned?

Corey: Thanks. I was honored to have my channel featured in your article. YouTube is a terrific platform for learning, and I’m excited to see where online learning evolves in the future. Websites like YouTube have definitely lowered the barrier-to-entry for anyone who wants to create content.

Many people think you need a nice recording studio or some financial backing before you get started, but that is no longer the case. As long as you have a computer and a cell phone then you basically have all of the tools you need to get started. I have upgraded my equipment over time, but I first started on YouTube by doing screen recordings on a cheap laptop using the built-in laptop microphone.

For anyone who is thinking about starting a YouTube channel or creating content in general, I do have some lessons I’ve learned over time. I believe the most important lesson I’ve learned is that you should make content for yourself. I try not to create tutorials for topics for the sole purpose of them being popular or what will get the most views… I instead try to create the lessons that I wish I had when learning that topic.

Take notes while you learn certain subjects and keep track of what you found difficult to digest and why. If you get stuck on something, then most likely others are getting stuck on it as well. And once you find solutions to these problems, then you can look back and see if there is a way anyone could have explained it to you that would have helped you understand more easily. If there is, then be sure to pass that on to others.

I really believe that advice carries over into other fields. If you’re an educator, then make content that you personally would have found helpful. If you are a musician, then make music that you personally enjoy. If you’re a comedian, then tell jokes that you think are funny. If you do that, then most likely there are many people out there like yourself who will share your same mindset and love your content.

Ricky: What’s next for the YouTube channel going forward? Any plans to branch out into paid courses or other forms of teaching?

Corey: At the moment, I am sticking to YouTube courses. I feel very fortunate to have a platform that allows me to put my content out there for free and be funded by ad revenue. This allows people who can’t afford courses or who can’t pay for content at the moment to get access to all of my content.

Ideally, my content will always remain free as long as I have enough coming in to live on. It also wouldn’t be possible without generous supporters contributing through sites like Patreon and YouTube Channel Memberships. They support me financially on a monthly basis so that the content can remain free for those who can’t afford it. I would love to continue with this model into the future for as long as I can.

As far as branching out into other forms of teaching, I have thought about creating an online learning platform of some kind. I have used a lot of tools in my personal life that have helped me learn topics quickly. Tools such as spaced-repetition-learning applications and daily coding challenges.

I would love to tackle a project that brought these concepts to a learning platform in a way that would help students absorb material more quickly and fully. Any type of project like that will be something I wouldn’t work on for some time though. For now, I am focused on creating video content.

Ricky: You, sir, are a talented woodworker! Your stuff looks impressive. Is this a new hobby or a long-time passion of yours? How did you get started?

Corey: Oh, thank you for saying that. It is a hobby that I wish I had more time to explore. It is something I have been toying with for many years now. Personally, it is a fantastic way to clear my mind and drain any stress that’s built up.

Woodworking and programming can be similar in many ways. Sometimes I will start a woodworking project and have an idea of what I want the finished product to look like, but not a detailed understanding of where to begin. So you start by jotting down some outlines, then knock out the smaller components, and then after many hours of work you can combine all of that together into the result you were hoping for. There’s a lot of pride that comes with finishing those types of projects.

Ricky: Now for my last question. What else do you get up to in your spare time? What other hobbies and interests do you have, aside from Python? Any you’d like to share and/or plug?

Corey: Since I spend my professional career at a computer, I like to spend my spare time outside as much as possible. This includes hiking, kayaking, camping, swimming, and trips to the dog park. Now that I am working from home and have a more flexible schedule, my girlfriend and I would love to start traveling more. I believe I might mark some international PyCons on my calendar and use those as an excuse to visit some places we have wanted to see for a very long time, with the added bonus of meeting more folks from the Python community.


Thank you, Corey, for joining me this week. You can find Corey’s YouTube channel here. You can get in touch with him via Twitter or his website. And if you’ve benefited from Corey’s videos, consider supporting his efforts with via Patreon.

If there’s someone you’d like me to interview from the Python community, then reach out to me in the comments below, or send me a message on Twitter.


[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]



from Real Python
read more

Podcast.__init__: Building GraphQL APIs in Python Using Graphene with Syrus Akbary

The web has spawned numerous methods for communicating between applications, including protocols such as SOAP, XML-RPC, and REST. One of the newest entrants is GraphQL which promises a simplified approach to client development and reduced network requests. To make implementing these APIs in Python easier, Syrus Akbary created the Graphene project. In this episode he explains the origin story of Graphene, how GraphQL compares to REST, how you can start using it in your applications, and how he is working to make his efforts sustainable.

Summary

The web has spawned numerous methods for communicating between applications, including protocols such as SOAP, XML-RPC, and REST. One of the newest entrants is GraphQL which promises a simplified approach to client development and reduced network requests. To make implementing these APIs in Python easier, Syrus Akbary created the Graphene project. In this episode he explains the origin story of Graphene, how GraphQL compares to REST, how you can start using it in your applications, and how he is working to make his efforts sustainable.

Preface

  • Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.
  • When you’re ready to launch your next app or want to try a project you hear about on the show, you’ll need somewhere to deploy it, so check out Linode. With 200 Gbit/s private networking, scalable shared block storage, node balancers, and a 40 Gbit/s public network, all controlled by a brand new API you’ve got everything you need to scale up. Go to pythonpodcast.com/linode to get a $20 credit and launch a new server in under a minute.
  • And to keep track of how your team is progressing on building new features and squashing bugs, you need a project management system designed by software engineers, for software engineers. Clubhouse lets you craft a workflow that fits your style, including per-team tasks, cross-project epics, a large suite of pre-built integrations, and a simple API for crafting your own. Podcast.__init__ listeners get 2 months free on any plan by going to pythonpodcast.com/clubhouse today and signing up for a trial.
  • Visit the site to subscribe to the show, sign up for the newsletter, and read the show notes. And if you have any questions, comments, or suggestions I would love to hear them. You can reach me on Twitter at @Podcast__init__ or email hosts@podcastinit.com)
  • To help other people find the show please leave a review on iTunes, or Google Play Music, tell your friends and co-workers, and share it on social media.
  • Join the community in the new Zulip chat workspace at pythonpodcast.com/chat
  • Your host as usual is Tobias Macey and today I’m interviewing Syrus Akbary about Graphene, a python library for building your APIs with GraphQL

Interview

  • Introductions
  • How did you get introduced to Python?
  • What is GraphQL and what is the benefit vs a REST-based API?
    • How does it compare to specifications such as OpenAPI (formerly Swagger) or RAML?
  • Can you explain what Graphene is and your motivation for building it?
    • In addition to the Python implementation there is also a JavaScript library. Is that primarily for use as a client or can it also be used in Node for serving APIs?
  • What is involved in building a GraphQL API?
    • What does Graphene do to simplify this process?
  • How is Graphene implemented and how has that evolved since you first started working on it?
    • Is there a set of tests for verifying the compliance of Graphene or a specific API with the GraphQL specification?
  • What are some of the most complex or confusing aspects of building a GraphQL API?
  • What are some of the unique capabilities that are offered by building an application with GraphQL as the communication interface?
  • While reading through documentation in preparation for our conversation I noticed the Quiver project. Can you explain what that is and how it fits with the other Graphene projects?
    • What is it doing under the hood to optimize serving of the API?
  • For someone who is interested in adding a GraphQL interface to an existing application, what would be involved?
  • The documentation mentions creation of a schema, as well as defining queries. Is it possible for a client to craft queries that don’t match directly with those defined in the server layer?
  • What are some of the most interesting or surprising uses of Graphene and GraphQL that you have seeen?
  • What are some cases where it would be more practical to implement an API using REST instead of GraphQL?
  • What are some references that you would recommend for anyone who wants to learn more about GraphQL and its ecosystem?
  • What are your plans for the future of Graphene?

Keep In Touch

Picks

Links

The intro and outro music is from Requiem for a Fish The Freak Fandango Orchestra / CC BY-SA



from Planet Python
via read more

Test and Code: 61: A retrospective

A look back on 3 years of podcasting, and a bit of a look forward to what to expect in 2019.

Top 5 episodes:

  1. 2: Pytest vs Unittest vs Nose
  2. 33: Katharine Jarmul - Testing in Data Science
  3. 18: Testing in Startups and Hiring Software Engineers with Joe Stump
  4. 45: David Heinemeier Hansson - Software Development and Testing, TDD, and exploratory QA
  5. 27: Mahmoud Hashemi : unit, integration, and system testing

Honorable mention: 32: David Hussman - Agile vs Agility, Dude's Law, and more

This episode also went through lots of:

  • what went well
  • what was lacking
  • what's next

Please listen and let me know where I should take this podcast.

Sponsored By:

Support Test & Code

<p>A look back on 3 years of podcasting, and a bit of a look forward to what to expect in 2019.</p> <p>Top 5 episodes:</p> <ol> <li><a href="http://bit.ly/2TeNkFs" rel="nofollow">2: Pytest vs Unittest vs Nose</a></li> <li><a href="http://bit.ly/2CGvq94" rel="nofollow">33: Katharine Jarmul - Testing in Data Science</a></li> <li><a href="http://bit.ly/2TlAdCx" rel="nofollow">18: Testing in Startups and Hiring Software Engineers with Joe Stump</a></li> <li><a href="http://bit.ly/2CG92wK" rel="nofollow">45: David Heinemeier Hansson - Software Development and Testing, TDD, and exploratory QA</a></li> <li><a href="http://bit.ly/2ThPYKL" rel="nofollow">27: Mahmoud Hashemi : unit, integration, and system testing</a></li> </ol> <p>Honorable mention: <a href="http://bit.ly/2CGAY3F" rel="nofollow">32: David Hussman - Agile vs Agility, Dude&#39;s Law, and more</a></p> <p>This episode also went through lots of:</p> <ul> <li>what went well</li> <li>what was lacking</li> <li>what&#39;s next</li> </ul> <p>Please listen and let me know where I should take this podcast.</p><p>Sponsored By:</p><ul><li><a rel="nofollow" href="https://testandcode.com/digitalocean">DigitalOcean</a>: <a rel="nofollow" href="https://testandcode.com/digitalocean">Get started with a free $100 credit </a></li></ul><p><a rel="payment" href="https://www.patreon.com/testpodcast">Support Test &amp; Code</a></p>

from Planet Python
via read more

Sunday, December 30, 2018

codingdirectional: Write python code to win the challenge

Sorry for not posting for a few days because I am so busy preparing the new game for release to major gaming sites which has finally completed yesterday. Now it is time to continue publishing more articles that are related to python and also articles that are related to other programming languages as well. If you like this website don’t forget to subscribe to it by clicking on the bell button below this post.

Today we will continue to look at another website which will help us to improve our python coding skill besides codewars, we will now move to edabit which also provides points reward for those people that have completed a coding challenge on its website. If you have not yet signed up for an account on edabit then just go ahead and do so!

After I have signed up for a free account on edabit it is time to solve a simple python problem to see what is the reward I will get. I clicked on the Challenges tab and then select a simple python challenge, this challenge requires the python program to return the sum of two numbers that have been passed into the addition function.

return the sum of two numbers

After I have solved the above mentioned problem, it is time to submit and see how many points I will get from it.

I get 5 XP from this answer

Let us solve another one, this time the python program will return true or false based on whether a number is less than or equal to zero or not.

Is that number smaller or equal to zero?

This time I get 15XP, the reward interface of this site makes me feel really satisfied, every time we have solved a problem with python the reward interface will pop up and shows those reward points in a manner just like those appears on the real game. Go ahead and try it by yourself, you will gain
confidence in your python programming skill after solving a few easy python problems from this site.



from Planet Python
via read more

Mike Driscoll: PyDev of the Week: Mike Grouchy

This week we welcome Mike Grouchy (@mgrouchy) as our PyDev of the Week. Mike co-founded PyCoder’s Weekly along with Mahdi Yusuf (@myusuf3). He is also the creator of Django Stronghold, a fun Django package you should check out. Let’s take a few moments to get to know Mike better!

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

I currently work as the VP of Engineering at a Startup called PageCloud I am also one of the co-founders/creators/curators of Pycoders Weekly a weekly Python newsletter. As for my background, I’m from St.Johns Newfoundland on the east coast of Canada. I got a BSc in computer science at Memorial University there and then moved to Ottawa, Ontario after that to work (a short stint working in the Canadian government and startups since). In my spare time I usually am busy with my two kids, but when they are sleeping and I’m not working I spend my free time working on some open source things Django Stronghold, new initiatives for Pycoder’s, and messing around with home automation stuff. I’m also starting to get interested in the home server building thing, especially on the budget build side of things. It’s cool to see all the great things you can do repurposing old server hardware that can be gotten inexpensively.

Why did you start using Python?

I played around with Python a little bit in my teen years writing little scripts for automating things and whatnot but I started to get into Python seriously working at my university in the computer science department. The team there was doing some pretty sophisticated stuff with a Python cgi web app that was used to control, build and deploy gentoo images onto lab machines around the university. That was a pretty incredible deep dive for me into the power of Python (also really helped step up my skills in Python and C).

What other programming languages do you know and which is your favorite?

Python is definitely my favorite language (and the one I am best at) but I have professionally written C, C++, C#, java, VB, JavaScript. I have also dabbled a bit with plenty of other languages but my experience is so small they aren’t even worth calling out. Of the other languages that I am experienced with, I think JavaScript is my favorite. While I am not the best JavaScripter, its one of those languages that is so ubiquitous right now in the web world that it makes sense to stay on top of it. The direction JavaScript is moving in right now is also interesting. A lot of the language improvements they have been realizing over the last few years (Like everything in ES6) really demonstrate a language moving in the right direction. (Please JavaScript haters, don’t be mad at me)

What projects are you working on now?

Right now besides Pycoder’s and maintaining my only semi-popular open source library, I’m working on a fairly simple hardware project, a Alexa controllable IR blaster. As I answered in one of my previous questions I am really interested in home automation stuff so I thought this would be a fun little project to do instead of buying a Logitech harmony hub(for my really limited use case). Mahdi(from Pycoders) and I are also working on home hackers a resource for people interested in home automation, homelab and other things like that.

Which Python libraries are your favorite (core or 3rd party)?

If it counts, its not really a library, but Jupyter notebook is incredible. Just being able to write coded examples, inline with documentation, etc. and then share it is fantastic. Its not hard to see why its so popular.

In terms of core libraries I’m going to go off the beaten path here again and call out f-strings. Its a core language feature not a library, but I love them. Much easier to work with than previous string formatting options that were available and very readable(this is important!).

What is the origin story of Pycoders Weekly?

Its not a super interesting story, but my partner ( Mahdi Yusuf ) worked together at this small startup. We were both very enthusiastic about the Python community and were looking around for resources for keeping up and getting involved in the Python community. As we looked around we saw that while there were some Python newsletters at the time, there were none that we wanted to read. This lead to us just thinking “hey, why don’t we give this a try?”. So we validated the idea by creating a landing page with a newsletter signup form and posted it on hacker news and we got ~2k signups in a day or two. At that point we knew this thing had legs so we hurried up and figured out the issue format, etc. that week, sent the first issue 2 weeks later and we have been going since (320+ issues so far!).

Can you explain the key to its success?

I think part of it was just right place, right time and the other part is we tried to be a little bit different compared to the other newsletters that were out there. We tried to keep the content quality really high and really focus on that initial problem we were trying to solve(Create a python newsletter we wanted to read). We wrote blurbs by hand for every single article/project/news item we posted and attempted to add some personality into the mix where we could.

Do you have any advice for others who would like to do an e-zine type endeavor?

Just get out there as quickly as possible with your idea and validate it. You need to quickly find your audience and what they are looking for if you are going to be successful in a sustainable way.

Thanks for doing the interview, Mike!



from Planet Python
via read more

Graham Dumpleton: Deploying a multi user workshop environment

In this fourth post of this series of posts, we finally get to how to deploy a multi user workshop environment using OpenShift, or at least, how to deploy an interactive terminal session per user accessible in the browser. Right now we are still working on the assumption that the workshop notes are deployed separately, but we will get to that in a later post.From the second post in this series we

from Planet Python
via read more

Early Experiments with GPU Dask Arrays

The following code creates and manipulates 2 TB of randomly generated data.

import dask.array as da

rs = da.random.RandomState()
x = rs.normal(10, 1, size=(500000, 500000), chunks=(10000, 10000))
(x + 1)[::2, ::2].sum().compute(scheduler='threads')

On a single CPU, this computation takes two hours.

On an eight-GPU single-node system this computation takes nineteen seconds.

Combine Dask Array with CuPy

Actually this computation isn’t that impressive. It’s a simple workload, for which most of the time is spent creating and destroying random data. The computation and communication patterns are simple, reflecting the simplicity of common for data processing workloads.

What is impressive is that we were able to create a distributed parallel GPU array quickly by composing these three existing libraries:

  1. CuPy provides a partial implementation of Numpy on the GPU.

  2. Dask Array provides chunked algorithms on top of Numpy-like libraries like Numpy and CuPy.

    This enables us to operate on more data than we could fit in memory by operating on that data in

(continued...)

from Planet SciPy
read more

gamingdirectional: The pygame project has finally ready

It has been a day since I had mentioned that I want to upload the new pygame project to the major gaming websites but because of some technical problems that occurred during the files packaging stage the uploading plan has been delayed until today. I have managed to solve all the files packaging issues this morning thus finally this game has been uploaded successfully to various gaming websites.

Source



from Planet Python
via read more

Saturday, December 29, 2018

Graham Dumpleton: Creating your own custom terminal image

In this series of posts I have been talking about some of the work I have been doing with creating environments to host workshops when needing to train users in using a software product such as OpenShift.In the first post I explained how JupyterHub can be used to deploy web applications other than Jupyter notebooks, and how I use it to deploy user environments which give each attendee of a

from Planet Python
via read more

Weekly Python StackOverflow Report: (clviii) stackoverflow python report

These are the ten most rated questions at Stack Overflow last week.
Between brackets: [question score / answers count]
Build date: 2018-12-29 22:40:39 GMT


  1. Why does an empty string in Python sometimes take up 49 bytes and sometimes 51? - [45/2]
  2. Groupby class and count missing values in features - [14/3]
  3. Force elements at beginning and end of list - [11/7]
  4. Large amount of lists concatenation - [9/6]
  5. differences for creating set using set() or {} - [6/5]
  6. How to search for a substring, find the beginning and ending, and then check if that data is a weekday? - [6/5]
  7. How to delete list item automatically in python? - [6/4]
  8. How to calculate the average of the most recent three non-nan value using Python - [6/3]
  9. Compute the last (decimal) digit of x1 ^ (x2 ^ (x3 ^ (... ^ xn))) - [6/3]
  10. How to use while(i = getNext()) pattern in python - [6/2]


from Planet Python
via read more

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...