Python Programming

-
What are the Python Random Functions?
Python provide multiple functions to generate random numbers. Most of these functions are available under the Python random module. You can use these functions for generating random numbers in your Python scripts.
-
PyTorch-Ignite: training and evaluating neural networks flexibly and transparently
This post is a general introduction of PyTorch-Ignite. It intends to give a brief but illustrative overview of what PyTorch-Ignite can offer for Deep Learning enthusiasts, professionals and researchers. Following the same philosophy as PyTorch, PyTorch-Ignite aims to keep it simple, flexible and extensible but performant and scalable.
Throughout this tutorial, we will introduce the basic concepts of PyTorch-Ignite with the training and evaluation of a MNIST classifier as a beginner application case. We also assume that the reader is familiar with PyTorch. -
Python Testing Framework
Testing can be a pain. It is painful to write test cases. Without it, doing manual testing sucks the life out of you. This makes it worst when you had to remember every single command and steps that could take hours to do it.
I know the importance of delivery when you are on a time crunch & death march to get it done. But... if your spending tons of effort to test your deployment. You are sabotaging yourself as these could be automated. Which frees up your time to make changes to your code to make it better, faster and maintainable for your future self or teammates who will be maintaining it.
-
[Older] Python Regular Expressions with Examples
A regular expression (often abbreviated to “regex”) is a technique, and a textual pattern, which defines how one wants to search or modify a given string. Regular expressions are commonly used in Bash shell scripts and in Python code, as well as in various other programming languages.
-
TDD in Python with pytest - Part 2
This is the second post in the series "TDD in Python with pytest" where I develop a simple project following a strict TDD methodology. The posts come from my book Clean Architectures in Python and have been reviewed to get rid of some bad naming choices of the version published in the book.
-
Guide to String Interning in Python
One of the first things you encounter while learning the basics of programming is the concept of strings. Similar to various programming languages, Python strings are arrays of bytes representing Unicode characters - an array or sequence of characters. Python, unlike many programming languages, doesn’t have a distinct character datatype, and characters are considered strings of length 1.
You can define a string using single or double quotation marks, for example, a = "Hello World" or a = 'Hello World'. To access a specific element of a string, you would use square brackets ([]) with the index of the character you wish to access (indexing starts at 0). Calling a[0], for example, would return H.
-
The Real Python Podcast – Episode #26: 5 Years Podcasting Python with Michael Kennedy: Growth, GIL, Async, and More
Why is Python pulling in so many new programmers? Maybe some of that growth is from Python being a full-spectrum language. This week on the show we have Michael Kennedy, the host of the podcast "Talk Python to Me". Michael reflects on five years of podcasting about Python, and many of the changes he has seen in the Python landscape.
-
SecureDrop package build breakage due to setuptools
A few days ago, setuptools 50.0.0 release caused breakage to many projects. SecureDrop package builds was also broken. We use dh-virtualenv tool to build the packages. Initially, we tried to use the experimental build system from dh-virtualenv. We could specify the version of the setuptools to be installed in the virtualenv while creating it.
This approach worked for Xenial builds. As we are working to have proper builds on Focal (still work in progress), that was broken due to the above-mentioned change.
So, we again tried to use Python's venv module itself to create the virtual environment and use the wheels from the /usr/share/python-wheels directory to build the virtual environment. Which works very nicely on Xenial, but on Focal the default setuptools version is 44.0.0, which also failed to install the dependencies.
-

- Login or register to post comments
Printer-friendly version- 2722 reads
PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
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.
|
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.
|
today's howtos
|








.svg_.png)
Content (where original) is available under CC-BY-SA, copyrighted by original author/s.

Recent comments
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago