Navigation

  • index
  • next |
  • previous |
  • PyHowTo: 1798 tasks and 2296 solutions »
  • Basic »

Table of Contents

Python v3.7 HowTos:

  • ------ Algorithms ------
  • Recursion
  • Backtracking
  • Dynamic Programming
  • Greedy
  • Sort
  • Binary Search
  • Depth First Search [DFS]
  • Breadth First Search [BFS]
  • Binary Search Tree [BST]
  • ------ Structures ------
  • Array
  • String
  • Heap
  • Stack
  • Queue
  • Tree
  • Linked List
  • Hash Table
  • Bit Manipulation
  • Two Pointers
  • Math
  • Decorator
  • -------- Tutors --------
  • Basic
  • Intermediate
  • Advanced
  • Interview
  • ----- Applications -----
  • Spark
  • Tkinter
  • Turtle
  • Games
  • Web
  • -------- About ---------
  • About
  • History

Previous topic

Combine two dictionaries adding values for common keys

Next topic

Read an entire text file

Quick search

File_I/OΒΆ

How To: Basic::File I/O

  • Read an entire text file
  • Read first N lines of a file
  • Append text to a file and display the text
  • Read last N lines of a file
  • Read a file and store lines into a list
  • Read a file and store lines into a variable
  • Read a file and store lines into an array
  • Find the longest word(s) in the file
  • Count the number of lines in a text file
  • Count the frequency of words in a file
  • Get the file size of a plain file
  • Write a list to a file
  • Copy the contents of a file to another file
  • Combine lines of 2 files
  • Read a random line from a file
  • Assess if a file is closed or not
  • Remove newline characters from a file
  • Implement a group_by_owners function
  • Copy text file by using buffer
  • Copy binary file by using buffer
  • Interactive copying to the text file
  • Implement a group_by_owners function
  • Accept a filename and print the file extension
  • Check whether a file exists
  • Get the path and name of the current file
  • List all files in a directory in python
  • Get an absolute file path
  • Get file creation and modification date/times
  • Sort files by date
  • Get a directory listing, sorted
  • Check if a file path is a file or a directory
  • Get the size of a file
  • Extract the filename from a given path
  • Divide a path on the extension separator
  • Retrieve file properties
  • Find path refers to a file or directory
  • Make file lists from current directory
  • List home directory without absolute path
  • Find files and skip directories

Navigation

  • index
  • next |
  • previous |
  • PyHowTo: 1798 tasks and 2296 solutions »
  • Basic »
© Copyright 2020, Sergiy Zaytsev, szaytsev@hotmail.com. Created using Sphinx 2.3.0.