Language Selection

English French German Italian Portuguese Spanish

Python Programming Bits and Last of Python 2

Filed under
Development
  • Python 2.7.18, the last release of Python 2

    The CPython core developers are pleased to announce the immediate availability of Python 2.7.18.

  • Python 2.7.18, the end of an era
    I'm eudaemonic to announce the immediate availability of Python 2.7.18.
    
    
    
    Python 2.7.18 is a special release. I refer, of course, to the fact that "2.7.18" is the closest
    any Python version number will ever approximate e, Euler's number. Simply exquisite!
    
    
    
    A less transcendent property of Python 2.7.18 is that it is the last Python 2.7 release and
    therefore the last Python 2 release. It's time for the CPython community to say a fond but firm
    farewell to Python 2. Users still on Python 2 can use e to compute the instantaneously compounding
    interest on their technical debt.
    
    
    
    Download this unique, commemorative Python release on python.org:
    
    
    
       https://www.python.org/downloads/release/python-2718/
    
    
    
    Python 2.7 has been under active development since the release of Python 2.6, more than 11 years
    ago. Over all those years, CPython's core developers and contributors sedulously applied bug fixes
    to the 2.7 branch, no small task as the Python 2 and 3 branches diverged. There were large changes
    midway through Python 2.7's life such as PEP 466's feature backports to the ssl module and hash
    randomization. Traditionally, these features would never have been added to a branch in maintenance
    mode, but exceptions were made to keep Python 2 users secure. Thank you to CPython's community for
    such dedication.
    
    
    
    Python 2.7 was lucky to have the services of two generations of binary builders and operating
    system experts, Martin von Löwis and Steve Dower for Windows, and Ronald Oussoren and Ned Deily for
    macOS. The reason we provided binary Python 2.7 releases for macOS 10.9, an operating system
    obsoleted by Apple 4 years ago, or why the "Microsoft Visual C++ Compiler for Python 2.7" exists is
    the dedication of these individuals.
    
    
    
    I thank the past and present Python release managers, Barry Warsaw, Ned Deily, Georg Brandl, Larry
    Hastings, and Łukasz Langa for their advice and support over the years. I've learned a lot from
    them—like don't be the sucker who volunteers to manage the release right before a big compatibility
    break!
    
    
    
    Python 3 would be nowhere without the critical work of the wider community. Library maintainers
    followed CPython by maintaining Python 2 support for many years but also threw their weight behind
    the Python 3 statement (https://python3statement.org). Linux distributors chased Python 2 out of
    their archives. Users migrated hundreds of millions of lines of code, developed porting guides, and
    kept Python 2 in their brain while Python 3 gained 10 years of improvements.
    
    
    
    Finally, thank you to GvR for creating Python 0.9, 1, 2, and 3.
    
    
    
    Long live Python 3+!
    
    
    
    Signing off,
    
    Benjamin
    
    2.7 release manager
    
  • Python 2.7.18, the end of an era

    Python 2.7.18 is out. This is the last release and end of support for Python 2.

  • Introducing ndindex, a Python library for manipulating indices of ndarrays

    One of the most important features of NumPy arrays is their indexing semantics. By "indexing" I mean anything that happens inside square brackets, for example, a[4::-1, 0, ..., [0, 1], np.newaxis]. NumPy's index semantics are very expressive and powerful, and this is one of the reasons the library is so popular.

    [...]

    These limitations may be annoying, but are easy enough to live with. The real challenge when working with indices comes when you try to manipulate them. Slices in particular are challenging to work with because the rich meaning of slice semantics. Writing formulas for even very simple things is a real challenge with slices. slice(start, stop, step) (corresponding to a[start:stop:step]) has fundamentally different meaning depending on whether start,stop, or step are negative, nonnegative, or None. As an example, take a[4:-2:-2], where a is a one-dimensional array. This slices every other element from the third element to the second from the last. What will the shape of this sliced array be? The answer is (0,) if the original shape is less than 1 or greater than 5, and (1,) otherwise.

  • How to patch in Python?

    (monkey-) patching is a technique for changing code behaviour without altering its source. It is done in runtime, usually by overriding attributes of existing objects. An object can be an instance of some sort, a class or even a module. The technique is most commonly (ab)used for tests when we cannot pass mocks in a simple way.

    [...]

    Gevent made requests a coroutine-friendly library and thanks to concurrency, it enabled our example server to handle over 13.5 times more requests per second.

    In the end, we have a program that has coroutine-based concurrency (same principle as in asyncio or node.js) but its code still looks like synchronous one. We do not need special, cooperative libraries or async/await keywords in our code. It’s almost like magic.

  • Installation of Jupyter on external hard disk/ USB

    We have to use Jupyter notebooks for Machine Learning at our university. Jupyter needs a lot of space on the hard disk and I was able to remember (from vocational school) that we were able to install PHPMyAdmin on a USB stick. You have a transportable web application on this way. I had this goal for Jupyter and the Python environment on Linux.

More in Tux Machines

digiKam 7.7.0 is released

After three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release. Read more

Dilution and Misuse of the "Linux" Brand

Samsung, Red Hat to Work on Linux Drivers for Future Tech

The metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world. Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility. Read more

today's howtos

  • How to install go1.19beta on Ubuntu 22.04 – NextGenTips

    In this tutorial, we are going to explore how to install go on Ubuntu 22.04 Golang is an open-source programming language that is easy to learn and use. It is built-in concurrency and has a robust standard library. It is reliable, builds fast, and efficient software that scales fast. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel-type systems enable flexible and modular program constructions. Go compiles quickly to machine code and has the convenience of garbage collection and the power of run-time reflection. In this guide, we are going to learn how to install golang 1.19beta on Ubuntu 22.04. Go 1.19beta1 is not yet released. There is so much work in progress with all the documentation.

  • molecule test: failed to connect to bus in systemd container - openQA bites

    Ansible Molecule is a project to help you test your ansible roles. I’m using molecule for automatically testing the ansible roles of geekoops.

  • How To Install MongoDB on AlmaLinux 9 - idroot

    In this tutorial, we will show you how to install MongoDB on AlmaLinux 9. For those of you who didn’t know, MongoDB is a high-performance, highly scalable document-oriented NoSQL database. Unlike in SQL databases where data is stored in rows and columns inside tables, in MongoDB, data is structured in JSON-like format inside records which are referred to as documents. The open-source attribute of MongoDB as a database software makes it an ideal candidate for almost any database-related project. This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the MongoDB NoSQL database on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux.

  • An introduction (and how-to) to Plugin Loader for the Steam Deck. - Invidious
  • Self-host a Ghost Blog With Traefik

    Ghost is a very popular open-source content management system. Started as an alternative to WordPress and it went on to become an alternative to Substack by focusing on membership and newsletter. The creators of Ghost offer managed Pro hosting but it may not fit everyone's budget. Alternatively, you can self-host it on your own cloud servers. On Linux handbook, we already have a guide on deploying Ghost with Docker in a reverse proxy setup. Instead of Ngnix reverse proxy, you can also use another software called Traefik with Docker. It is a popular open-source cloud-native application proxy, API Gateway, Edge-router, and more. I use Traefik to secure my websites using an SSL certificate obtained from Let's Encrypt. Once deployed, Traefik can automatically manage your certificates and their renewals. In this tutorial, I'll share the necessary steps for deploying a Ghost blog with Docker and Traefik.