You are on page 1of 17
ty Experiment No.|, Ht Tithe = Te understond debs con sekamanis ad nd variables fo mee. — Gasic_informahion of Python language . . SN . ‘> Python is gene ral purpose inte rprled. inhernchve objed oriented aad high level Programming language . : li G0, it hat_mang fealyres hike” 3) Simple ond easy fo wun. bs Interpreted and interarkive 7 ) Obfed oriented 43 Portable ®) Smlable 4) Extendable 4) GUT progomming and database = h) Broad “fslandand Vbrory iW) Th Works on different _pifWoem i) H hos imple quniex sfmilos to english ‘) Tt hos suntan thot allods devdopors to wyile programe with fowes lines thas other pragta mening lang yage.. i) “FE wus on interpreter system i.e, code tan bo erocukod as soon as ik written Vi Te can be freled in brecedinal Bay abyeed-_ aso nled way OF sEincional Das KIT Collegé Of Engineering, Kolhapur. (An Autonomous Institute) Noi D G..2 Ans. Information oF yariables to pisos. sits Te Clore, numesic value. the Toleqer Aaah and tomplea numbers elon thon qumbess. dala type Python provides tupec) unchion fo knom_daka yee OP variable 8.9) Q=5 poo (The tyee of a" typeco?) i) String> fined ag ence of chan Xepresented 1 Quotation marics . To We python 0 _¢09 usp gin ale double as Ariple quotes to define a-steits £.g . drs 1 Gting using ouble quoles” . 2h Coy) iii) Lists :- This similar “to arr inc Ho aover List rah contasy daha af differant type The ileme stored in tho list are Gpparated With quemma t) dod endosed within me KIT College Of Engineering, Kolhapur. (An Autonomous Institute) ose bradeots 13 eg \ckt = Tr, "hil," puthen” aj prot Ctiskt) 4) Tuple a This Gimilor to Wet in many a tuple is ; = o read ~ 60 Wa -daka -O8 we can't modify -eize and Value of thers | oy sugte s) bg tup( ", *python” 9) pnt Cty pe Uup)) O Diclonary:-Tt ts 09 unordered sot of boy-value_pairob itemg . This like agsocjative asoy Of hash table ahory _pach ‘key stores Specific value. O.g. 9: Fi!" Timmy" a+ Mex} . . print CD) . . 8)| Boolean - ty provide: hoo built fo values Troe. and flee. DS Tt ie unorderd collection ob data tipo, This iferable , mubsble and hos Yoigue elomonts - 7 bg- COs Sekt) Sela + Somes! 9,8 Python} um job ( tnput (“Enter a Mumbes’) ) nomi - for itn wonge Co num)! | if (numf,a)= so; Paint Coum , tis nat prme Pumber") breaks EIS E ( num _y, oprime. number’) z else’. KIT College Of Engineering, Kolhapur. PEM Coum, is (AncAutonemous Institute) No: & Experiment No.2. Tile = Write a pogdm to implomoant client gener io mo ——tnassage passing Progam —_—__ ____§_| Explanalion ot dient server nehdork mith a neak digs A_client_and gerver nekaAarking madel in which computers popvide, nekdork—worvites to other computers such as rlionis to perform uses bated daslas . This modal ts known as cienk corer -Dokaarting cede) . —— iz = : ry I is ‘. - Finternt 3 — a J gsreol » = : is pogrom that vee na_local machine faq destin. g =gorvice, trom carver server & Sits ° m. Madhin, providing {corvices to clients. Informalion oF all sewoer-side meth ods ycod tn OF) = ea = when calling -socdeh primitive caller creole nod fomminication, end poi Akg: foc Gnedilic 0 09904 proteco]. i) Binde) idle a \ocol odd teh Of gockel “Hindeng tell og that (Server Manis +o receive. Messages only _on the apeeified address and_port. 'T College Of Engineering, Kolhapur. (An Autonomous Institute) it t na 6 Dato: Soxver | clfeol Gockel) CeserOYD Chad) “fo bi Sieapyy—Esiablishin 9 oonecon Te tte - ay Rendsheke eso nee) (aie Creel sending dose ae t 8) Listen O°- Th to called oold. in cage o| of connection oriented Communtcalftoo W)_ accept + 4 call fo aCcObt locks the caller uoth conneckon + Bt arrives. ¥) doset + gbrver sending -elased the csone ei §.2| toformabion ot dfent- metheds used in python Ans- |) goekel() = Seever ersaling listening soke ps id connect) + Establishing cannecon three dod handshake. Wi) _gond() © client gending dato carver resgiving data iv) yeey.0) server sending dba, client receiving dato . ¥) dose) + dient gendieg Clore Message + KIT College Of Engineering, Kolhapur. (An Autonomous Institute) No. “7 oi &.s| Explonakion oF dient server nshjerk mith real diagram, Ang « "gover socker | (ang. = ; Cent Tish | € "(seeker Ff 5 acrept Establishing connedkon three. way ae dataies canine] . prec tot were frog tee; ery ree ve tre z Henk sendieg dese my 77S Slep 1 = Sener and client erate, stream sockel with gockd¢) call» step 2 z= Sever bied Socks fo local addrase with binder == al KIT College Of Engineering, Kolhapur. (An Autonomous Institute) | no: Date: Glop 3:- Saiver uses listen co!) to oléd -machine ob - Ter jae ot WU ogo ko. aceopig can oostiong fF Step Gs cient conoedds Gackeb to rssiqh host with + conned) tell: L Geps i Server septs fhe cannedioa and secéives second. | L ack ol ae : z Steps Server reads on cd s lent - “mods and Dites ak on craitai ot ond ves 6) calls y UOHI all date has been. exchange closes Gockel ad end ‘TePite coasfon wFth clastes- call_and whan again go to steps, StOp 7 - Sones closes sockol wth claceca call, Client : KIT College Of Engineering, Kolhapur. (An Autonomous Institute) No: 9 Date: Expesimeo} Nog. di| Title - Write m to _implomeot wad aod * wrike. operations ust og python. G.I pie Operahone in _python rth syptan. Ans Python too wupposts file handing and dlows userte hoodie files f-e- to read and @site Fle, along wtb mooy other file hand\ing opltons to operale on {flee _ 8) Openg) + Before parforming Any opesalion on file like nading Lond weiHng , fash we have to ppen thal + We shduld use pythons’ tobuill funehion agency _ eSyniox 2 fs open Chlename — mode) ee where the mod can be as folloWs . 88 T= Open an exising fle for -~ad operation Nw = open an enistfnq Flo for weile operaliosy it) o = Open ad existing file He oppend Speralion, iv) oe = creale coo fed: file (telus error if Bie. Gx ists) | LG — ? -veade) = + There are mere thao one Way to read file we readiig of wWytbing . in python. “tf ug need to extwoct a_steing thol conidins all chasacters to fila then Oe an use file yeode). + Sypiax t file = Open C"Bile ted.” ~) KIT College Of Engineering, Kolhapur. (An Autonomous Institute) No.: \U Date: + Another Way to ead fle ig cali coxtain oumber of choracleg womb follo@ing onde . file_= open ("file ht" v) print C file. wead(s)) By WrieO - File = open C’ geek nt, a) file. write (This Is osike command") . oC File. write C'S allows us to wWeite probeulay Fle): File . closer) 4)| desert) = : mm. in dod ot this parti qular program « B) dppende) -- Tt ig used foe manipulating contents in file - + Exoquting Aappond C) mode fae: tes sMiple me -apponds (ome Galomenk for a oumbor of Hes . 8? Geps ~for file cod and «site aposations Ros 1) Shops for ad dpesa}ion + + check file jocalion - path = " /user) prajokte} names tnt”. ' specify focetion iM Opency method. KIT College Of Engineering, Kolhapur. (An Autonomous Institute) nomes. fle = open (ilsname_, 5) | + coi the! vend method using fle_abject prvot Cna mes. file read 0) + cess the file Names- fle élasoo ) 2D steps for drite = | ‘ 2pevalion- Open the file fo weit. | file = open C mufile. txt" . wp) : + tall the rikee) method and $ass_the statng fof, file. @rite C" Hello therein") + Clase the, file. file. closet)» §.9| Proquam fx performing file operation : Ans] dith open Csample tet’ 9) aa €% F.write C "this is sample fle \o') fworite C' We are Writing to abis file. using python \o") q with open C “somple txt» yas £: dato= f. read 0 PaO C "Contents of the File’) brit Cdato) KIT College Of Engineering, Kolhapur. (An Autonomous Institute) | with 9, 2. “sample. +nh" 0") 03 Fe f.wrilte C'tbis 6 fourth line oy Sle \o"%) with open Csample ahd", 4) Os > data = f-yead 1) print C1\n_canjenjs of File oftex appending”) “punt (date). 12 KIT College Of Engineering, Kolhapur. (An Autonomous Institute) Noi 1S Date: Experimeol No, tr, at | jite = Install faiphery Pi_os_selup_aod fo understand |_faspberny Pi_pio confiquration 84 Basic _informalian ov eri Board. — Ans. | as This cheap cmdit cad sierd dowee that u seg | keyboor rwd_and mouse and soine to Ty Or COmpubor monitor. ii\T is thio Bayhtable compuber that ia ase ea ° ofall ages to discover prgramming d o |_pragyam jn yoriao language: tke python aod srodch, iy Laspberny Pi {5 span ‘ot alight wingie beded cormpalexs created @ iO kin partnership with Broadcom by the, | Baspberry Pi foun dalton. Liv) Because. at_ its [oW cot modularity aad peo Lorchitecuse_, if is mmonty sad in fmany fields |¥) To use RPI board we Obed ‘SD cad | Display ood COnne cHvity eoble keyboard dad mouse DOY option a) iphe doogie god audin lead. KIT College Of Engineering, Kolhapur. (An Autonomous Institute) to: Vy Date: §.21 wlops ot epf 05 instalalon pre cess Ags.| \S Download aod insiall @ oss Pi icnaga, From ore! os website - aa —_ 9) Dowrad Paxbery. Pi as from website ahere sevora) Bs ar available for «oledion withiq Laaphorsy Fi imag ey _, bub we Dill forus nn Caspborsy Oe 8) Chaoge gD cond - Qoled _choage_ eb CARD and ‘Golo ep cacd. thak yoo have conageled +o your eorpuler. 6) Ghewnie Os on sp card = a oo + This step will Write coleced Os +o sp card aod wun Vevificalion thal copy couc cessful st» +08 _has ned been copfed to your .sp cond ‘You ae, noo veady +o move oq +o boating. your Basp bers with S§)_Beoting @-ph ‘Insect picro- SD card folo yous Kasper pi. Ther hoot. wp fa phosry pi power - ko bord ane aod monitor. + You brought divecHy jote Lasphessy pi _Os with ae do gas pberry pi “dialog ond display + SCH! ut es : —— god Passworp soley. KIT College Of Engineering, Kolhapur. (An Autonomous Institute) 8.5 | DesesipliOn_e} all Go BPI ping. svs pact lo OL. aw powes t Gireacsoa) e—/@ OL fv poe GPTO SSC --{@ Op —— — Grvvnd | Grou Carer @ OL Gr wD | Gamued —@ @- Grasten 7 € | GPIOn 70 OL. Gero sien a _ GProe7 6 @t. GPIOoe —@ @b« 8Y3 power 1G) WEL. GPT OME) aol, Gpro g¢erssej o— BN) GL GLO UCSakp— EI G[-—~ Gund ee ee ~ GTO OCDE) Gal _ Glos 76) Gi—- GRpoan GPID 6 eA) SLs aprortennad GPEO ism) Go} Ground GIO 18 (reo. R—} é Gpra \6 GPID26 —, Gro 2o( POM. OTN) Ground, @_ G—-_ &pso91 CRH_DOVT I KIT College Of Engineering, Kolhapur. (An Autonomous Institute) no. 16 ata Recpheryy pi_3 power pins = * The board consists of hoo SV pins , wo 8V8 pins 0nd 9 qyound pios Cov) znbich are ot configusable i svithe ping divedly deliver sv Su ppt corn from maing adapkor this pio ca use fo power uP — Pas phossy pi-aod tk can also use fo powder gp vthex sv devi tes, . * 339 | The 9¥ pina _is there to offer ‘erable ga SUpAY to. poner components and to task LEDI¢ * = GWO= Ground is common) seferred to ENO All Voltage are. moored with respett to GND VOvage, 2) Raspbe 43 cary [OUTPUT -prms + A Gero pin that is wet as aa io pot Dili abl Tao 4o be received be Paspherry pi Yhal js Gon! by dats connedked to thin pio. Dd] Pw pulse - widty modulation } ss) * Software pw ta available an_all pag - ‘HasdWore pom is available on these pins only QPLO 12 -GP1018, GOs, GTO, ‘ SP ploss- eps Ceerial peripherad interfaces) is another prokoes| used for ste masles< slave tommunieahion, Dale is chron ized USfng dock CsclLk ak GPr0in feo mask tari) ‘and don} from pi te oul ert eyes wsing Mose (Mastey Oub Slave In) pin + KIT College Of Engineering, Kolhapur. {An Autonomous Institute) S) Spins are. lovewed fA sri cmmuntecahtan = -GnD «S$Chic + most « 63. i O| Foe se noc fS Used by Paspbary py board ta communieale ah - |_jevice rok axe com palibig ith Sotey- Intequaled cineuit (Ca tow - sped oo wire sesial cammunterttan peotoctlD - + This communicaltog etandard Saquies master slave, ) roles bekdeen both devi ces _ wee has two connectors SbA and . SCL _ Dl wrer eras sSesia) communicatan of VARY pins provide Oay to ww pommunicate *-hoo micnd ¢oniroll ere ox “com pubes KIT College Of Engineering, Kolhapur. (An Autonomous Institute)

You might also like