diff options
Diffstat (limited to 'Let_us_C/chapter-12.ipynb')
-rw-r--r-- | Let_us_C/chapter-12.ipynb | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/Let_us_C/chapter-12.ipynb b/Let_us_C/chapter-12.ipynb index f0567d09..a3331f4d 100644 --- a/Let_us_C/chapter-12.ipynb +++ b/Let_us_C/chapter-12.ipynb @@ -25,7 +25,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''Program to display contents of a file on screen.'''\n",
"\n",
"fp = open (\"C:/Users/Akshatha M/Desktop/carrot.txt\", \"r\" ) #open file in read mode\n",
"while ( 1 ):\n",
@@ -1582,8 +1581,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''Program to check whether a file has been opened successfully before\n",
- "trying to read or write to the file'''\n",
"\n",
"try :\n",
" fp = open (\"C:/Users/Akshatha M/Desktop/carrot.txt\", \"r\" )#open file in read mode and check if file is opened successfully\n",
@@ -1617,7 +1614,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''Program to count chars, spaces, tabs and newlines in a file.'''\n",
"\n",
"#Variable declaration\n",
"nol = 0\n",
@@ -1673,8 +1669,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''Program to take the contents of a file and\n",
- "copy them into another file, character by character.'''\n",
"\n",
"fs = open (\"C:/Users/Akshatha M/Desktop/carrot.txt\", \"r\" ) #open file in read mode\n",
"if(not fs):\n",
@@ -1714,7 +1708,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''Program to receive strings from keyboard and write them to file'''\n",
"\n",
"fp = open ( \"C:/Users/Akshatha M/Desktop/temp.txt\", \"w\" ) #open file in write mode\n",
"if(not fp):\n",
@@ -1759,7 +1752,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''Program to reads strings from the file and displays them on screen.'''\n",
"\n",
"fp = open (\"C:/Users/Akshatha M/Desktop/carrot.txt\", \"r\" ) #open file in read mode\n",
"if ( not fp ):\n",
@@ -1839,7 +1831,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''Program to write records to a file using structure'''\n",
"\n",
"from collections import namedtuple\n",
"\n",
@@ -1899,7 +1890,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''Program to read records from a file using structure'''\n",
"\n",
"from collections import namedtuple\n",
"#Structure defintion\n",
@@ -1947,7 +1937,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''Program to copy text as well as binary files'''\n",
"\n",
"fs = open (\"C:/Users/Akshatha M/Desktop/Project1.exe\", \"rb\" ) #open file in read binary mode\n",
"if(not fs):\n",
@@ -1987,7 +1976,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''Program to receive records from keyboard and write them to a file in binary mode'''\n",
"\n",
"from collections import namedtuple\n",
"\n",
@@ -2050,7 +2038,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''Program to read records from binary file and displays them on VDU'''\n",
"\n",
"from collections import namedtuple\n",
"#Structure defintion\n",
@@ -2098,7 +2085,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''A menu-driven program for elementary database management'''\n",
"\n",
"import os\n",
"from collections import namedtuple\n",
@@ -2202,7 +2188,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''File-copy program which copies text, .com and .exe files'''\n",
"\n",
"#source=input( \"Enter source file name \" ) \n",
"print \"Enter source file name \" \n",
@@ -2267,7 +2252,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''A program that illustrates the usage of ferror( )'''\n",
"\n",
"\n",
"fp = open ( \"C:/Users/Akshatha/Documents/extrastuff/skills.txt\", \"w\" ) \n",
@@ -2305,7 +2289,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "'''A program to write a file to a printer'''\n",
"\n",
"import io\n",
"\n",
|