Language Selection

English French German Italian Portuguese Spanish

Python Programming

Filed under
Development
  • Strptime Python

    Strptime python is used to convert string to datetime object.

  • Book review – Effective Python, by Brett Slatkin (and a free chapter for download)

    Those among you who have already learned some Python or may even have used it in some projects will certainly have heard the expression “Pythonic Code”, which conveys a general and somewhat wide meaning of “clean code and good software development practices in the context of Python”. With Effective Python, the author presents you with nothing less than 90 practical examples on how to adopt a pythonic developer mindset and how to write better Python code.

  • Application and Request Contexts in Flask

    The first blog post provides examples of how to the Application and Request contexts work, including how the current_app, request, test_client, and test_request_context can be used to effectively used to avoid pitfalls with these contexts.

    The second blog post provides a series of diagrams illustrating how the Application and Request contexts are processed when a request is handled in Flask. This post also dives into how LocalStack objects work, which are the objects used for the Application Context Stack and the Request Context Stack.

  • Python Community Interview With David Amos

    I discovered programming by accident when I came across the source code for the Gorillas game on my parents’ IBM 386 PS/2 computer. I guess I was about seven or eight years old. I found something called a .BAS file that opened up a program called QBasic and had all sorts of strange-looking text in it. I was instantly intrigued!

    There was a note at the top of the file that explained how to adjust the game speed. I changed the value and ran the game. The effect was instantly noticeable. It was a thrilling experience.

    I was obsessed with learning to program in QBasic. I made my own text adventure games. I even made a few animations using simple geometric shapes. It was tons of fun!

    QBasic was a fantastic language for an eight-year-old kid to learn. It was challenging enough to keep me interested but easy enough to get quick results, which is really important for a child.

    When I was around ten years old, I tried to teach myself C++. The ideas were too complex, and results came too slowly. After a few months of struggling, I stopped. But the idea of programming computers remained attractive to me—enough so that I took a web technology class in high school and learned the basics of HTML, CSS, and JavaScript.

    In college, I decided to major in mathematics, but I needed a minor. I chose computer science because I thought having some experience with programming would make it easier to complete the degree requirements.

    I learned about data structures with C++. I took an object-oriented programming class with Java. I studied operating systems and parallel computing with C. My programming horizons expanded vastly, and I found the whole subject pleasing both practically and intellectually.

  • PyCharm 2020.3 EAP – Starts now!

    The Early Access Program for our next major release, PyCharm 2020.3, is now open! If you are always looking forward to the next ‘big thing’ we encourage you to join the program and share your thoughts on the latest PyCharm improvements!

    [...]

    If you’re on Ubuntu 16.04 or later, you can use snap to get PyCharm EAP and stay up to date. You can find the installation instructions on our website.

  • Extracting two SDF data items with chemfp's text toolkit

    This is part of a series of essays about working with SD files at the record and simple text level. In yesterday's essay I showed several examples of using chemfp's text toolkit API to process records from an SD file. In some cases, reading the entire record is too much work so in this essay I'll show some examples of extracting just two pieces of information (a title and a single SDF data item value, or two data item values) from the records.

    [...]

    In yesterday's essay I noticed that most records in the ChEBI SDF distribution ChEBI_complete.sdf.gz contain a SMILES data item. (112,938 out of 113,902 to be precise.)

    Let's extract those to make a SMILES files! (We could of course use a chemistry toolkit to parse the connection table into a molecule then generate a SMILES, but that's not the point of this essay.)

  • Talk Python to Me: #283 Web scraping, the 2020 edition

    Web scraping is pulling the HTML of a website down and parsing useful data out of it. The use-cases for this type of functionality are endless. Have a bunch of data on governmental sites that are only listed online in HTML without a download? There's an API for that! Do you want to keep abreast of what your competitors are featuring on their site? There's an API for that. Need alerts for changes on a website, for example enrollment is now open at your college and you want to be first to get in and avoid the 8am Monday morning course slot? There's an API for that.

    That API is screen scraping and Attila Tóth from ScrapingHub is here to tell us all about it.

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.