Useful Python built-in functions that you use occasionally
This article is the 19th day article of [Takumi Akashiro Alone Advent Calendar 2020](https://qiita.com/advent-calendar/2020/takumi_akashiro "ひとり Advent Calendar 2020"). ## At the beginning On Sat
Prohibit multiple launches in python
[fcntl \-\-\-fcntl and ioctl system calls — Python 3 \ .9 \ .1 documentation](https://docs.python.org/ja/3/library/fcntl.html) #### **`lock_test.py`** ```py import os import fcntl import time def
What to do if you can't hit the arrow keys in the Python interactive console
Here's what to do about a problem you've encountered while trying out some code in the Python interactive console. ## environment ```plaintext $ python Python 3.5.6 (default, Sep 28 2019, 10:29:54
I compared hardware, software, OS, and Linux with a game console
# What is hardware? If you compare it with a game machine, it is something that you can see, such as the game machine itself or the controller. Just as you can't play games with these alone, your PC
ABC's A problem analysis for the past 15 times to send to those who are new to Python
# Introduction This article analyzes ABC's A problem and is an article for beginners such as "Only if statements and operations can be used". Sometimes it spans multiple genres (eg [AtCoder Beginner
Looking back on Python 2020 around me
## Looking back on Python 2020 around me I've been in Python for 4 years, and I'm always an IoT shop affiliated with a manufacturer. Let's talk a bit about Python 2020 around me. ### Python aroun
[Cloudian # 3] Try to create a new object storage bucket with Python (boto3)
## Introduction [Cloudian](https://cloudian.com/) is fully compatible with S3, so it's convenient to use the AWS SDK! [Last time](https://qiita.com/Akanechan/items/683a5e9eed43a09993d1) tried to di
I tried to refer to the fun rock-paper-scissors poi for beginners with Python
The scene was so free that I remembered an acquaintance making a rock-paper-scissors game. # Referenced articles @ sandream's article "[Python rock-paper-scissors poi for beginners (answers and exp
Ubuntu18.04.05 Creating a python virtual environment in LTS
Created a virtual environment on Ubuntu without using Anaconda. #### environment Ubuntu18.04.05 LTS python:3.6.9 --- #### Virtual environment construction #### ① Update ``` $sudo apt-get update
[Cloudian # 7] Try deleting the bucket in Python (boto3)
## Introduction [Cloudian](https://cloudian.com/) is fully compatible with S3, so it's convenient to use the AWS SDK! [Last time](https://qiita.com/yamahiro/items/3be0fe7787a099cf8826) tried to del
[Cloudian # 6] Try deleting the object stored in the bucket with Python (boto3)
## Introduction [Cloudian](https://cloudian.com/) is fully compatible with S3, so it's convenient to use the AWS SDK! [Last time](https://qiita.com/yamahiro/items/ee1112a95185becc189f) tried to dis
Algorithm learned with Python 7th: Year conversion
# #Algorithm learned in Python <year conversion> ## Introduction Implement the basic algorithm in Python to deepen your understanding of the algorithm. The year is treated as the seventh bullet. #
Extract arbitrary strings using Python regular expressions / Use named groups
This article is the 18th day article of [Takumi Akashiro Alone Advent Calendar 2020](https://qiita.com/advent-calendar/2020/takumi_akashiro "ひとり Advent Calendar 2020"). ## At the beginning Do you
[Xonsh] The Python shell is sharp and god
I've seen some shells as part of the modification of the Mac terminal environment. bash, zsh, fish ... Especially for the last six months, I've loved Python-made Xonsh, so I'll introduce it to mys
I read "Linux standard textbook"!
 I read the Linux standard textbook! I got a general
When there are multiple Selenium SeleniumBasic classes (Python VBA)
If you want to get an element with multiple classes in Selenium ↓ There are multiple classes as shown in the example. #### **`Multiple classes`** ```python <ul class="topic-path under-menu-title
An introduction to Python's AST (Abstract Syntax Tree) starting from just one line
# Introduction This article is the 20th day article of [2020 RevComm Advent Calendar](https://qiita.com/advent-calendar/2020/revcomm). The 19th day was [@ metal-president](https://qiita.com/metal-pr
python decorator to retry
```python from functools import wraps import time def retry_decorator(retry_num: int, sleep_sec: int): """ Returns the decorator to retry :param retry_num:number of retries :param sleep_
[Cloudian # 2] Try to display the object storage bucket in Python (boto3)
## Introduction [Cloudian](https://cloudian.com/) is fully compatible with S3, so it is convenient to use the AWS SDK. [Last time](https://qiita.com/Akanechan/items/7b8a11c773106b641795) set the A
[Python] Missing rate (missing rate) Delete columns above a certain percentage (Pandas)
# background If the feature has a missing value (such as NaN), fill it with the average or 0. However, as the ratio of missing values increases, the ratio of filling with average or 0 increases, bu
[Cloudian # 1] Try to access object storage with AWS SDK for Python (boto3)
## Introduction [Cloudian](https://cloudian.com/) is an object storage device with AWS S3 compatible API. Since it is an S3 compatible API, it can be operated using the AWS SDK, but since there a
I made a familiar function that can be used in statistics with Python
## table of contents ――What made you decide to write this article --Execution environment --Average --Range --Median 1 --Median 2 (only in ascending and descending order) - standard deviation
Faculty of Quarts Department of Back Quarts (chat: Python is available)
# Overview It's a complete chat, but when debugging with Python, ** when commenting out multiple lines **, In c language, you can write `# if 0`, but you can't do that, so I think I would use ** tr
I made a pet camera that is always connected with WebRTC (Nuxt.js + Python + Firebase + SkyWay + Raspberry Pi)
# Introduction <img width="340px" alt="cat" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/215645/443bb767-fa1d-06d1-6fc1-793740509b94.png "><img width="340px" alt="RaspberryPi" src
python chrome driver ver. Solving the problem of difference
When I try to use Selenium from Python, I get an error if the version of ChromeDriver (hereinafter ver) does not match, and I wonder if there is a manual installation of the chromedriver that cries.
Make Live USB on Alpine Linux
# What is Alpine Linux It's a lightweight Linux that lets busybox do anything. Due to its light weight, it is often used as a component of Docker. GUI? I don't know. * This article assumes operatio
Exploring image filter parameters with blackbox optimization in Python Note
## background If the target function (problem) is like a black box, it is necessary to find its parameters. It seems that it is called hyperparameter optimization (search) in the field of blackbox
Memorize the Python commentary on YouTube.
Learn Python - Full Course for Beginners [Tutorial] https://www.youtube.com/watch?v=rfscVS0vtbw (Note that English subtitles are incorrect in some places.) *** 2:14 - python download https://www.pyt
Lists, functions, for, while, with (open), class and learning supplements up to the last time (Python beginners after learning Ruby)
# list #### **`test.py`** ```python list = ["0", "1", "2"] #Close to Ruby's array handling list[0] #0th"0"Is taken out. ``` # function #### **`test.py`** ```python def test(arg): return arg
Execute external commands in python (both receiving/not receiving results)
Confirmed to work with python3, MacOS and Linux. ```python import os import subprocess def exec_os_system(cmd: str): ''' Execute commands synchronously Standard output and standard error outpu