python unit-4 aktu
python unit-4 aktu
sfles heptoskse
dob&, onoge efe
fnfomatron lie ent,
Tluse
by lieet.
le CUe esd to
en3- rctiary tles
oe nßoma'en feb
fnclucle a mofeacd,
pnb, puog samming oppliattss.
Dlesrlosy Fes -
Dier toy 6fles wce mohlnq but a Plare/auta
cleteils ok 6les
oee
/
It Confoins clutuily abaut srle nanes,
slasud.
Ble sie end re cshun Oonshls
CUee Coecté cnel
logt mec'ßeol.
Deule flles -
Deuce files etee clso
csskeeial
calloel
Thuy Ce cwatd ky tilea.
opeeaHng dy skm
atv'ch
enel h cetol
wCulee
U'te D oihfe,
Pledtecs. ete.
buc
Lsee acl.Py
For
Point lre ( )
CS
At ead Py
oacttng a He olh oben (J
my file = cpen ("ami ly clickínson.bit "y
CS
Pn a fle.
==
fre chen (t my lee text " )
#\h s plac eal 4o fndceite
EOL (Ened of, Lne)
ftle i oik (etHello\n")
flei osik
ltns(L)
fflel. clo6el) #
to chonge le aces no oles
fMe Lo open
(my Gfle teat ",
Potnt (ee "t")
Qutput oh Raad funcHon i")
Pofnt
Point
Pofnt (e,
Gutbit
)
(Qutput of Rsad lfne
(fle. suaol tfne ())
point
#6shosseak(o)
ottne
Read (a) of
hluo caol
funeH'sn
end
")
(e suadl
line.
pint (Fled. funeh'ena")
sad (9))
Psint ()
Fle 4 Seek
Pofot
(0)
(toutbut
fotot (fPlej.
of suad re () func Hi'on s ")
uecl|fne
(9))
CS
Ait
Point (fle
files. clo6e
.
Cutfput
l)
of
od|fnes
Reuad l'ns
()
U)
funclien ú ")
utput s
Outbut of Read fur Han u
Hello
Thii w, Delu'
The i Paus
Tus is
loncdon
(Qutp ut of Rsadtfro
Hello Fune Hsn i
Out þut of
Hello suadlq) funeHon
ui
Th
(tbut of cuocl
Helo Ifre (9) une trun
(lutput oß Rieel tinus
funcken i
lon alen
|n']
CS
Flnely Gloneting suacl finetendy suade). only
elteadl'ne(),suactl inus(): d
-(0e of! oork on de
cißount tile opeoHons Fo
hen
6fles en m
lee to guad a file, wte to affle, olelete
ohexaf'ors
Guating|Aaottng
-wee Cuee Ldating Dele Hror
umeeces ateess
Uaeusus ye o mocles qot
oben gfie . Obewatorns
pasible fn
honelles
dhe
- IT
fnocats ho0 en oben eol
Vaweus 6le efll
coill be
tile tca)
.Tee mo cles culso
pestc Hesrs.
@ Take
bmput fromdnat
Gte /wsie
Close de fle cutpt to tlutfite.
CS
pesatsns,
d nly ()& no dde s leel to p en de text
e eael conly atCc
CS
m 2
le
t_e
nothuy
fevt
apbenc end eead aCe es mo ole
Cber dle sfle Bor ua ol'ng an
The
Orfen.
Oik'ng.
otcete
Comn on ceacl
• l-7es mo ele fnouteite
mocles
cdueet
fe es,f
Bfle
for cuacUry sny.
off be opern
Prourte due Bele
for wsttng cwfl ke gben
nly.
ea1Tuii mocle lholiete
dhut dle elput o
Puviau cutßut aPenel to de
CTus mocts fnottete dhct
sle well ke
ben for boto eaolng
anol oflng.
Cs
C
/hene/ Fmstfoz/cocle
Ant_le - optn (le
ent
y) ()
Anothey method using ul locah'sn
evt le2= chenlhome lotoz Ile.tt!'s)
Print ( First Nethoct')
pint (tenL Flle )
Aint (Seoord Hethocl')
point
(kntFile2 )
aublbuts.
flast Hetoc
Seconol Metho
>
cs
o{le llrus-The faneh'sn wifeo a clt
attemp.
E=
Hi Rhuh
RESTART:/Uses/
khushi/Desthob suad-
flef
T amhe
>>
The
ee leaJuelan
sle cssocltshell attermpt
to sua
Gllols, Fotodhe
wwh h Oben Bile
nbyte foom
CS
le Value o mbyte cs gualuy ha) ()
on empiy
emptey Ppe o
ceeacl ()Shele suten 0to fnoUrate enel
If sone A0ress hod dhe
NoNBLOck s ppe oben fr
wt,eecl () Sh ll Sulun -1
nel eng
to
[EAGAINJ etono
shen
cttem
Sloc king
duacts encl has
no clato
Tf Q cuceenty
set NoNBIOCk u Cnculabte:
euno to l,esrecll) shall
[EnGAINI. suteon-lone
TfONON Blok
clec)
isuod unlll acl() shell
Veone clto bt cames bloc* dhu olln
avaulab le.
. React tinsl]
ReciollPne
Qne Complete
() sa
mehed fPle
dhd helps
le gtven 6e'le.eua d
lo
tine foom
T has o foaWng
Utng
muolne
ulunel.
(ln) de ere
by cllfuult, le entise
luteentel.
eu totll b,
.nis
Testy ihel
Tes tHy
Tes H'y
ll'ne
faurth line
frh (lne
Sutaclino (Ts tinag-f
9iven
Sle
»lsiny open () muthe
my flie open (
ny lne my ffle. Jueel1fne )
CS
Ahus
uaclfnes
): J muthocl eelnso lúl (onlalinq
13
CULLO letunol.
aremty Valus
wnt
Hon $- Ob tional.T
Desco
Enample
CS
yee to losfk, cleto to c fFle Thc's Funeh'en to
O Shing as npt
JEreibied f'le
- Tle wik () veuy veHSctle enel Can be
henetihy
wcokIy oih ite Fo
Pydhen.
Syniang
Afle -
Pematuy Valu
wí t (byt )
Peamituy- byt
Cromple
f= open(elsmofle 2.4at",""a")
foik (lnSesyu Soon !")
(olse ()
t oþen end u acl due file aktey dee
f
o}en(etelenoflle2-tt")
Psfnt Cra suacd())
") ppeneig:
CS
t Oo king o (oelfne functfsn
- The uStt ofstotngs
of. pass eol to dhe lorikeit
of
W'st
mocle o
stofngs to
dne Bile.
dhe tle elatnoltny &n de
lel's ta ke e
he luok et cUfsuntmocles
ffle.
Ble o|) be
e
PnpH'ecl Fhrst
trts wil ke
Placed t due
encl hen de
Ateuarn Cwount
bosH'orn tle
Arst stafng = PCHello"
Secend
thind
stfng
foussh
stfng
=
-L
tLernig
"Rgthon
Pull stoing =rst sting
no - frle
ohen
fouoth_ sting
(JAythen
,
Stcond sting,
thrd.
fitstoing J
staing,
tesoriteIfnu olmoFtle«tht
ffle.clo6e
()
Hellowol !1 am leeru'ng- f4thoD
CS
ts) Manipalattrg ffle poirter usng
oielln.
avamety;
Offset:- Numby of AsiW'ans to move foLoro.
From. wtetg- Tt ebtns peint of geune.
Retn ue Ney absolate posi'or.
Retuns &-
Ie sonte þaint s aleeleel by he rom What
Cugumunt.
0:- sels dhe suguune paint atdche bagfnnu'ny of
dhe Bi e.
CS
to clemn clyat
prat (Peodlthe ()
(tput
20
-
hen have fo enplau
ut ,it $-ba d:
cS
(1)
- The Conknt o% de
its Cuatos who su sies ave
atiny u
elipinol
fe:
y
by eslng he commanols Roviclr d by he
feva Hing ystm
Thes
6le
It
obeva r'on
ayskm
de
. s eol
mo At wiclely
to ceate
el
a ßile
foratr 'oo
fn the
Ohen chevsion; -
on dhe file.
Hetetetfercttruta ffet
-1 tlly dhe opeuasing dys lern o ovoke
e oben dyskm Cole onc paSE dhe fle
nmu o che fle aystm
Loit opevaHsp8
nto
Re- slien
po
Sek chevaon:
Painlr
Penty An
om dhe
cll s posieons dhe
Cwsunt pasiti en oa
Alle
seguitmurt.
ODette ohewetteo
Oele ting lo brle co m6t only llute all deas
fnsfole due Btle
Luncate choumten;
cluitng