diff options
| author | Rishi-k-s <rishikrishna.sr@gmail.com> | 2023-01-09 06:04:04 +0530 |
|---|---|---|
| committer | Rishi-k-s <rishikrishna.sr@gmail.com> | 2023-01-09 06:04:04 +0530 |
| commit | f0396957c49c27d7bae5dd0645f0e05705d1a86b (patch) | |
| tree | d22df1d701cbc29c708406a532dcb02b5ebe0012 | |
| parent | 7a7f6e466286993318dadfc3a8f5281b835cbd2d (diff) | |
model
| -rw-r--r-- | File Operations (CH2)/oomidat.dat | bin | 0 -> 43 bytes | |||
| -rw-r--r-- | File Operations (CH2)/toReadEachWordTEXT.py | 20 |
2 files changed, 14 insertions, 6 deletions
diff --git a/File Operations (CH2)/oomidat.dat b/File Operations (CH2)/oomidat.dat Binary files differnew file mode 100644 index 0000000..d603fdd --- /dev/null +++ b/File Operations (CH2)/oomidat.dat diff --git a/File Operations (CH2)/toReadEachWordTEXT.py b/File Operations (CH2)/toReadEachWordTEXT.py index f2983b6..bab0deb 100644 --- a/File Operations (CH2)/toReadEachWordTEXT.py +++ b/File Operations (CH2)/toReadEachWordTEXT.py @@ -1,7 +1,15 @@ -file_handlr = open("D:\School\File Operations (CH2)\school_Dat.txt","r") -line_list = file_handlr.readlines() -for each_line in line_list: - seperateEachWords = each_line.split() - for each_word in seperateEachWords: - print('{} # '.format(each_word), end='') +import pickle + +file_handlr = open("D:\Dev\python\Testing_School\File Operations (CH2)\oomidat.dat","rb") + +try: + for i in file_handlr: + print(i) + print(pickle.load(file_handlr)) +except Exception as e: + print(e) +# for each_line in line_list: +# seperateEachWords = each_line.split() +# for each_word in seperateEachWords: +# print('{} # '.format(each_word), end='') file_handlr.close()
\ No newline at end of file |
