Language Selection

English French German Italian Portuguese Spanish

Python Programming Leftovers

Filed under
Development
  • Formatting Strings with the Python Template Class

    Python Templates are used to substitute data into strings. With Templates, we gain a heavily customizable interface for string substitution (or string interpolation).

    Python already offers many ways to substitute strings, including the recently introduced f-Strings. While it is less common to substitute strings with Templates, its power lies in how we can customize our string formatting rules.

    In this article, we'll format strings with Python's Template class. We'll then have a look at how we can change the way our Templates can substitute data into strings.

  • PyCharm 2019.3.3

    Our PyCharm release is now ready! We’ve added some important fixes to make sure we provide you with the best tool we can, so be sure to update to the newest version! You can get it from within PyCharm (Help | Check for Updates), using JetBrains Toolbox, or by downloading the new version from our website.

  • PyCharm 2020.1 EAP 2

    We have a new Early Access Program (EAP) version of PyCharm that can be now downloaded from our website.

    Our work to create a better PyCharm 2020.1 continues with new features, usability improvements, and bug fixes making their way into our EAP build. If you want to be the first to try them out, and help us in the process, make sure to use our free EAP versions.

  • Maya Island

    This time we want to give prominence to the people responsible for making this island happen. They are our active users - Phil15 and kurosawa4434. They committed themselves to creating new missions using Simon Tatham's Portable Puzzle Collection (from which, by the way, you can also download interesting puzzles, or apps, and solve them). Phil15 worked on the tasks and kurosawa4434 created visual designs for them. Guys really contributed a lot to the CheckiO portal and the missions turned out to be so interesting, so we couldn't help ourselves not to put their creations on the separate island.

  • How to compress the uploaded image before storing it in Django

    We already know how to upload the image file in Django, store it and use it in Django templates. Sometimes images are of large size and we want to compress them to save some space and to reduce the page load time where those images are being used. In this article, we will see how to compress and image before storing it.

  • How to upload an Image file in Django

    If you are looking for a way to upload and use the image on your Django website, then this article is for you. Follow these simple steps to upload an image or any file in your Django application.

  • Fast Forms With UpdateView - Building SaaS #44

    In this episode, we worked on an edit view. We used Django’s generic UpdateView to add the process and test drove the creation of the view to verify things every step of the way.

    We worked on a view to make it possible to edit the CourseTask model that are the actions that a student must complete for a course.

    To complete the form quickly, I took advantage of Django’s ModelForm views. These views are designed to make forms rapidly from existing models.

  • Nikola v8.0.4 is out!

    Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many popular markup formats, such as reStructuredText and Markdown — and can even turn Jupyter Notebooks into blog posts! It also supports image galleries, and is multilingual. Nikola is flexible, and page builds are extremely fast, courtesy of doit (which is rebuilding only what has been changed).

  • How to upgrade to paid account on PythonAnyWhere

    When I started developing Django applications, one constant concern I had was 'which is the best server for hosting Django applications?'.

    I read multiple articles about hosting the Django app, hosting service providers and server providing Django support. Most of them provide support for python but very few provide support for Django.

    I even purchased hosting space on two servers but thanks to money-back guarantee scheme, my money was returned as I was not satisfied with their service.

  • Overload Functions in Python

    Function overloading is the ability to have multiple functions with the same name but with different signatures/implementations. When an overloaded function fn is called, the runtime first evaluates the arguments/parameters passed to the function call and judging by this invokes the corresponding implementation.

  • Matplotlib tutorial (Plotting Graphs Using pyplot)

    Matplotlib is a library in python that creates 2D graphs to visualize data. Visualization always helps in better analysis of data and enhance the decision-making abilities of the user. In this matplotlib tutorial, we will plot some graphs and change some properties like fonts, labels, ranges, etc,

    First, we will install matplotlib, then we will start plotting some basics graphs. Before that, let’s see some of the graphs that matplotlib can draw.

  • How to resolve a git conflict in poetry.lock

    We use poetry in MDN Kuma. That means there's a pyproject.toml and a poetry.lock file. To add or remove dependencies, you don't touch either file in an editor.

  • Plotting earning graph based on the month with Python

    For those of you who have followed the record sales and save data into the database project, this will be the final chapter of this project. In the future, you can follow the project updates on the Github page.

    In this chapter, I have included the combo box which allows the user to select the month he or she wishes to see the graph of sale data!

    There is no need to create another combo box to let the user select the month before he submits the earning into the database. We just need to extract the data from the earning table based on the date which has been automatically inserted during the data submission project.

    Below is the user interface part of the program where only a combo box has been added beside the plot buttons to let the user selects the month he wishes to view the graph of total earning.

  • Talk Python to Me: #250 Capture over 400x C02 as trees with AI and Python

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.