Language Selection

English French German Italian Portuguese Spanish

Python Programming

Filed under
Development
  • [Part 1/2] Deploy a Smart Contract on Ethereum with Python, Truffle and web3py | Codementor

    In this tutorial, we'll write a simple smart contract, deploy it to a personal Ethereum blockchain, and call the contract from a Python script.

  • [Part 2/2] Persist data to the Ethereum blockchain using Python, Truffle, and Ganache | Codementor

    The previous post demonstrated how to write a simple smart contract with Solidity and deploy it to the Ethereum Blockchain.
    This tutorial will show how to update the contract to save some data in the blockchain as well as how to inspect the blockchain to see our transactions.

  • Using Python Generators to avoid extra service calls | Codementor

    I've been using Python Generators for a while now, having to deal with large Django Querysets, reading large Excel files, and being able to save memory by using generators became part of my day to day work. However, these days I faced a different problem where I wanted to avoid making extra calls to services and solved it with generators. This is what this post is about.

    Suppose you want to check if a given user_email is registered in any of the following social media: Facebook, Github, or Twitter.

  • Guide To Frontend Testing Using Django | Codementor

    Web applications can have many different layers of logic including template rendering, request handling, database connection, and form validations. Due to this complex nature of layers, testing a web application can prove difficult.

    Most of the time, backend testing is higher priority than frontend testing, but performance issues on the client-side can prevent users from making the most out of the product.

    For this reason, front-end testing should always be incorporated in the workflows, so that a seamless experience for the end-user can be ensured. Luckily, there are many online tools you can use to create and automate frontend testing in an easy way.

    Writing tests for frontend can prove quite complicated and managing them after multiple iterations can be a challenge for Quality Assurance testers. Fortunately, there are tools available to improve and automate the process of testing.

  • Translating Web Page while Scraping

    Suppose you need to scrape data from a website after translating the web page in R and Python. In google chrome, there is an option (or functionality) to translate any foreign language. If you are an english speaker and don't know any other foreign language and you want to extract data from the website which does not have option to convert language to English, this article would help you how to perform translation of a webpage.

    [...]

    You may not familiar with Selenium so it is important to understand the background. Selenium is an open-source tool which is very popular in testing domain and used for automating web browsers. It allows you to write test scripts in several programming languages. Selenium is available in both R and Python.

  • PyCharm 2020.3 EAP #4: Pair Programming, Intelligent Text Proofreading, and More – PyCharm Blog | JetBrains

    This week’s EAP is devoted to platform-wide features, now bundled in PyCharm: Code With Me, a tool for collaborative development and pair programming, and Grazie, an intelligent text proofreading assistant. For the full list of issues fixed in this update, see the release notes.

    We invite you to join our EAP to try out the latest features we have coming up, test that they work properly in your environments, and help us make a better PyCharm for everyone!

  • In Python, using the logging package is part of your API, or should be

    We have a Python program for logging email attachment type information. As part of doing this, it wants to peer inside various sorts of archive types to see what's inside of them, because malware puts bad stuff there. One of the Python modules we use for this is the Ubuntu packaged version of libarchive-c, which is a Python API for libarchive. Our program prints out information in a very specific output format, which our Exim configuration then reads and makes use of.

  • Blog | New features in Spyder 4's new debugger! — Spyder IDE

    IPython is a great improvement over the standard Python interpreter, bringing many enhancements such as autocompletion and "magic" commands. When debugging, however, many of these features become inaccessible. With Spyder, we aim to bring back these capabilities and more for a truly premium debugging experience! (And believe me, I use this debugger a lot, and not only because I write code that might contain bugs Tongue).

    In this post, I will describe the debugger improvements we've already made in Spyder 4, as well as those that are already implemented or under review for Spyder 4.2 and beyond.

  • Beginner Python Tutorial: Analyze Your Personal Netflix Data – Dataquest

    That's a question that has run through my head repeatedly over the years. The beloved sitcom has been my top "comfort show/background noise" choice for a long time.

    It used to be a question I couldn't answer, because the data Netflix allowed users to download about their activity was extremely limited.

    Now, though, Netflix allows you to download a veritable treasure-trove of data about your account. With a just a little Python and pandas programming, we can now get a concrete answer to the question: how much time have I spent watching The Office?

    Want to find out how much time you have spent watching The Office, or any other show on Netflix?

    In this tutorial, we'll walk you through exactly how to do it step by step!

    Having a little Python and pandas experience will be helpful for this tutorial, but it's not strictly necessary. You can sign up and try our interactive Python for beginners course for free.

  • Python JSON pretty print – Linux Hint

    JSON (JavaScript Object Notation) is a widely used format to store the data. It is used to exchange data between servers and software applications, i.e., web application, mobile application, etc. Python provides a built-in JSON module to perform JSON related tasks.

    The Python object (i.e., list, dictionary, tuple) can be converted into JSON. We use the dumps() function from the JSON module to perform this conversion. Whenever the Python object is converted into a JSON, and if we print the converted JSON object, results will be displayed the same as the Python dictionary. The JSON pretty print refers to display the JSON object in a good format and presentable way.

    This article explains the JSON pretty print concept with the help of examples.

  • Python pass statement – Linux Hint

    Python is an effective programming language to get things done in an absolute manner. It provides many built-in modules, statements, and functions to perform various specific tasks. The pass statement in Python works in the same way as a placeholder does for a text field in a web form. It plays the same role as a null play in any programming language. When the Python interpreter executes the pass statement, nothing happens. It is useful to place a pass statement when we syntactically require a statement and do not want to execute it. As its name suggests, it passes the control to the next statement.

    The main difference between the comment and pass statement is that the Python interpreter completely ignores the comments, whereas, the pass statement is not ignored. This article explains the use of the pass statement in detail.

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.