Python string concatenation: + operator/join function/format function/f-strings

Python string concatenation: + operator/join function/format function/f-strings

This time, I will introduce the method of string concatenation in Python. Here, the Python version is assumed to be 3.x. Concatenate with ‘+’ operator The simplest way is string concatenation using the + operator. Some programming languages ​​don't support string concatenation with the + operator, but Python has no problem. 1a = 'aaa' 2b = 'bbb' 3c = 'ccc' 4txt = a +
Use Range function in Python

Use Range function in Python

Python has more utility function implementations than other programming languages. This time, I will introduce the for statement processing using the Python range() function. Environment I have confirmed the operation in the following environment. Python 3.8 range() function is A range () is a Python built-in function used to create a sequence of numbers and mainly used in combination with the for statement. Takes several arguments to control the rules
HTTP requests in Python3 with Requests library

HTTP requests in Python3 with Requests library

In past article “HTTP requests in Python3 with urllib.request module", I wrote simple code samples for HTTP requests with urllib.request module which is a package in Python. In this article, I introduce Requests. What is Requests Requests is a package for HTTP request. Requests is a human readable package for HTTP request with wrapping urllib. It has a simple interface and supports lots of feature as follows. International Domains and
HTTP requests in Python3 with urllib.request module

HTTP requests in Python3 with urllib.request module

In this article, I introduced how to use urllib.request module to request with HTTP in Python. Environment Runtime environment is as follows. python 3.7 Ordinal HTTP request HTTP GET request with an Request object Use Request object included in urllib.request module. Create Request object instance as follows. 1from urllib.request import * 2 3req = Request(url='https://docs.python.org/ja/', headers={}, method='GET') Access to Request object property. You can see the host information and path
Use PyPDF2 - which PyPDF 2 or PyPDF 3 should be used?

Use PyPDF2 - which PyPDF 2 or PyPDF 3 should be used?

Introduction In previous article, we can extract text on a PDF file using PyPDF2. Use PyPDF2 - open PDF file or encrypted PDF file Use PyPDF2 - extract text data from PDF file I will introduce PyPDF3 in this article. PyPDF2 and PyPDF3 exist When I looked for various usage of PyPDF2, I found the follwing commnet in StackOverflow. The PyPDF2 has been stopped since 3 years ago?! And, new
Use PyPDF2 - extract text data from PDF file

Use PyPDF2 - extract text data from PDF file

Introduction In previous article titled ‘Use PyPDF2 - open PDF file or encrypted PDF file', I introduced how to read PDF file with PdfFileReader. Extract text data from opened PDF file this time. Preparation Prepare a PDF file for working. Download Executive Order as before. It looks like below. There are three pages in all. Accessing to pages Accessing to arbitrary page The following code describes accessing the specified page
Use PyPDF2 - open PDF file or encrypted PDF file

Use PyPDF2 - open PDF file or encrypted PDF file

Motivation Since I want to work PDF file with Python on my work, I investigate what library can do that and how to use it. Preparation The runtime and module version are as below. python 3.6 PyPDF2 1.26.0 Install PyPDF2 To work PDF file with Python, PyPDF2 is often used. PyPDF2 can Extract text from PDF file Work existing PDF file and create new one Let's install with pip command.
Recommended IDEs or code editors for Python beginner

Recommended IDEs or code editors for Python beginner

Motivation My colleages who are Python beginners often asks me my recommended Python IDE. After hearing what they'd like to do with Python from them at first, I suggest one of several IDEs or code editors. In this article, I will introduce Python IDEs and code editors use cases. What is an IDE ? An IDE is an abbreviation for Integrated Development Environment. We have several steps for developing source
Use openpyxl -  Convert to DataFrame in Pandas

Use openpyxl - Convert to DataFrame in Pandas

Introduction Previously, I wrote several articles on working Excel files using openpyxl. Use openpyxl - open, save Excel files in Python Use openpyxl - create a new Worksheet, change sheet property in Python Use openpyxl - read and write Cell in Python In this article, I introduce how to convert openpyxl data to Pandas data format called DataFrame. Preparation Install modules First, install module with pip command. pip install openpyxl
Use openpyxl - read and write Cell in Python

Use openpyxl - read and write Cell in Python

Introduction In previous article, “Use openpyxl - create a new Worksheet, change sheet property in Python", I introduced how to create a new Worksheet and change Worksheet properties. In this article I show how to read and write Cell in Excel with Python. Enter values to Cell Worksheet object has a position of Cell as property. That is dictionary type and consists of row and column number. Using them, access