File Handeling Python Basics Notes
File Handeling Python Basics Notes
Nent N l , .
Sut
piles qsteite
Re contte etentii
t t cY CsV
a Cuna
-fleobeetiane
Pirstpie =
Thabne sttmetfe
Seloole
attela it to fie oitane
nd
-Pistte.
(Pile tane, mde
&compte
Teealnglel beCase
" eFle2 tot' mole aettcles
otjceta Piotfle2
open
Siye
slahagtau belau
meeni sbecd foatn
use yo
slane nrtied
= P
ttnt ft
iy miirne Now
icle wnmle
and en
tt Rfle
at
)
ofeni -ple
dirtr5.
NowC Cunewr
that inmplis t t nocfecl
attcltony chorty.
lat t f i l e an k. The Al
t
o fpeet .
a tenbe
FleAccn
Test Bins Der. sht Remls
-1bin
Noole Node
\
tnefiledoesntt
\wb oeae
tiucate asstindete
Orwte iut .
lab
3Aleoosnteist
na.
Tert Ginary DecriRenar k
Hoole
OElemust e i t
read
tye
whi
nateolbte
-pilei unees
t eadint
lat peaee.
ate'e
The e i . ata
new lata i'stde
wi
clarel)
Ktra,
r Ta ba coletrt clea, uf
- sHbitt clasneR eleane s
The neali) /
Methac
The 1es C)methol is ue
to st
alrey
.
Ja t most
19 not specifhel
(entire tile)
Cmtetot
Calar te myfFl,.tt
-fe eomple colo, ne
anl it onet m
Yeacl C), reeineC)esllin
Hello Al, + Line 1
+ in 2 blenc
Leaniyeliy # Lins
Htty
.
ctput
Hello A,
|A| Read, pri
F t ioearatey
tnethd at
(9)
-Pile = oa ("MyfF4tot"n)
C)
pnt (" FiotLie:',ieeli
Ont (" Second ine :,it.eidline ()
ont(Thhel i':",lnerdineo
print )
ile.cse)
Rtt N: Hello A ,
Secumd ne :
a
After resliny elihe( metel
Weiny Creauto mtice panes
e
to ets
netlie
giltt
pnit (aie)
fclo
otput
Hello Ael
wih egwvd
prit(ain)
Wntigmti RemarlC
wmteinj)Rlefaly.nties9
A lin to
vetinig
T CCate a hew
feagtt tcatig/
to an essti
iny wtt male (h)
(b) fle
inhut(ner Naneofste)
name =
ntt(name)
|.close c) ot de!
Ste Nbne Jnts
&ntk Name ot tdent: Shai
Roe
shoi o4 res prorom
Stdenttxt -Note
Edt
vdlJonty SmitRoeMsy
hotdd ect
Now if
hdentH tat' w")
input(s):
(9&atr Nameouttokt
nane =
fl· wnk(hane)
stdentl. bot-Nota
Davd
Jnt
Smi
Ek Noeolctuolent: Daid
Jonty
tudent Smit
Nane otuctnt
SntrNane at
rne
Mehd:
ntiny c) me
characeso
nelie
nt add
hehe
Now Cunsilar ee
cet tot w)
LI = Di
name (nputCentdentnbme:)
LI:ppnd (namet\h)
buth. out in
sterrye e actu
im leiaa
late
ony iy Ch
functin: Elsh
pece) sidered
hi not (Plea
Do
RaR
stenttot-Notip
tudet et
Nane:eretudent
icl
fl:uteline,
(LI)
fl= t
ose("Myfosns )
tt "a) Nn
1
cR
VCont=
file ce
'e' o u 'A',
'E', ´0,'U'I]:
V-Count V Count +}
ebe:
C_Count+}
V_Coun)
prin
d taiis,
outo
we
9
O the stnb) emig yie
CTRaii Rud )
ColeEompe
EuL \h choeter
9n)
line nstnip( )
piclee)
Renmvig leaing tt)
fl= (
lie= einstip )
in=
clo)
last la ot dat
Sunle iny
butkocl i nt he
Gthn
Kle fointer tel he cure boii
|n
wl tyce plae.
sumethy fo
ertintycy tlace t
Othi pnter
hum
telle)
nany leti.
pieoit.Ser(otset ee)
he
offset te tinr ottet
s}
Refee poti
: start ot
teel ) methl Getm
e t bsitim of in. T
t ot Aie.
fieosjet: tell l )