Language Selection

English French German Italian Portuguese Spanish

Python Programming

Filed under
Development
  • Dissecting a Web stack - The Digital Cat

    Having recently worked with young web developers who were exposed for the first time to proper production infrastructure, I received many questions about the various components that one can find in the architecture of a "Web service". These questions clearly expressed the confusion (and sometimes the frustration) of developers who understand how to create endpoints in a high-level language such as Node.js or Python, but were never introduced to the complexity of what happens between the user's browser and their framework of choice. Most of the times they don't know why the framework itself is there in the first place.
    The challenge is clear if we just list (in random order), some of the words we use when we discuss (Python) Web development: HTTP, cookies, web server, Websockets, FTP, multi-threaded, reverse proxy, Django, nginx, static files, POST, certificates, framework, Flask, SSL, GET, WSGI, session management, TLS, load balancing, Apache.
    In this post, I want to review all the words mentioned above (and a couple more) trying to build a production-ready web service from the ground up. I hope this might help young developers to get the whole picture and to make sense of these "obscure" names that senior developers like me tend to drop in everyday conversations (sometimes arguably out of turn).
    As the focus of the post is the global architecture and the reasons behind the presence of specific components, the example service I will use will be a basic HTML web page. The reference language will be Python but the overall discussion applies to any language or framework.
    My approach will be that of first stating the rationale and then implementing a possible solution. After this, I will point out missing pieces or unresolved issues and move on with the next layer. At the end of the process, the reader should have a clear picture of why each component has been added to the system.

  • Introducing AutoScraper: A Smart, Fast and Lightweight Web Scraper For Python | Codementor

    In the last few years, web scraping has been one of my day to day and frequently needed tasks. I was wondering if I can make it smart and automatic to save lots of time. So I made AutoScraper!

  • django-render-block 0.8 (and 0.8.1) released!

    A couple of weeks ago I released version 0.8 of django-render-block, this was followed up with a 0.8.1 to fix a regression.

    django-render-block is a small library that allows you render a specific block from a Django (or Jinja) template, this is frequently used for emails when you want multiple pieces of an email together in a single template (e.g. the subject, HTML body, and text body), but they need to be rendered separately before sending.

  • Pyston v2: 20% faster Python | The Pyston Blog

    We’re very excited to release Pyston v2, a faster and highly compatible implementation of the Python programming language. Version 2 is 20% faster than stock Python 3.8 on our macrobenchmarks. More importantly, it is likely to be faster on your code. Pyston v2 can reduce server costs, reduce user latencies, and improve developer productivity.

    Pyston v2 is easy to deploy, so if you’re looking for better Python performance, we encourage you to take five minutes and try Pyston. Doing so is one of the easiest ways to speed up your project.

  • Pyston v2 Released As ~20% Faster Than Python 3.8 - Phoronix

    Version 2.0 of Pyston is now available, the Python implementation originally started by Dropbox that builds on LLVM JIT for offering faster Python performance.

    Pyston developers believe their new release is about 20% faster than the standard Python 3.8 and should be faster for most Python code-bases.

  • Python int to string – Linux Hint

    Python is one of the universal languages that support various types of data types like integer, decimal point number, string, and complex number. We can convert one type of data type to another data type in Python. This data type conversion process is called typecasting. In Python, an integer value can easily be converted into a string by using the str() function. The str() function takes the integer value as a parameter and converts it into the string. The conversion of int to string is not only limited to the str() function. There are various other means of int to string conversion. This article explains the int to string conversion with various methods.

  • Python isinstance() Function – Linux Hint

    Python is one of the best and efficient high-level programming languages. It has a very straightforward and simple syntax. It has very built-in modules and functions that help us to perform the basic tasks efficiently. The Python isinstance() function evaluates either the given object is an instance of the specified class or not.

More in Tux Machines

Zotero: An Open Source App to Help You Collect & Share Research

Zotero is a completely open-source project that you can find on GitHub. It aims to help you easily collect, organize, add notes, and share your research. And, all of that without being a cloud-based service, it is completely offline. So, your research notes belong to you. Of course, unless you want to sync it for collaboration purpose, for which you may have to refer the documentation. To give you a head start, you can either opt for a WebDAV storage or just create a Zotero account to sync and share your research easily. Read more

GhostBSD 20.11.28 Release Announcement

I am happy to announce the availability of GhostBSD 20.11.28. This release comes with a new live system that leverages ZFS, compression, and replication first introduced in FuryBSD by Joe Maloney. The 20.11.28 release contains numerous improvements, including OS fixes for linuxulator to improve Linux Steam performance, an updated kernel, and GhostBSD userland updates. Userland updates include a MATE desktop upgrade to version 1.24.1, Software Station performance improvements, and numerous application updates. Read more

Linux 5.10-rc6

For the first part of the week, it really looked like things were
calming down quite nicely, and I mentally already went "Ahh,
Thanksgiving week, this is going to be a nice small, calm rc".

And then Friday rolled around, and everybody sent me their pull
requests for the week, and it all looks very normal again.

But at least this week isn't unusually bigger than normal - it's a
pretty normal rc6 stat-wise.  So unless we have some big surprising
left-overs coming up, I think we're in good shape.

And the diffstat looks nice and flat too,  which is a sign of just
widespread small fixes, rather than some big last-minute changes. The
exception is a chunk of fixes to the new vidtv driver, but that is not
only a new driver, it's a virtual test-driver for validation and
development rather than something that would affect users.

That vidtv driver shows up very clearly in the patch stats too, but
other than that it all looks very normal: mostly driver updates (even
ignoring the vidtv ones), with the usual smattering of small fixes
elsewhere - architecture code, networking, some filesystem stuff.

So I'm feeling pretty good about 5.10, and I hope I won't be proven
wrong about that. But please do test,

                 Linus

Read more

Review: Trisquel GNU/Linux 9.0

Trisquel GNU/Linux is an entirely free (libre) distribution based on Ubuntu. Trisquel offers a variety of desktop editions, all of which are stripped of non-free software components. The project is one of the few Linux distributions endorsed by the Free Software Foundation and a rare project that attempts to both be entirely free and friendly to less experienced Linux users. The Trisquel website lists several desktop editions. The main edition (which is a 2.5GB download) features the MATE desktop environment while the Mini edition is about half the size and runs LXDE. There is also a KDE Plasma edition (called Triskel) along with Trisquel TOAST which runs the Sugar learning platform. Finally, there is a minimal net-install option for people who are comfortable building their system from the ground up using a command line interface. The release announcement for Trisquel 9.0 is fairly brief and does not mention many features. The bulk of the information is provided in this paragraph: "The default web browser Abrowser, our freedom and privacy respecting take on Mozilla's browser, provides the latest updates from upstream for a great browsing experience. Backports provide extended hardware support." Though it does not appear to be mentioned specifically in the release announcement, Trisquel 9.0 looks to be based on Ubuntu 18.04 LTS packages, with some applications backported. [...] On the whole I found Trisquel to be pleasant to use, easy to set up, and pretty capable out of the box. I really like how fast it performed tasks and how uncluttered/unbusy the desktop felt. The one problem I had with Trisquel was the lack of wireless networking support. The distribution strives for software freedom (as defined by the Free Software Foundation) and this means no non-free firmware, drivers, or applications. This slightly limits its hardware support compared to most Linux distributions. It also means no easy access to applications such as Steam, Chrome, Spotify, and so on. This may make Trisquel a less practical operating system to some, but that is sort of the point: Trisquel takes a hard stance in favour of software freedom over convenience. If you are a person who does not use non-free software and doesn't need non-free wireless support, then Trisquel is probably the best experience you can have with an entirely free Linux distribution. It is painless to set up, offers several desktop flavours, and runs quickly. For free software enthusiasts I would highly recommend giving Trisquel a try. Read more