close() , flush() , fileno() , tell() , seek()

8 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€43.37
List Price:  €60.73
You save:  €17.35
£37.15
List Price:  £52.01
You save:  £14.86
CA$68.64
List Price:  CA$96.11
You save:  CA$27.46
A$77.27
List Price:  A$108.19
You save:  A$30.91
S$64.28
List Price:  S$90
You save:  S$25.72
HK$392.43
List Price:  HK$549.43
You save:  HK$157
CHF 40.88
List Price:  CHF 57.24
You save:  CHF 16.35
NOK kr505.11
List Price:  NOK kr707.20
You save:  NOK kr202.08
DKK kr323.61
List Price:  DKK kr453.08
You save:  DKK kr129.47
NZ$83.70
List Price:  NZ$117.18
You save:  NZ$33.48
د.إ183.58
List Price:  د.إ257.03
You save:  د.إ73.45
৳6,117.18
List Price:  ৳8,564.54
You save:  ৳2,447.36
₹4,329.21
List Price:  ₹6,061.24
You save:  ₹1,732.03
RM212.58
List Price:  RM297.63
You save:  RM85.05
₦77,489.99
List Price:  ₦108,492.19
You save:  ₦31,002.20
₨14,192.58
List Price:  ₨19,870.74
You save:  ₨5,678.16
฿1,638.44
List Price:  ฿2,293.95
You save:  ฿655.51
₺1,983.26
List Price:  ₺2,776.72
You save:  ₺793.46
B$275.58
List Price:  B$385.84
You save:  B$110.25
R928.44
List Price:  R1,299.90
You save:  R371.45
Лв84.79
List Price:  Лв118.71
You save:  Лв33.92
₩68,644.45
List Price:  ₩96,107.73
You save:  ₩27,463.27
₪174
List Price:  ₪243.62
You save:  ₪69.61
₱2,858.02
List Price:  ₱4,001.46
You save:  ₱1,143.43
¥7,303.78
List Price:  ¥10,225.88
You save:  ¥2,922.10
MX$958.51
List Price:  MX$1,342
You save:  MX$383.48
QR182.42
List Price:  QR255.41
You save:  QR72.98
P674.14
List Price:  P943.85
You save:  P269.71
KSh6,458.70
List Price:  KSh9,042.70
You save:  KSh2,584
E£2,530.13
List Price:  E£3,542.39
You save:  E£1,012.25
ብር6,878.14
List Price:  ብር9,629.95
You save:  ብር2,751.80
Kz45,588.63
List Price:  Kz63,827.73
You save:  Kz18,239.10
CLP$47,048.58
List Price:  CLP$65,871.78
You save:  CLP$18,823.20
CN¥358.92
List Price:  CN¥502.52
You save:  CN¥143.59
RD$2,963.35
List Price:  RD$4,148.93
You save:  RD$1,185.57
DA6,512.08
List Price:  DA9,117.43
You save:  DA2,605.35
FJ$112.97
List Price:  FJ$158.17
You save:  FJ$45.19
Q384.42
List Price:  Q538.22
You save:  Q153.80
GY$10,464.40
List Price:  GY$14,651
You save:  GY$4,186.59
ISK kr6,183.97
List Price:  ISK kr8,658.05
You save:  ISK kr2,474.08
DH456.53
List Price:  DH639.18
You save:  DH182.65
L855.33
List Price:  L1,197.54
You save:  L342.20
ден2,670.68
List Price:  ден3,739.17
You save:  ден1,068.48
MOP$404.42
List Price:  MOP$566.23
You save:  MOP$161.80
N$903.08
List Price:  N$1,264.38
You save:  N$361.30
C$1,840.71
List Price:  C$2,577.14
You save:  C$736.43
रु6,928.21
List Price:  रु9,700.04
You save:  रु2,771.83
S/179.61
List Price:  S/251.47
You save:  S/71.85
K209.12
List Price:  K292.78
You save:  K83.66
SAR187.57
List Price:  SAR262.62
You save:  SAR75.04
ZK1,170.24
List Price:  ZK1,638.44
You save:  ZK468.19
L218.20
List Price:  L305.50
You save:  L87.30
Kč1,076.69
List Price:  Kč1,507.45
You save:  Kč430.76
Ft17,461.26
List Price:  Ft24,447.16
You save:  Ft6,985.90
SEK kr483.31
List Price:  SEK kr676.68
You save:  SEK kr193.36
ARS$58,147.71
List Price:  ARS$81,411.45
You save:  ARS$23,263.74
Bs345.61
List Price:  Bs483.89
You save:  Bs138.27
COP$204,109.71
List Price:  COP$285,769.93
You save:  COP$81,660.21
₡25,251.71
List Price:  ₡35,354.42
You save:  ₡10,102.70
L1,306.33
List Price:  L1,828.97
You save:  L522.63
₲399,225.98
List Price:  ₲558,948.33
You save:  ₲159,722.34
$U2,045.13
List Price:  $U2,863.35
You save:  $U818.21
zł185.69
List Price:  zł259.98
You save:  zł74.29
Already have an account? Log In

Transcript

Hi and welcome back. In this part I am going to tell you about how what is the uses of close flush File Number A seek tell so let's start in my previous video I already told you about read read line and write is add by next. So in this video I will cover all the remaining file optic methods. So let's begin open idle Firstly, I'm going to perform file number operator as a call to obtain Hello dot txt print F dot File Number sorry, file number and close the file. I use it many times how to close a file but just to use this sentence I've taught close it will close the open file, a close file cannot be read or write anymore after this hold on hold on script finish. Now run the script.

Let's check out what is the value of file number three the value which are shores here three is the represent InDesign file descriptor and that is used by the underlying implementation to request IO operations from the operating system. Okay. Let's discuss about tell operator mostly tell operator is used to tell us data file objects position is from the beginning of the file in the forms of bytes C, it will definitely show the output zero because it tells that the file position is zero as in the beginning. And suppose if you want to copy file a two file P and the cursor position must be at beginning of The file a to copy hold sentence to the copy and file B. So this function is mostly used at the time of copy operation. Now I'm going to form flush method.

Blanche marker is basically used to flush all the internal buffer like acid useless. It has no return value, close automatically flushes the data, but if you want to flush the data before closing the file, then you can use this which I'm going to tell you right now. This right flush and this way, I flushed the internal buffer of that fight. No, I competed with claws flourish violin was edited by next name. Let's do this two more functions seek and truncate. Again I have to open it this way which I performed No writer, print F dot seek two comma two two comma two Hello Hello it may be empty c Just open as we'll see, first I read the file till five h e l l o, then I then I move my cursor to the beginning by writing zero comma zero then again it reaches two at the beginning and again I did the file till five, correct and five Kurtzer five till five correctors.

So it printed again Hello and this way I perform how Seek method is used to change the file object position. Opposite indicates the number of words to be moved from where indicates from where the words are to me. This complete completed all this file object methods. So, till now, keep learning, keep growing and love Python and happy coding

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.