How to Install packages from command line and Dockerfile with Chocolatey
Introduction We will introduce a Package Manager for Windows: . In automations…
February 13, 2021
with open(filepath, 'r') as file:
data = file.read()
Above code read whole file at once, but if the files have multiple lines, the result string will have new line characters as well.
This code will gets you a single string as whole content
with open(filepath, 'r') as file:
data = file.read().replace('\n', '')
This code will gets you a single string as whole content
with open('filename') as f:
lines = f.readlines()
Again, this will give new line characters
with open('filename') as f:
lines = [line.rstrip() for line in f]
with open(source_file) as f:
lines = f.read().splitlines()
The best way to open file is with with
keyword, as you do not need to close the file explicitly. It will take care of closing the file handle.
Introduction We will introduce a Package Manager for Windows: . In automations…
Introduction In this post, I will show how to validate your json schema…
This is due to our web server are configured to deny accessing this directory…
Introduction In this post, I will show several ways to use conditionals while…
Introduction In this guide, We will learn about branching, handling conflict…
Introduction In this post, we will see Python 3.9.x patch for FIPS enabled…
Introduction Strapi is a backend system provides basic crud operations with…
Introduction I had to create many repositories in an Github organization. I…
Introduction I was trying to download some youtube videos for my kids. As I have…
Introduction In this post, we will explore some useful command line options for…
Introduction In this post, we will see how we can apply a patch to Python and…
Introduction We will introduce a Package Manager for Windows: . In automations…