Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
Python Tutorial
File 70 codes
Home
Python Tutorial
File
1 A file iterator
2 Access Modes for File Objects
3 Accessing Each Word in a File
4 Adding Files to a ZIP File
5 Closing a File
6 Create a subdirectory in our temporary directory
7 Create a test file with two lines and verify that the file has been created by listing the directory again afterward
8 Creating a TAR File
9 Demonstrates reading from a text file
10 Determining the Number of Lines in a File
11 Exception you are anticipating
12 Extracting a File from a TAR File
13 File Read and Display
14 First Python Programs
15 Function that tries to read a file and return its contents
16 Get full path
17 Get the longest line
18 How to Open a File
19 Listing Directories
20 Listing Directories with glob
21 Module Attributes to Aid in Multi-platform Development
22 Move around within the file using seek()
23 Open a file and save text to it
24 Open a file for reading
25 Open a file for writing
26 Opening a File and check its mode
27 Opening a Nonexistent File
28 Opening and writing to a file
29 Os and os path Modules
30 Os chdir(path) changes the current working directory
31 Os path abspath(path) returns a string version of the absolute path of the path specified
32 Os path module provides exists(path), isdir(path), and isfile(path) to check for the existence of files and directories
33 Print to a file
34 R is the default processing mode
35 Random accesss file
36 Read a file line by line with a while loop
37 Read all lines
38 Read bytes into a buffer
39 Read entire file into a buffer
40 Read line by line
41 Read lines into a buffer
42 Read with index
43 Reading a File
44 Reading a Single Line from a File
45 Reading and printing a file
46 Reading and Writing
47 Reads a plain text file
48 Recursively Deleting Files and Subdirectories
49 Redirecting the Output Stream
50 Remove file if the new name already exists
51 Renaming Files
52 Retrieving Files from a ZIP File
53 Searching for Files Based on Extension
54 Simple Unicode String Example
55 Splitting Pathnames
56 Storing and parsing packed binary data in files
57 Storing and parsing Python objects in files
58 The print file Extension
59 The stat Module
60 Turn file content to list or tuple
61 Use the max() built-in function to get the longest string length
62 Using Iterators with Files
63 Verify that tmp is a valid directory and change to that temporary directory, call the getcwd() method
64 Walking the Directory Tree
65 Working with Directories
66 Write a list to a file
67 Write lines
68 Write(string)
69 Writing to a text file
70 Writing to Files