Syntax that Perl users tend to forget in Python

Split with regular expression that opens by specifying the character code

import codecs
for line in codecs.open(file, 'r', 'utf8'):
  arr = re.compile(r' ?= ?').split(line)

Chomp

str.rstrip()

Sort Dict (hash) by key

for k, v in sorted(dic.items()):
  print(k + ' = ' + v.rstrip())

Recommended Posts

Syntax that Perl users tend to forget in Python
Python list comprehensions that are easy to forget
To flush stdout in Python
Python notes to forget soon
Login to website in Python
Speech to speech in python [text to speech]
How to develop in Python
Post to Slack in Python
How to test that Exception is raised in python unittest
Processing of python3 that seems to be usable in paiza
Five useful Python data types that are easy to forget
[Python] How to do PCA in Python
8 services that even beginners can learn Python (from beginners to advanced users)
How to collect images in Python
Convert files written in python etc. to pdf with syntax highlighting
Regular expressions that are easy and solid to learn in Python
How to use SQLite in Python
How to use functions in separate files Perl and Python versions
How to judge that the cross key is input in Python3
In the python command python points to python3.8
Compiler in Python: PL / 0 syntax tree
Try to calculate Trace in Python
How to use Mysql in python
How to wrap C in Python
How to use ChemSpider in Python
6 ways to string objects in Python
How to use PubChem in Python
How to handle Japanese in Python
An alternative to `pause` in Python
Add syntax highlighting for the Kv language to Spyder in the Python IDE
How to write the correct shebang in Perl, Python and Ruby scripts
I made a web application in Python that converts Markdown to HTML
A memorandum of how to write pandas that I tend to forget personally
[Introduction to Python] How to delete rows that meet multiple conditions in Pandas.DataFrame
I tried to develop a Formatter that outputs Python logs in JSON
I tried to implement PLSA in Python
[Introduction to Python] How to use class in Python?
Try logging in to qiita with Python
[Python] Use pandas to extract △△ that maximizes ○○
Install Pyaudio to play wave in python
How to access environment variables in Python
I tried to implement permutation in Python
Method to build Python environment in Xcode 6
How to dynamically define variables in Python
How to do R chartr () in Python
Pin current directory to script directory in Python
[Itertools.permutations] How to put permutations in Python
PUT gzip directly to S3 in Python
Differences in syntax between Python and Java
Send email to multiple recipients in Python (Python 3)
Convert psd file to png in Python
Sample script to trap signals in Python
I tried to implement PLSA in Python 2
To set default encoding to utf-8 in python
Decorator to avoid UnicodeEncodeError in Python 3 print ()
How to work with BigQuery in Python
Log in to Slack using requests in Python
How to get a stacktrace in python
How to display multiplication table in python
Easy way to use Wikipedia in Python
How to extract polygon area in Python