Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
45 views

Python

PYTHON TECHNOLOGY

Uploaded by

Victor Pathak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
45 views

Python

PYTHON TECHNOLOGY

Uploaded by

Victor Pathak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
PYTHON, too i Highrtevey Pym lavequage. 2. Created ‘oy Guido Van Rossum a’ Tevmni nal — Overt (5 tots Sto ae Deve by Py Hhon Sofhoant Foul 4+ 00? Concept. cs Eohaprdes Booed. Reoduyes ° fladanabins} 4 Basy to Leovn 4 Use. = Intey preted Longuage 3 A-Platforrd Language 4 SOLanguage 5- Lavage Lib 6. Gur Pare Sp- % thtequated. _% Dynamig Memory Allocak my Makg

prink Cis#foy] - Fist clement Tapes his Stmilox +o list. ii) Value Sepeedid ey omras i) Enclosed by pavantheals Tey ave veadn ony Uist, Ke) Dictrenony Sp S numerical Typ Like Hogh Fable type. i) Wie like assectadive way Ov vel) haohe .foundin Pevl Gi) Consort ef Key value pole h™ Usual no ov Strings “) Enclosed ey gt Lv) Aceéoed op Squat &y- dict = $3 ane . Aict Clone] = "Thy is oo ayer 023 = “this tg t00! Pat ( dlctLone]) . | Broke CJ. ——— GoNVERSION | There ave ‘ouild in fa to perfor} Conversion from one data type teanbthun Eq- Int Grversion as‘s’ b = Cink (a)) Print (ab) 5,5) poe Bq- =5 Print Ceype (variable i worn vight] cotsrsemne) oo a ge ety stewie [Hd Python 0 perators Side to left side Ope Tae ws false Eq> + = Add Ard L- Avithmetic Operator == Sub And 2. Comparison Op-(Relakiond) = mathiply And Pe P Je Divide Send, Se) Assignment op. . 4. Logical ope vader Syntax a Legicat op ogee’ Oper a . - (BD AND -BethTrue - Tue 4. The syntax if-else is - 5S. Bitwue Opardor _ = KOR = Any Tue - True 1 excpreoron 2 4. Arithmetic Operator key) NOT — Reverse Stoliment (8) LO + Addit else : 7 i IS. Bitwise Opevators, Statement(s) (2 = Subtvachén es Opevasoy Oeoup Syntax Bq- num=3# & - la) ke Bk AND uty Ip Aumy, 2 750 ©) %> Medulas _Reduyn Rep BikwiroR ly Print (" Nows Even!) He Buponent a tepowah( ~ Brig NOT ~% else: P Pp prink ("No 1s add) : BD A Bike R 4 €) >> Y RigdhSmfb x77 bs MLefhOngh 4 <2 He pyre for Evenfodd No Bs Assignment © perakor 2 Comparison Operator, ©). Com pans valus on beth side 4.54 is anticipation afeordy t. Allow check muttiple xp. () then decide rd trem, te) Relations Operator Condition give Trua/Fal PYTHON DECISION MAKING 2: During exccubonef rym 3. Specified achors taken Jedccovdling +0 condabons « Eur ‘ for TRUE. 2- Execude code as SoonCendn ™ Eq If Amount < 1000: discount +a mounk #005 prin’ (" Duscounty disou elf arneunk < 5000 + discount =amounts oo Print i "Discount discod else: discounk = areurtz0 Print C"Discound') discos PrintNet Payable, amount - discount). Lo PS. Lt while @ Repeat a stabemest/gpste we) While qven condubon True ©) 9b teat condation before exe looP: 2. Pov Loop nurs intffin padt® Enlevnd) (0) Enecat seq ofstatimed mu ltyple tres. WW) Abbreviall code manage te loop Vaviabe, bihile Loop L. gpunt =O wile Ecount <4)! print (' The count is';coun] Print Count = count + print (Good Bye!) ourpat The count 15 10 The count 18:4 The The We Good Bye! Ry Loop For num in range ¢ £16)! counk 1s 32 count count 19:4 Square = numme2 Prine (£4 me squans frum} ie f square 3) Guspate The squave *f 2s 4 Tre squwe $2 54 The squae $3 154 The square $4 sik The syyere 4 ‘5 isas- Fe nvange Geran bake loot 4a.giF. Python Code for Calculator PYIOEC Select o peration") Print (1 L-Aad") . Subtract") Prink (3. multiply") print(" a. Divide!) chore = inpadc" Evd oe chord 5/4): ") num d = floabCinpat(! enter firey HewnteDepine! Ea 0+!) num2 5 quae Unpacesny . Se vane nurmecr")) If choice 22'4't print (nured mum?) eng print (oumd -purd) choice = ='2'2 elif choice =='3": print Coumt x nu 2) else? print Gum 4/num2) See Pyttion Code for Prime NG | Functions, lk. Fo 1s block oforg, code woedto KS Python hes builtinFn he Prink C) 4 Creatinjown Front User Ds 1: Begin with keyword def gn name + 6). 2: Any agument plaedin 5. Con bedef ouside CP 44, code bloke within fr Short with a colon (tind 3. vetur Lexpresindent fn: a . 6 En calling, 4unehwnne functenne Global and ieee! Vowel L4. Voriable may net We 6c ar ail loo 17 PEM 2: Swpe ep variable deterr the portion of pgme snes you Can acces 3. Two basin scope — reusalole| perform singluaetton 5. Def outside Mave geeat Je Provide hygh degree of core aay, S22 opal and Local Veviabled contain © 4, Nortable definside Fo have local scope + Python Modules 3 Module allows you logically wytnon code. Fe og P 2A module is Pytnen 28} avbitvarily named annie you wind eeeg. wih that Py ten ast Py’ 2. gy modui i$ file code. 7 te Tan ny apvaria wat ot ote # Bg - Makh module. Python Li brarles J pan op vel rede ae Lib ave collec sandia Peade. weed ies = Numerical Me Signs ary R Ho ~ SciPy - Scientific Pyne? - High level scienhfic Computation . Glowat variables . Leocat variable, aw wo = We need to install tivsh- = Command- pip install Numf, Python Offline Lid ctnstin 4. py =m Pip list - alilib 2. impor® sys Print (sys. executable) 3) Create requirement but by vight click to export all veq 4 Pip download .v reg txt 3 pip install _ -no -incdex--fird links path_ to. down lowd-div-v| req txt. $+ pip download -d directory.namd +. Pip install +-no-Inclix -— Lindt Atrectory. name parda//To Python File Operation t File.closed Return true if file 1S closed, Palse otherwise 2) File. mode Yehuya acvo mide With which file wag opened: 3 See program. Jb Python provide Gui opt- tT + Filename Rebun nare of File GUE prog in Python 2. Tkintey - Python Entefou 4 Tk Gut toolkit 3. ys Py tron Ww Py att S. FP y thon Ey trom Heinter Import + bop = Tel) — fmprt Lobel ( top,text Susernar Place (u=30, yas Pards ED p- madnleopl) - Cat) "mein! ThKinter lati. Label = Dspiay tet ling 2. Buthn —.Add button S.canvoa — Over piewt 6. Rodi Buston~ teiple mentor of many Sel # Envy = Input sige y org widgets ; Message. Sarre a0 labek, in Page, Using Data Booe Progvars yer U4 Comin Boy = Contain avo? 5. Check Buston - og gle Styne Frame = Used ag contr loveak exapt: Ab. vo Noack C) int (hE weed! print (" Evvor ocuy) impoct tmysq) «connector from bkinter Impork # def sulomibact©) © User = Usevnams.geke) passw = password: got) ey (8 S0OK HW) print ( $ Dekuils fusca) fpupal) root geometry ("370% ) - root. RHE CLogin Page’) login todle (user »porou) ee an Ke else: princi enter Pwd!) voot = TKL) dub def. toginted' (usex, par . yeh Chost =tLopial ross u " yout" , paroword cemk sYascrnane} Laelfirstrns place (K=50/1=9) Usevname = Ex teylarot us iat = wo) \dbelsecrow = Label voots oe eee Rue") dl = mysq) -conneckor co Cursom =db- Cursonl) tabel secu: plas C2525) 1 parow” ° a a ey! password -SEnty (wot wity Saveguery ="selock # poroword. place =(x 21s0,y22 3 width =i00) From login Submitiern = Buiteo * Cuvgar: exeube (saveghiny) Submits Crook, seat atbegintsege i blue’, command = Suservbock) ” pao (onto my veoult 2 uuvsor. 1c for idx, x in enw ot Vay = my tout dal asain peers? vay2 = may eosttC zy yela3y be Wf use, ==vard + _wuidtn2 52) ‘ Pussw = =var2 ¢ root: maine PC) Print (Login Suc Yoot: dedivoyc) Venpor t Gut teat Shell 4 Reveyse shell Shell 1: Process automadting task oo Miteeiy SyS command on dy % Lib ave OS, Sub proces eke Reverse Shell 4. Type Shell 2 Tavget machine initiate a Connec Hon +0 attacker machine | 3. Allow GHocher 4 arexe comd on} Tonner machine vervoldy. Gash Sev ipr Using Python Import os 44 = 0S. System Crrpeonfig’) Prink (99) iI Save outpak ievpor® Suoprocess =C1pen fig!) cmd wit open( lowtpat.tut, Na) as out: Yetuvn -Lode =subprocea, call (ord stdot 0-4) U cai & 54d odk ave Subfrh Grgemants Bash Sov iptinge t+ Bash Scripting aie to Gutomate 410 on UNIX bused Sys 2. eT Bash Shel 3. Bash 1s CLT allow toexeculi comd 4 Scvipk on Sys. 4 Scvipt vaviHen in seeipth Network, Analysis JL. 9% SHdy Structures & behoviow of NW. 2 trel To pologey connechiontyy trip fie Flow pong + Seewnaty DS. Python bib (CY POAP — sb tocap, Paysing Oralysing nw, ope (> dpkt - Ub fer decoding rani pulatig ms per Eq Eth vend EP, TORUDP language called Booh- Shell SoupH ib toy NW Analysis IL. Pypacker-Uib for parsing editing forge nto me. P -PyShavie — Fytnon sivapperfo tool Ss kamen€ -Cvagteserd wu) 1 VK *, Same oo ScarPy, = Simplified APE. a tmpeck et ~ Manipulating Nw protocol 4 comn with vemoti sy» tnel $mB, NetBIos. 3+ Scanpy. ~ Pet mranipasechor} = Nw analysis» le \tiveshardk pkt cuptuve taney Pt. capture Fl serhandyee = Capture pdacodedens tp = NW proteol4 Analyse conkhe @ Process captive Ganalyze F Ww traffic in veal-time. | Packeb Sri fEin ia. 2. See content+tshavioursd. “| Pee roast Nw. bS- nus trouble shocring NY Secunty Anolysis , “ey From seapy: deh packet. call C packed Print (packer .shiot) Smigt (fiken steep! pyn = Packet call ,count=lo) Ja. creating, custom mw per to perform tack dike — ienport 2. Nw teat , Scans fecon y- from scapy recy impo es packet =P (ast ¢ 9 /506P from scapy »Send veaporse >stnd cpacket) prind(xeaponse)

You might also like