Language Selection

English French German Italian Portuguese Spanish

Python Programming

Filed under
Development
  • Odoo in a root-less container

    The main workstation running Fedora 31 now, devoid of any trace of python2, I had to either spin up a virtual machine (which I happily did in the past using qemu and kvm [no libvirt or GNOME Boxes]) or get the hands dirty on containers this time to develop on Odoo [1] version 10 which depends on python2. Faced with the challenge^Wopprotunity, I started to learn to use containers.

    Never tried to use docker, even though I am familiar with its technology and at times I wanted to try and have hands on experience on the technology. Fast forward, podman and buildah came along with the possibility to run root-less containers and they’re available in Fedora.

  • 3 handy command-line internet speed tests

    Speedtest is an old favorite. It's implemented in Python, packaged in Apt, and also available with pip. You can use it as a command-line tool or within a Python script.

  • Python Program to Convert Octal Number to Decimal and vice-versa

    The octal numeral system, or oct for short, is the base-8 number system and uses the digits 0 to 7. The main characteristic of an Octal Numbering System is that there are only 8 distinct counting digits from 0 to 7 with each digit having a weight or value of just 8 starting from the least significant bit (LSB).

    In the decimal number system, each digit represents the different power of 10 making them base-10 number system.

  • Using SQLAlchemy with Flask and PostgreSQL

    Databases are a crucial part of modern applications since they store the data used to power them. Generally, we use the Structured Query Language (SQL) to perform queries on the database and manipulate the data inside of it. Though initially done via dedicated SQL tools, we've quickly moved to using SQL from within applications to perform queries.

    Naturally, as time passed, Object Relational Mappers (ORMs) came to be - which enable us to safely, easily and conveniently connect to our database programmatically without needing to actually run queries to manipulate the data.

    One such ORM is SQLAlchemy. In this post, we will delve deeper into ORMs and specifically SQLAlchemy, then use it to build a database-driven web application using the Flask framework.

  • Python Program To Reverse a Sentence
  • How to pad/fill a string by a variable in Python using f-strings

    I often find myself Googling for this. Always a little bit embarrassed that I can't remember the incantation (syntax).

  • Add Styles To Templates - Building SaaS #42

    In this episode, I added a CSS framework, Tailwind CSS. After working through some issues with the log out feature, we started to style the base template of the site.

    To stay true to my “make the minimum possible thing that will work,” I added Tailwind CSS from a CDN, content delivery network.

  • Refund policy for Attendees and Financial Aid recipients traveling to PyCon internationally

    International travel to the United States has become a greater risk for many in our community. In light of current conditions, PyCon would like to highlight the support we provide for international travelers. If you are travelling internationally to PyCon, take note of the following information. Financial Aid applicants should take note of additional information specific to that process in the second section.

  • Create a project to track total sales at different locations with the Python program

    In the previous posts, we have gone through a project which will receive the user input and commit those data into the earning table. This program has been further modified to include the plotting of a bar chart to indicate the total sales of various inventories in various locations.

    This project has been uploaded to this site, you can download the source code of this project for free through this link. If you like this project, don’t forget to award me with stars on the same project page or share the project page with friends!

  • Python Program to Convert Binary Number to Decimal and Vice-Versa

    A binary number is a number expressed in the base-2 numeral system or binary numeral system, which uses only two symbols 0 and 1.

    The decimal numeral system is the standard system for denoting integer and non-integer numbers.

    All decimal numbers can be converted to equivalent binary values and vice versa for example, the binary equivalent of “2” is “10” to explore more visit binary to decimal converter.

    In this article, we will create python programs for converting a binary number into decimal and vice versa

  • Using MySQL’s LOAD DATA with Django

    While attempting to improve performance of bulk inserting data into MySQL database my coworker came across the LOAD DATA SQL statement. It allows you to read data from a text file (in a comma separated variable-like format) and quickly insert it into a table. There’s two variations of it, a local remote version. We did not experiment with the local version since we were connecting to a remote MySQL server and did not have access to the database’s local disk.

  • Cleanly removing a Django app (with models)

    While pruning features from our product it was necessary to fully remove some Django apps that had models in them. If the code is just removed than the tables (and some other references) will be left in the database.

  • Rename Files in Python: A Guide with Examples using os.rename()

    In this post, we are going to work with Python 3 to rename files. Specifically, we will use the Python module os to rename a file and rename multiple files.

    First, we will rename a single file in 4 easy steps. After that, we will learn how to rename multiple files using Python 3. To be able to change the name of multiple files using Python can come in handy. For example, if we have a bunch of data files (e.g., .csv files) with long, or strange names, we may want to rename them to make working with them easier later in our projects (e.g., when loading the CSV files into a Pandas dataframe).

More in Tux Machines

Laravel Programming

  • Send Emails in Laravel Using SMTP

    Sending an email is a common requirement for any web application. Some general uses of sending emails include verifying user registration, getting feedback from users, providing options to contact the site administrator, etc. The Laravel framework contains several packages to send emails from the Laravel project. SMTP, Mailgun, Postmark, and Amazon SES are used in Laravel for sending simple, transactional, and bulk emails. Laravel has an email-sending library named SwiftMailer to send an email with an email template. This tutorial shows you how to send a simple email using SMTP.

  • Laravel Facade

    The Laravel service container allows the user to initiate classes by alias. The way to access the Laravel service container is called a facade. Laravel contains many built-in facades to access different Laravel features. The facade is used in Laravel to make the application more testable, flexible, and simpler. All built-in facades are defined in the namespace Illuminate\Support\Facades. This tutorial shows how to create and use Laravel built-in facades.

  • Laravel Pagination

    Pagination is used to display many records at once by dividing the data into multiple pages to make it readable. Using pagination in Laravel is very simple because this feature is integrated with Eloquent ORM and a query builder. The limit and offset of the paginations are calculated automatically in Laravel. The paginate() and link() methods are used to implement pagination in Laravel. This tutorial shows you how to apply pagination in Laravel projects.

  • Laravel Route

    The route is used to create a request URL for the Laravel application. The URL is defined in the route file in a human-readable format. In Laravel 7, all types of route information are stored in two files, web.php and api.php. These files are located in the routes folder of the Laravel project. All web application-related routes are defined in web.php and all API-related routes are defined in api.php. This tutorial covers different types of routing methods and how the get() method can be used for defining the different routes for Laravel projects.

  • Laravel Resource Controllers

    A resource controller is used in Laravel to perform CRUD operations easily. When you will create a resource controller using artisan command from the terminal then it will create all necessary methods inside the controller related to CRUD operations. It handles all HTTP requests for the application and requires a single line of code for CRUD routes. How you can create a resource controller and perform CRUD operations in Laravel are shown in this tutorial.

openSUSE Tumbleweed vs. Leap 15.2 vs. Jump Alpha Benchmarks

Following the recent alpha debut of the openSUSE Jump distribution for testing that is working to synchronize SUSE Linux Enterprise with openSUSE Leap, there was an inquiry made about the performance of it. So for addressing that premium member's question, here are some benchmarks carried out recently of the latest openSUSE Leap 15.2 against the openSUSE Jump in its early state against the rolling-release openSUSE Tumbleweed. Read more

today's howtos

Ubuntu Touch OTA-13 Released With More Phones Supported, UI Improvements

The UBports community has announced the release of Ubuntu Touch OTA-13 as their newest over-the-air update to this Ubuntu mobile operating system. With Ubuntu Touch OTA-13 now supported are the Sony Xperia X/XZ/Performance and OnePlus 3/3T devices. This is on top of around one dozen other devices from the LG Nexus 4/5 to earlier OnePlus devices, FairPhone 2, Nexus 7, and different Meizu and BQ devices from the early days of the Ubuntu Touch effort at Canonical. Read more Direct: Ubuntu Touch OTA-13 release Also: Ubuntu Weekly Newsletter Issue 649