And I'm soexcitedaboutthisonebecauseit's essentiallythe O.
C.
D organizer's dreams.
Itjustticksalltheboxesfrommaking a reallyawesomecodingchallengeAndwhatwe'regonnabuildus a Pythonscriptthat's gonnahelpkeepourdesktopscompletelyclutterfree.
So I needtojustgoruletoseewhatfiletypestherearebecausewewantThioessentiallybeabletotrackalldifferentfiletypes.
Butwe'realsogonnaadd a safetynetsothatifthere's a filethatwehaven't gotinourlist, thenwe'llgetaddedtolike a foldercalledCategorizesHimLikethat.
Sonow I thinkwhat I wanttodoistrytocomeupwith a systemforfileorganization, basicallythis I thinkit's goingtobethemainpartofthebuild, likefiguringouthowtoactuallyorganizethedifferentthings.
Andthenthisisjustgonnabe a shortexplanationofhow I makethiswronginthebackground.
Allright, so I'm gonnagetintojustcreatingthesystemforfinalorganization, and I'm justgonnamakethisupasbestas I can.
Hopefully, it'llbegood.
Allright.
So I think I think I'vecomeupwiththesystem, whichwaskindofwhatwhat I wasthinkingbefore, aswell.
Thereareseveraldifferenttypesofimagesthatyoucandownloadlikethere's pain J and J.
Peg.
Andthere's a coupleotherones I don't rememberrightnow, butthereare a coupleoftheones, andthenwithinthesefolders, we'regonnahavesubfoldersthataregoingtobestructuredbythedates.
So, uh, we'regonnastartbyjustlike I said, copyingandpastingthecodefromthepreviousonethat I built, andthen I'm gonnagothroughandexplainkindofwhatitdoes.
Allright, sonowwe'veactually I didhavesomeproblemstryingtofigurehowtoactuallymakethisworkagain.
Butnowitseemstobeworking, andbasically I'vecreated a foldercalledCowHereonmyDesktop.
Sowerunit.
Sorightnowit's running.
It's checkingthedesktoptoseewhetherwe'veputandyoufiletheresowecanjustcreate a newfile.
Let's coolit.
Hello, doc.
TextAndwhatitshoulddowithyoushould I don't knowifyoucan.
You'llseethis, actually.
Wait, Let's movemyheadawayfornow.
Allright?
Butrightnowwe'recreating a newtextfile, like, soyoucanseeitgetsaddedandthengetsremoved.
Sobasicallynorenamesthefirstpartoftheofthefilenameandkeepstheextensionthesame s sowe'renotactuallymodifyingwhatfiledtypeitis.
Whichisgood.
Allright, letmetrytoexplainthis, especially I can.
So, essentially, whatwehaveisthisthisiswatchdog.
It's a librarythat I use.
And, ah, whatthatdoesisessentiallytracks.
Itdoes a lotofthings, butwhat I useitforisfortrackingfolders.
Okay, Soessentially, whatwe'redoingrightnowiswe'retrackingthedesktopthatthepathtothedesktopas a folderandthenthiswatchdogbasicallyhassomethingcalledfilesystemeventtemblor, whichhas a submethodwhichiscalledunmodified, andthatbasicallytracks.
Andifitdoes, thenwewantto I justbasicallyaddedaneyevariablethatwejustincrementfor.
Eachfilethatalreadyexistssaysyoucanseeherewealreadyhave a filenamedPost a PNG.
Sowhatwedothenisweincrementthat I buyone.
SowethencreatesposttodockPNG.
Andthenifweaddanotheronecalledpost a PNG, it'llbecalledpostthreedotPNGandsoon.
I feellikethisdidn't reallymakesensewhen I explainedit, but I think I thinkyouunderstand.
Sothatmeansthatwe'veadded a safetynetsothatwedon't accidentallyreplaceanyfiles, whichcanbe a problem.
Becauseifwehadtwofileswiththesamenamethanitmightautomaticallyreplacethatfileordeleteitordosomethingweirdandthenwhatweuseis a westdotrenameandthatbasicallyneedsthepathtotheoriginalfileandthenthepathtothenewplacewhereyouwanttoputthefile.
I decidedtodividethisvideoupinto a partoneandparttwo, andthere's a linkinthedescriptiontoparttwoofthisvideowherewefinishedthescriptoffandyoudon't wannamissit.