---
title: "Discussion on \"Python Cheat Sheet\" | Hashnode"
description: "Discussion on \"Python Cheat Sheet\". [File manipulation] Context manager\nwith open(\"welcome.txt\", \"r\") as file:\n    # 'file' refers directly to \"welcome.txt\"\n   data = file.read()\n\n# It closes the file automatically at the end of scope, no need for `file.close()`.\n\n[File manipulation] W..."
url: "https://hashnode.com/posts/python-cheat-sheet/609de83f47373d4cb05623f0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Python Cheat Sheet](https://lam.hashnode.dev/python-cheat-sheet?utm_source=hashnode&utm_medium=feed)

\[File manipulation\] Context manager with open("welcome.txt", "r") as file: # 'file' refers directly to "welcome.txt" data = file.read() # It closes the file automatically at the end of scope, no need for \`file.close()\`. \[File manipulation\] W...

May 14, 2021 · 2 min read · lam.hashnode.dev  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#cheatsheet](https://hashnode.com/tag/cheatsheet)

## Written by

[Hoang Lam](https://hashnode.com/@lamhoang)

@lamhoang

  
[View profile](https://hashnode.com/@lamhoang)

Django

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
