[{"data":1,"prerenderedAt":2199},["ShallowReactive",2],{"doc-\u002Fexamples\u002Fpython-file-organizer-script-example":3},{"id":4,"title":5,"body":6,"description":2192,"extension":2193,"meta":2194,"navigation":67,"path":2195,"seo":2196,"stem":2197,"__hash__":2198},"content\u002Fexamples\u002Fpython-file-organizer-script-example.md","Python File Organizer Script Example",{"type":7,"value":8,"toc":2159},"minimark",[9,13,17,20,25,462,471,475,478,501,509,513,516,534,542,546,549,873,876,930,937,941,948,971,976,979,1003,1009,1026,1029,1032,1038,1062,1065,1068,1085,1091,1097,1129,1132,1143,1158,1164,1188,1191,1202,1208,1247,1250,1253,1257,1260,1287,1290,1294,1297,1311,1314,1698,1701,1709,1713,1716,1719,1733,1743,1747,1750,1756,1759,1762,1770,1773,1809,1816,1822,1825,1827,1835,1842,1846,1855,1858,1877,1884,1888,1891,1894,1907,1910,1914,1917,1923,1927,1930,2005,2008,2025,2028,2045,2049,2053,2056,2060,2077,2081,2086,2090,2093,2097,2104,2108,2148,2155],[10,11,5],"h1",{"id":12},"python-file-organizer-script-example",[14,15,16],"p",{},"This beginner-friendly example shows how to organize files in a folder by moving them into subfolders based on file type.",[14,18,19],{},"The goal of this page is to help you understand one practical Python script. It is not a full guide to every file-handling function in Python.",[21,22,24],"h2",{"id":23},"quick-example","Quick example",[26,27,32],"pre",{"className":28,"code":29,"language":30,"meta":31,"style":31},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","from pathlib import Path\nimport shutil\n\nsource_folder = Path(\"downloads\")\n\nfolders = {\n    \".jpg\": \"images\",\n    \".png\": \"images\",\n    \".gif\": \"images\",\n    \".txt\": \"text_files\",\n    \".pdf\": \"pdf_files\",\n    \".csv\": \"csv_files\",\n}\n\nfor item in source_folder.iterdir():\n    if item.is_file():\n        extension = item.suffix.lower()\n        folder_name = folders.get(extension, \"other\")\n        destination_folder = source_folder \u002F folder_name\n        destination_folder.mkdir(exist_ok=True)\n        shutil.move(str(item), str(destination_folder \u002F item.name))\n\nprint(\"Files organized.\")\n","python","",[33,34,35,54,62,69,100,105,116,141,161,181,202,223,244,250,255,279,295,319,352,369,394,439,444],"code",{"__ignoreMap":31},[36,37,40,44,48,51],"span",{"class":38,"line":39},"line",1,[36,41,43],{"class":42},"sVHd0","from",[36,45,47],{"class":46},"su5hD"," pathlib ",[36,49,50],{"class":42},"import",[36,52,53],{"class":46}," Path\n",[36,55,57,59],{"class":38,"line":56},2,[36,58,50],{"class":42},[36,60,61],{"class":46}," shutil\n",[36,63,65],{"class":38,"line":64},3,[36,66,68],{"emptyLinePlaceholder":67},true,"\n",[36,70,72,75,79,83,87,91,95,97],{"class":38,"line":71},4,[36,73,74],{"class":46},"source_folder ",[36,76,78],{"class":77},"smGrS","=",[36,80,82],{"class":81},"slqww"," Path",[36,84,86],{"class":85},"sP7_E","(",[36,88,90],{"class":89},"sjJ54","\"",[36,92,94],{"class":93},"s_sjI","downloads",[36,96,90],{"class":89},[36,98,99],{"class":85},")\n",[36,101,103],{"class":38,"line":102},5,[36,104,68],{"emptyLinePlaceholder":67},[36,106,108,111,113],{"class":38,"line":107},6,[36,109,110],{"class":46},"folders ",[36,112,78],{"class":77},[36,114,115],{"class":85}," {\n",[36,117,119,122,125,127,130,133,136,138],{"class":38,"line":118},7,[36,120,121],{"class":89},"    \"",[36,123,124],{"class":93},".jpg",[36,126,90],{"class":89},[36,128,129],{"class":85},":",[36,131,132],{"class":89}," \"",[36,134,135],{"class":93},"images",[36,137,90],{"class":89},[36,139,140],{"class":85},",\n",[36,142,144,146,149,151,153,155,157,159],{"class":38,"line":143},8,[36,145,121],{"class":89},[36,147,148],{"class":93},".png",[36,150,90],{"class":89},[36,152,129],{"class":85},[36,154,132],{"class":89},[36,156,135],{"class":93},[36,158,90],{"class":89},[36,160,140],{"class":85},[36,162,164,166,169,171,173,175,177,179],{"class":38,"line":163},9,[36,165,121],{"class":89},[36,167,168],{"class":93},".gif",[36,170,90],{"class":89},[36,172,129],{"class":85},[36,174,132],{"class":89},[36,176,135],{"class":93},[36,178,90],{"class":89},[36,180,140],{"class":85},[36,182,184,186,189,191,193,195,198,200],{"class":38,"line":183},10,[36,185,121],{"class":89},[36,187,188],{"class":93},".txt",[36,190,90],{"class":89},[36,192,129],{"class":85},[36,194,132],{"class":89},[36,196,197],{"class":93},"text_files",[36,199,90],{"class":89},[36,201,140],{"class":85},[36,203,205,207,210,212,214,216,219,221],{"class":38,"line":204},11,[36,206,121],{"class":89},[36,208,209],{"class":93},".pdf",[36,211,90],{"class":89},[36,213,129],{"class":85},[36,215,132],{"class":89},[36,217,218],{"class":93},"pdf_files",[36,220,90],{"class":89},[36,222,140],{"class":85},[36,224,226,228,231,233,235,237,240,242],{"class":38,"line":225},12,[36,227,121],{"class":89},[36,229,230],{"class":93},".csv",[36,232,90],{"class":89},[36,234,129],{"class":85},[36,236,132],{"class":89},[36,238,239],{"class":93},"csv_files",[36,241,90],{"class":89},[36,243,140],{"class":85},[36,245,247],{"class":38,"line":246},13,[36,248,249],{"class":85},"}\n",[36,251,253],{"class":38,"line":252},14,[36,254,68],{"emptyLinePlaceholder":67},[36,256,258,261,264,267,270,273,276],{"class":38,"line":257},15,[36,259,260],{"class":42},"for",[36,262,263],{"class":46}," item ",[36,265,266],{"class":42},"in",[36,268,269],{"class":46}," source_folder",[36,271,272],{"class":85},".",[36,274,275],{"class":81},"iterdir",[36,277,278],{"class":85},"():\n",[36,280,282,285,288,290,293],{"class":38,"line":281},16,[36,283,284],{"class":42},"    if",[36,286,287],{"class":46}," item",[36,289,272],{"class":85},[36,291,292],{"class":81},"is_file",[36,294,278],{"class":85},[36,296,298,301,303,305,307,311,313,316],{"class":38,"line":297},17,[36,299,300],{"class":46},"        extension ",[36,302,78],{"class":77},[36,304,287],{"class":46},[36,306,272],{"class":85},[36,308,310],{"class":309},"skxfh","suffix",[36,312,272],{"class":85},[36,314,315],{"class":81},"lower",[36,317,318],{"class":85},"()\n",[36,320,322,325,327,330,332,335,337,340,343,345,348,350],{"class":38,"line":321},18,[36,323,324],{"class":46},"        folder_name ",[36,326,78],{"class":77},[36,328,329],{"class":46}," folders",[36,331,272],{"class":85},[36,333,334],{"class":81},"get",[36,336,86],{"class":85},[36,338,339],{"class":81},"extension",[36,341,342],{"class":85},",",[36,344,132],{"class":89},[36,346,347],{"class":93},"other",[36,349,90],{"class":89},[36,351,99],{"class":85},[36,353,355,358,360,363,366],{"class":38,"line":354},19,[36,356,357],{"class":46},"        destination_folder ",[36,359,78],{"class":77},[36,361,362],{"class":46}," source_folder ",[36,364,365],{"class":77},"\u002F",[36,367,368],{"class":46}," folder_name\n",[36,370,372,375,377,380,382,386,388,392],{"class":38,"line":371},20,[36,373,374],{"class":46},"        destination_folder",[36,376,272],{"class":85},[36,378,379],{"class":81},"mkdir",[36,381,86],{"class":85},[36,383,385],{"class":384},"s99_P","exist_ok",[36,387,78],{"class":77},[36,389,391],{"class":390},"s39Yj","True",[36,393,99],{"class":85},[36,395,397,400,402,405,407,411,413,416,419,422,424,427,429,431,433,436],{"class":38,"line":396},21,[36,398,399],{"class":46},"        shutil",[36,401,272],{"class":85},[36,403,404],{"class":81},"move",[36,406,86],{"class":85},[36,408,410],{"class":409},"sZMiF","str",[36,412,86],{"class":85},[36,414,415],{"class":81},"item",[36,417,418],{"class":85},"),",[36,420,421],{"class":409}," str",[36,423,86],{"class":85},[36,425,426],{"class":81},"destination_folder ",[36,428,365],{"class":77},[36,430,287],{"class":81},[36,432,272],{"class":85},[36,434,435],{"class":309},"name",[36,437,438],{"class":85},"))\n",[36,440,442],{"class":38,"line":441},22,[36,443,68],{"emptyLinePlaceholder":67},[36,445,447,451,453,455,458,460],{"class":38,"line":446},23,[36,448,450],{"class":449},"sptTA","print",[36,452,86],{"class":85},[36,454,90],{"class":89},[36,456,457],{"class":93},"Files organized.",[36,459,90],{"class":89},[36,461,99],{"class":85},[14,463,464,465,467,468,470],{},"This example organizes files inside a folder named ",[33,466,94],{},". It groups files by extension and puts unknown file types into an ",[33,469,347],{}," folder.",[21,472,474],{"id":473},"what-this-example-does","What this example does",[14,476,477],{},"This script:",[479,480,481,485,488,498],"ul",{},[482,483,484],"li",{},"Shows a complete beginner-friendly script",[482,486,487],{},"Moves files into folders based on file extension",[482,489,490,491,494,495],{},"Uses simple rules like ",[33,492,493],{},".jpg -> images"," and ",[33,496,497],{},".pdf -> pdf_files",[482,499,500],{},"Helps you understand a real automation task",[14,502,503,504,272],{},"If you are new to folders and paths in Python, it may also help to read ",[505,506,508],"a",{"href":507},"\u002Flearn\u002Fworking-with-file-paths-in-python","working with file paths in Python",[21,510,512],{"id":511},"what-you-need-before-running-it","What you need before running it",[14,514,515],{},"Before you run the script, make sure you have:",[479,517,518,521,524,531],{},[482,519,520],{},"Python installed on your computer",[482,522,523],{},"A folder with files to organize",[482,525,526,527,530],{},"Basic understanding of variables, loops, and ",[33,528,529],{},"if"," statements",[482,532,533],{},"A test folder to practice with first",[14,535,536,537,541],{},"Using a test folder is important. This script ",[538,539,540],"strong",{},"moves"," files, so your original folder contents will change.",[21,543,545],{"id":544},"how-the-script-works-step-by-step","How the script works step by step",[14,547,548],{},"Here is the same script again:",[26,550,551],{"className":28,"code":29,"language":30,"meta":31,"style":31},[33,552,553,563,569,573,591,595,603,621,639,657,675,693,711,715,719,735,747,765,791,803,821,855,859],{"__ignoreMap":31},[36,554,555,557,559,561],{"class":38,"line":39},[36,556,43],{"class":42},[36,558,47],{"class":46},[36,560,50],{"class":42},[36,562,53],{"class":46},[36,564,565,567],{"class":38,"line":56},[36,566,50],{"class":42},[36,568,61],{"class":46},[36,570,571],{"class":38,"line":64},[36,572,68],{"emptyLinePlaceholder":67},[36,574,575,577,579,581,583,585,587,589],{"class":38,"line":71},[36,576,74],{"class":46},[36,578,78],{"class":77},[36,580,82],{"class":81},[36,582,86],{"class":85},[36,584,90],{"class":89},[36,586,94],{"class":93},[36,588,90],{"class":89},[36,590,99],{"class":85},[36,592,593],{"class":38,"line":102},[36,594,68],{"emptyLinePlaceholder":67},[36,596,597,599,601],{"class":38,"line":107},[36,598,110],{"class":46},[36,600,78],{"class":77},[36,602,115],{"class":85},[36,604,605,607,609,611,613,615,617,619],{"class":38,"line":118},[36,606,121],{"class":89},[36,608,124],{"class":93},[36,610,90],{"class":89},[36,612,129],{"class":85},[36,614,132],{"class":89},[36,616,135],{"class":93},[36,618,90],{"class":89},[36,620,140],{"class":85},[36,622,623,625,627,629,631,633,635,637],{"class":38,"line":143},[36,624,121],{"class":89},[36,626,148],{"class":93},[36,628,90],{"class":89},[36,630,129],{"class":85},[36,632,132],{"class":89},[36,634,135],{"class":93},[36,636,90],{"class":89},[36,638,140],{"class":85},[36,640,641,643,645,647,649,651,653,655],{"class":38,"line":163},[36,642,121],{"class":89},[36,644,168],{"class":93},[36,646,90],{"class":89},[36,648,129],{"class":85},[36,650,132],{"class":89},[36,652,135],{"class":93},[36,654,90],{"class":89},[36,656,140],{"class":85},[36,658,659,661,663,665,667,669,671,673],{"class":38,"line":183},[36,660,121],{"class":89},[36,662,188],{"class":93},[36,664,90],{"class":89},[36,666,129],{"class":85},[36,668,132],{"class":89},[36,670,197],{"class":93},[36,672,90],{"class":89},[36,674,140],{"class":85},[36,676,677,679,681,683,685,687,689,691],{"class":38,"line":204},[36,678,121],{"class":89},[36,680,209],{"class":93},[36,682,90],{"class":89},[36,684,129],{"class":85},[36,686,132],{"class":89},[36,688,218],{"class":93},[36,690,90],{"class":89},[36,692,140],{"class":85},[36,694,695,697,699,701,703,705,707,709],{"class":38,"line":225},[36,696,121],{"class":89},[36,698,230],{"class":93},[36,700,90],{"class":89},[36,702,129],{"class":85},[36,704,132],{"class":89},[36,706,239],{"class":93},[36,708,90],{"class":89},[36,710,140],{"class":85},[36,712,713],{"class":38,"line":246},[36,714,249],{"class":85},[36,716,717],{"class":38,"line":252},[36,718,68],{"emptyLinePlaceholder":67},[36,720,721,723,725,727,729,731,733],{"class":38,"line":257},[36,722,260],{"class":42},[36,724,263],{"class":46},[36,726,266],{"class":42},[36,728,269],{"class":46},[36,730,272],{"class":85},[36,732,275],{"class":81},[36,734,278],{"class":85},[36,736,737,739,741,743,745],{"class":38,"line":281},[36,738,284],{"class":42},[36,740,287],{"class":46},[36,742,272],{"class":85},[36,744,292],{"class":81},[36,746,278],{"class":85},[36,748,749,751,753,755,757,759,761,763],{"class":38,"line":297},[36,750,300],{"class":46},[36,752,78],{"class":77},[36,754,287],{"class":46},[36,756,272],{"class":85},[36,758,310],{"class":309},[36,760,272],{"class":85},[36,762,315],{"class":81},[36,764,318],{"class":85},[36,766,767,769,771,773,775,777,779,781,783,785,787,789],{"class":38,"line":321},[36,768,324],{"class":46},[36,770,78],{"class":77},[36,772,329],{"class":46},[36,774,272],{"class":85},[36,776,334],{"class":81},[36,778,86],{"class":85},[36,780,339],{"class":81},[36,782,342],{"class":85},[36,784,132],{"class":89},[36,786,347],{"class":93},[36,788,90],{"class":89},[36,790,99],{"class":85},[36,792,793,795,797,799,801],{"class":38,"line":354},[36,794,357],{"class":46},[36,796,78],{"class":77},[36,798,362],{"class":46},[36,800,365],{"class":77},[36,802,368],{"class":46},[36,804,805,807,809,811,813,815,817,819],{"class":38,"line":371},[36,806,374],{"class":46},[36,808,272],{"class":85},[36,810,379],{"class":81},[36,812,86],{"class":85},[36,814,385],{"class":384},[36,816,78],{"class":77},[36,818,391],{"class":390},[36,820,99],{"class":85},[36,822,823,825,827,829,831,833,835,837,839,841,843,845,847,849,851,853],{"class":38,"line":396},[36,824,399],{"class":46},[36,826,272],{"class":85},[36,828,404],{"class":81},[36,830,86],{"class":85},[36,832,410],{"class":409},[36,834,86],{"class":85},[36,836,415],{"class":81},[36,838,418],{"class":85},[36,840,421],{"class":409},[36,842,86],{"class":85},[36,844,426],{"class":81},[36,846,365],{"class":77},[36,848,287],{"class":81},[36,850,272],{"class":85},[36,852,435],{"class":309},[36,854,438],{"class":85},[36,856,857],{"class":38,"line":441},[36,858,68],{"emptyLinePlaceholder":67},[36,860,861,863,865,867,869,871],{"class":38,"line":446},[36,862,450],{"class":449},[36,864,86],{"class":85},[36,866,90],{"class":89},[36,868,457],{"class":93},[36,870,90],{"class":89},[36,872,99],{"class":85},[14,874,875],{},"Step by step, it does this:",[877,878,879,890,896,903,906,909,912,918,924,927],"ol",{},[482,880,881,882,885,886,889],{},"Imports ",[33,883,884],{},"Path"," from ",[33,887,888],{},"pathlib"," to work with file paths",[482,891,881,892,895],{},[33,893,894],{},"shutil"," so it can move files",[482,897,898,899,902],{},"Sets ",[33,900,901],{},"source_folder"," to the folder you want to organize",[482,904,905],{},"Creates a dictionary that maps file extensions to folder names",[482,907,908],{},"Loops through each item in the source folder",[482,910,911],{},"Checks that the item is a file, not a folder",[482,913,914,915],{},"Reads the file extension with ",[33,916,917],{},"suffix.lower()",[482,919,920,921],{},"Chooses a destination folder with ",[33,922,923],{},"folders.get()",[482,925,926],{},"Creates that folder if it does not already exist",[482,928,929],{},"Moves the file into the correct folder",[14,931,932,933,272],{},"If you want to learn more about listing folder contents, see ",[505,934,936],{"href":935},"\u002Fhow-to\u002Fhow-to-list-files-in-a-directory-in-python","how to list files in a directory in Python",[21,938,940],{"id":939},"important-lines-to-explain","Important lines to explain",[942,943,945],"h3",{"id":944},"source_folder-pathdownloads",[33,946,947],{},"source_folder = Path(\"downloads\")",[26,949,951],{"className":28,"code":950,"language":30,"meta":31,"style":31},"source_folder = Path(\"downloads\")\n",[33,952,953],{"__ignoreMap":31},[36,954,955,957,959,961,963,965,967,969],{"class":38,"line":39},[36,956,74],{"class":46},[36,958,78],{"class":77},[36,960,82],{"class":81},[36,962,86],{"class":85},[36,964,90],{"class":89},[36,966,94],{"class":93},[36,968,90],{"class":89},[36,970,99],{"class":85},[14,972,973,974,272],{},"This creates a path object for the folder named ",[33,975,94],{},[14,977,978],{},"If that folder is not in the same location as your script, you may need a full path instead, such as:",[26,980,982],{"className":28,"code":981,"language":30,"meta":31,"style":31},"source_folder = Path(\"\u002FUsers\u002Fyourname\u002FDownloads\")\n",[33,983,984],{"__ignoreMap":31},[36,985,986,988,990,992,994,996,999,1001],{"class":38,"line":39},[36,987,74],{"class":46},[36,989,78],{"class":77},[36,991,82],{"class":81},[36,993,86],{"class":85},[36,995,90],{"class":89},[36,997,998],{"class":93},"\u002FUsers\u002Fyourname\u002FDownloads",[36,1000,90],{"class":89},[36,1002,99],{"class":85},[942,1004,1006],{"id":1005},"if-itemis_file",[33,1007,1008],{},"if item.is_file():",[26,1010,1012],{"className":28,"code":1011,"language":30,"meta":31,"style":31},"if item.is_file():\n",[33,1013,1014],{"__ignoreMap":31},[36,1015,1016,1018,1020,1022,1024],{"class":38,"line":39},[36,1017,529],{"class":42},[36,1019,287],{"class":46},[36,1021,272],{"class":85},[36,1023,292],{"class":81},[36,1025,278],{"class":85},[14,1027,1028],{},"This checks whether the current item is a file.",[14,1030,1031],{},"It skips subfolders. That matters because this script is only meant to organize files directly inside the source folder.",[942,1033,1035],{"id":1034},"itemsuffixlower",[33,1036,1037],{},"item.suffix.lower()",[26,1039,1041],{"className":28,"code":1040,"language":30,"meta":31,"style":31},"extension = item.suffix.lower()\n",[33,1042,1043],{"__ignoreMap":31},[36,1044,1045,1048,1050,1052,1054,1056,1058,1060],{"class":38,"line":39},[36,1046,1047],{"class":46},"extension ",[36,1049,78],{"class":77},[36,1051,287],{"class":46},[36,1053,272],{"class":85},[36,1055,310],{"class":309},[36,1057,272],{"class":85},[36,1059,315],{"class":81},[36,1061,318],{"class":85},[14,1063,1064],{},"This gets the file extension and changes it to lowercase.",[14,1066,1067],{},"That helps with files like:",[479,1069,1070,1075,1080],{},[482,1071,1072],{},[33,1073,1074],{},"photo.jpg",[482,1076,1077],{},[33,1078,1079],{},"photo.JPG",[482,1081,1082],{},[33,1083,1084],{},"photo.Jpg",[14,1086,1087,1088,1090],{},"All of these become ",[33,1089,124],{},", so they match the same rule.",[942,1092,1094],{"id":1093},"foldersgetextension-other",[33,1095,1096],{},"folders.get(extension, \"other\")",[26,1098,1100],{"className":28,"code":1099,"language":30,"meta":31,"style":31},"folder_name = folders.get(extension, \"other\")\n",[33,1101,1102],{"__ignoreMap":31},[36,1103,1104,1107,1109,1111,1113,1115,1117,1119,1121,1123,1125,1127],{"class":38,"line":39},[36,1105,1106],{"class":46},"folder_name ",[36,1108,78],{"class":77},[36,1110,329],{"class":46},[36,1112,272],{"class":85},[36,1114,334],{"class":81},[36,1116,86],{"class":85},[36,1118,339],{"class":81},[36,1120,342],{"class":85},[36,1122,132],{"class":89},[36,1124,347],{"class":93},[36,1126,90],{"class":89},[36,1128,99],{"class":85},[14,1130,1131],{},"This looks up the extension in the dictionary.",[479,1133,1134,1137],{},[482,1135,1136],{},"If the extension exists, it uses the matching folder name",[482,1138,1139,1140],{},"If the extension is not found, it uses ",[33,1141,1142],{},"\"other\"",[14,1144,1145,1146,1149,1150,1152,1153,1149,1156,272],{},"So a file like ",[33,1147,1148],{},"report.pdf"," goes to ",[33,1151,218],{},", but a file like ",[33,1154,1155],{},"archive.zip",[33,1157,347],{},[942,1159,1161],{"id":1160},"destination_foldermkdirexist_oktrue",[33,1162,1163],{},"destination_folder.mkdir(exist_ok=True)",[26,1165,1167],{"className":28,"code":1166,"language":30,"meta":31,"style":31},"destination_folder.mkdir(exist_ok=True)\n",[33,1168,1169],{"__ignoreMap":31},[36,1170,1171,1174,1176,1178,1180,1182,1184,1186],{"class":38,"line":39},[36,1172,1173],{"class":46},"destination_folder",[36,1175,272],{"class":85},[36,1177,379],{"class":81},[36,1179,86],{"class":85},[36,1181,385],{"class":384},[36,1183,78],{"class":77},[36,1185,391],{"class":390},[36,1187,99],{"class":85},[14,1189,1190],{},"This creates the destination folder if needed.",[14,1192,1193,1194,1197,1198,272],{},"The ",[33,1195,1196],{},"exist_ok=True"," part prevents an error if the folder already exists. If you need more help creating folders, see ",[505,1199,1201],{"href":1200},"\u002Fhow-to\u002Fhow-to-create-a-directory-in-python","how to create a directory in Python",[942,1203,1205],{"id":1204},"shutilmove",[33,1206,1207],{},"shutil.move(...)",[26,1209,1211],{"className":28,"code":1210,"language":30,"meta":31,"style":31},"shutil.move(str(item), str(destination_folder \u002F item.name))\n",[33,1212,1213],{"__ignoreMap":31},[36,1214,1215,1217,1219,1221,1223,1225,1227,1229,1231,1233,1235,1237,1239,1241,1243,1245],{"class":38,"line":39},[36,1216,894],{"class":46},[36,1218,272],{"class":85},[36,1220,404],{"class":81},[36,1222,86],{"class":85},[36,1224,410],{"class":409},[36,1226,86],{"class":85},[36,1228,415],{"class":81},[36,1230,418],{"class":85},[36,1232,421],{"class":409},[36,1234,86],{"class":85},[36,1236,426],{"class":81},[36,1238,365],{"class":77},[36,1240,287],{"class":81},[36,1242,272],{"class":85},[36,1244,435],{"class":309},[36,1246,438],{"class":85},[14,1248,1249],{},"This moves the file to its new location.",[14,1251,1252],{},"The file is removed from the original place and placed in the destination folder.",[21,1254,1256],{"id":1255},"expected-result","Expected result",[14,1258,1259],{},"After the script runs, your folder may look something like this:",[479,1261,1262,1267,1272,1277,1282],{},[482,1263,1264],{},[33,1265,1266],{},"downloads\u002Fimages\u002F",[482,1268,1269],{},[33,1270,1271],{},"downloads\u002Fpdf_files\u002F",[482,1273,1274],{},[33,1275,1276],{},"downloads\u002Ftext_files\u002F",[482,1278,1279],{},[33,1280,1281],{},"downloads\u002Fcsv_files\u002F",[482,1283,1284],{},[33,1285,1286],{},"downloads\u002Fother\u002F",[14,1288,1289],{},"Files are sorted into folders automatically, which makes the original folder easier to browse.",[21,1291,1293],{"id":1292},"ways-to-customize-the-script","Ways to customize the script",[14,1295,1296],{},"You can change the script in several simple ways:",[479,1298,1299,1302,1305,1308],{},[482,1300,1301],{},"Add more file extensions to the dictionary",[482,1303,1304],{},"Change folder names to fit your own system",[482,1306,1307],{},"Organize by first letter, date, or filename pattern instead of extension",[482,1309,1310],{},"Print each move so you can see what changed",[14,1312,1313],{},"For example, this version prints each file move:",[26,1315,1317],{"className":28,"code":1316,"language":30,"meta":31,"style":31},"from pathlib import Path\nimport shutil\n\nsource_folder = Path(\"downloads\")\n\nfolders = {\n    \".jpg\": \"images\",\n    \".png\": \"images\",\n    \".gif\": \"images\",\n    \".txt\": \"text_files\",\n    \".pdf\": \"pdf_files\",\n    \".csv\": \"csv_files\",\n}\n\nfor item in source_folder.iterdir():\n    if item.is_file():\n        extension = item.suffix.lower()\n        folder_name = folders.get(extension, \"other\")\n        destination_folder = source_folder \u002F folder_name\n        destination_folder.mkdir(exist_ok=True)\n\n        destination_path = destination_folder \u002F item.name\n        print(f\"Moving {item.name} -> {destination_path}\")\n        shutil.move(str(item), str(destination_path))\n\nprint(\"Files organized.\")\n",[33,1318,1319,1329,1335,1339,1357,1361,1369,1387,1405,1423,1441,1459,1477,1481,1485,1501,1513,1531,1557,1569,1587,1591,1610,1651,1678,1683],{"__ignoreMap":31},[36,1320,1321,1323,1325,1327],{"class":38,"line":39},[36,1322,43],{"class":42},[36,1324,47],{"class":46},[36,1326,50],{"class":42},[36,1328,53],{"class":46},[36,1330,1331,1333],{"class":38,"line":56},[36,1332,50],{"class":42},[36,1334,61],{"class":46},[36,1336,1337],{"class":38,"line":64},[36,1338,68],{"emptyLinePlaceholder":67},[36,1340,1341,1343,1345,1347,1349,1351,1353,1355],{"class":38,"line":71},[36,1342,74],{"class":46},[36,1344,78],{"class":77},[36,1346,82],{"class":81},[36,1348,86],{"class":85},[36,1350,90],{"class":89},[36,1352,94],{"class":93},[36,1354,90],{"class":89},[36,1356,99],{"class":85},[36,1358,1359],{"class":38,"line":102},[36,1360,68],{"emptyLinePlaceholder":67},[36,1362,1363,1365,1367],{"class":38,"line":107},[36,1364,110],{"class":46},[36,1366,78],{"class":77},[36,1368,115],{"class":85},[36,1370,1371,1373,1375,1377,1379,1381,1383,1385],{"class":38,"line":118},[36,1372,121],{"class":89},[36,1374,124],{"class":93},[36,1376,90],{"class":89},[36,1378,129],{"class":85},[36,1380,132],{"class":89},[36,1382,135],{"class":93},[36,1384,90],{"class":89},[36,1386,140],{"class":85},[36,1388,1389,1391,1393,1395,1397,1399,1401,1403],{"class":38,"line":143},[36,1390,121],{"class":89},[36,1392,148],{"class":93},[36,1394,90],{"class":89},[36,1396,129],{"class":85},[36,1398,132],{"class":89},[36,1400,135],{"class":93},[36,1402,90],{"class":89},[36,1404,140],{"class":85},[36,1406,1407,1409,1411,1413,1415,1417,1419,1421],{"class":38,"line":163},[36,1408,121],{"class":89},[36,1410,168],{"class":93},[36,1412,90],{"class":89},[36,1414,129],{"class":85},[36,1416,132],{"class":89},[36,1418,135],{"class":93},[36,1420,90],{"class":89},[36,1422,140],{"class":85},[36,1424,1425,1427,1429,1431,1433,1435,1437,1439],{"class":38,"line":183},[36,1426,121],{"class":89},[36,1428,188],{"class":93},[36,1430,90],{"class":89},[36,1432,129],{"class":85},[36,1434,132],{"class":89},[36,1436,197],{"class":93},[36,1438,90],{"class":89},[36,1440,140],{"class":85},[36,1442,1443,1445,1447,1449,1451,1453,1455,1457],{"class":38,"line":204},[36,1444,121],{"class":89},[36,1446,209],{"class":93},[36,1448,90],{"class":89},[36,1450,129],{"class":85},[36,1452,132],{"class":89},[36,1454,218],{"class":93},[36,1456,90],{"class":89},[36,1458,140],{"class":85},[36,1460,1461,1463,1465,1467,1469,1471,1473,1475],{"class":38,"line":225},[36,1462,121],{"class":89},[36,1464,230],{"class":93},[36,1466,90],{"class":89},[36,1468,129],{"class":85},[36,1470,132],{"class":89},[36,1472,239],{"class":93},[36,1474,90],{"class":89},[36,1476,140],{"class":85},[36,1478,1479],{"class":38,"line":246},[36,1480,249],{"class":85},[36,1482,1483],{"class":38,"line":252},[36,1484,68],{"emptyLinePlaceholder":67},[36,1486,1487,1489,1491,1493,1495,1497,1499],{"class":38,"line":257},[36,1488,260],{"class":42},[36,1490,263],{"class":46},[36,1492,266],{"class":42},[36,1494,269],{"class":46},[36,1496,272],{"class":85},[36,1498,275],{"class":81},[36,1500,278],{"class":85},[36,1502,1503,1505,1507,1509,1511],{"class":38,"line":281},[36,1504,284],{"class":42},[36,1506,287],{"class":46},[36,1508,272],{"class":85},[36,1510,292],{"class":81},[36,1512,278],{"class":85},[36,1514,1515,1517,1519,1521,1523,1525,1527,1529],{"class":38,"line":297},[36,1516,300],{"class":46},[36,1518,78],{"class":77},[36,1520,287],{"class":46},[36,1522,272],{"class":85},[36,1524,310],{"class":309},[36,1526,272],{"class":85},[36,1528,315],{"class":81},[36,1530,318],{"class":85},[36,1532,1533,1535,1537,1539,1541,1543,1545,1547,1549,1551,1553,1555],{"class":38,"line":321},[36,1534,324],{"class":46},[36,1536,78],{"class":77},[36,1538,329],{"class":46},[36,1540,272],{"class":85},[36,1542,334],{"class":81},[36,1544,86],{"class":85},[36,1546,339],{"class":81},[36,1548,342],{"class":85},[36,1550,132],{"class":89},[36,1552,347],{"class":93},[36,1554,90],{"class":89},[36,1556,99],{"class":85},[36,1558,1559,1561,1563,1565,1567],{"class":38,"line":354},[36,1560,357],{"class":46},[36,1562,78],{"class":77},[36,1564,362],{"class":46},[36,1566,365],{"class":77},[36,1568,368],{"class":46},[36,1570,1571,1573,1575,1577,1579,1581,1583,1585],{"class":38,"line":371},[36,1572,374],{"class":46},[36,1574,272],{"class":85},[36,1576,379],{"class":81},[36,1578,86],{"class":85},[36,1580,385],{"class":384},[36,1582,78],{"class":77},[36,1584,391],{"class":390},[36,1586,99],{"class":85},[36,1588,1589],{"class":38,"line":396},[36,1590,68],{"emptyLinePlaceholder":67},[36,1592,1593,1596,1598,1601,1603,1605,1607],{"class":38,"line":441},[36,1594,1595],{"class":46},"        destination_path ",[36,1597,78],{"class":77},[36,1599,1600],{"class":46}," destination_folder ",[36,1602,365],{"class":77},[36,1604,287],{"class":46},[36,1606,272],{"class":85},[36,1608,1609],{"class":309},"name\n",[36,1611,1612,1615,1617,1621,1624,1628,1630,1632,1634,1637,1640,1642,1645,1647,1649],{"class":38,"line":446},[36,1613,1614],{"class":449},"        print",[36,1616,86],{"class":85},[36,1618,1620],{"class":1619},"sbsja","f",[36,1622,1623],{"class":93},"\"Moving ",[36,1625,1627],{"class":1626},"srdBf","{",[36,1629,415],{"class":81},[36,1631,272],{"class":85},[36,1633,435],{"class":309},[36,1635,1636],{"class":1626},"}",[36,1638,1639],{"class":93}," -> ",[36,1641,1627],{"class":1626},[36,1643,1644],{"class":81},"destination_path",[36,1646,1636],{"class":1626},[36,1648,90],{"class":93},[36,1650,99],{"class":85},[36,1652,1654,1656,1658,1660,1662,1664,1666,1668,1670,1672,1674,1676],{"class":38,"line":1653},24,[36,1655,399],{"class":46},[36,1657,272],{"class":85},[36,1659,404],{"class":81},[36,1661,86],{"class":85},[36,1663,410],{"class":409},[36,1665,86],{"class":85},[36,1667,415],{"class":81},[36,1669,418],{"class":85},[36,1671,421],{"class":409},[36,1673,86],{"class":85},[36,1675,1644],{"class":81},[36,1677,438],{"class":85},[36,1679,1681],{"class":38,"line":1680},25,[36,1682,68],{"emptyLinePlaceholder":67},[36,1684,1686,1688,1690,1692,1694,1696],{"class":38,"line":1685},26,[36,1687,450],{"class":449},[36,1689,86],{"class":85},[36,1691,90],{"class":89},[36,1693,457],{"class":93},[36,1695,90],{"class":89},[36,1697,99],{"class":85},[14,1699,1700],{},"Example output:",[26,1702,1707],{"className":1703,"code":1705,"language":1706,"meta":31},[1704],"language-text","Moving photo.JPG -> downloads\u002Fimages\u002Fphoto.JPG\nMoving notes.txt -> downloads\u002Ftext_files\u002Fnotes.txt\nMoving report.pdf -> downloads\u002Fpdf_files\u002Freport.pdf\nFiles organized.\n","text",[33,1708,1705],{"__ignoreMap":31},[21,1710,1712],{"id":1711},"safety-tips-for-beginners","Safety tips for beginners",[14,1714,1715],{},"Be careful when testing a file-moving script.",[14,1717,1718],{},"Good habits:",[479,1720,1721,1724,1727,1730],{},[482,1722,1723],{},"Run the script on a copy of your files first",[482,1725,1726],{},"Test with a small folder before using a large one",[482,1728,1729],{},"Check that the folder path is correct before running",[482,1731,1732],{},"Watch out for files that have the same name",[14,1734,1735,1736,1738,1739,1742],{},"If you want to make changes without moving files yet, you can temporarily replace the ",[33,1737,1207],{}," line with a ",[33,1740,1741],{},"print(...)"," line. That lets you preview what would happen.",[21,1744,1746],{"id":1745},"common-problems","Common problems",[14,1748,1749],{},"A few problems are common with scripts like this.",[942,1751,1753],{"id":1752},"filenotfounderror",[33,1754,1755],{},"FileNotFoundError",[14,1757,1758],{},"This happens if the source folder does not exist.",[14,1760,1761],{},"Common causes:",[479,1763,1764,1767],{},[482,1765,1766],{},"Using the wrong folder path",[482,1768,1769],{},"Running the script from a different working directory than expected",[14,1771,1772],{},"Useful checks:",[26,1774,1776],{"className":28,"code":1775,"language":30,"meta":31,"style":31},"print(source_folder.resolve())\nprint(source_folder.exists())\n",[33,1777,1778,1794],{"__ignoreMap":31},[36,1779,1780,1782,1784,1786,1788,1791],{"class":38,"line":39},[36,1781,450],{"class":449},[36,1783,86],{"class":85},[36,1785,901],{"class":81},[36,1787,272],{"class":85},[36,1789,1790],{"class":81},"resolve",[36,1792,1793],{"class":85},"())\n",[36,1795,1796,1798,1800,1802,1804,1807],{"class":38,"line":56},[36,1797,450],{"class":449},[36,1799,86],{"class":85},[36,1801,901],{"class":81},[36,1803,272],{"class":85},[36,1805,1806],{"class":81},"exists",[36,1808,1793],{"class":85},[14,1810,1811,1812,272],{},"If you need help with this error, see ",[505,1813,1815],{"href":1814},"\u002Ferrors\u002Ffilenotfounderror-errno-2-no-such-file-or-directory-fix","FileNotFoundError: No such file or directory",[942,1817,1819],{"id":1818},"permissionerror",[33,1820,1821],{},"PermissionError",[14,1823,1824],{},"This happens if Python cannot access the folder or move the files.",[14,1826,1761],{},[479,1828,1829,1832],{},[482,1830,1831],{},"Trying to move files without permission",[482,1833,1834],{},"Using a protected system folder",[14,1836,1837,1838,272],{},"If needed, see ",[505,1839,1841],{"href":1840},"\u002Ferrors\u002Fpermissionerror-errno-13-permission-denied-fix","PermissionError: Permission denied",[942,1843,1845],{"id":1844},"files-with-uppercase-extensions","Files with uppercase extensions",[14,1847,1848,1849,1852,1853,272],{},"Some files may use extensions like ",[33,1850,1851],{},".JPG"," instead of ",[33,1854,124],{},[14,1856,1857],{},"That is why the script uses:",[26,1859,1861],{"className":28,"code":1860,"language":30,"meta":31,"style":31},"item.suffix.lower()\n",[33,1862,1863],{"__ignoreMap":31},[36,1864,1865,1867,1869,1871,1873,1875],{"class":38,"line":39},[36,1866,415],{"class":46},[36,1868,272],{"class":85},[36,1870,310],{"class":309},[36,1872,272],{"class":85},[36,1874,315],{"class":81},[36,1876,318],{"class":85},[14,1878,1879,1880,1883],{},"Without ",[33,1881,1882],{},".lower()",", some files would not match your dictionary rules.",[942,1885,1887],{"id":1886},"duplicate-file-names","Duplicate file names",[14,1889,1890],{},"If two files with the same name are moved into the same folder, one may overwrite the other.",[14,1892,1893],{},"For example:",[479,1895,1896,1901],{},[482,1897,1898],{},[33,1899,1900],{},"downloads\u002Fphoto.jpg",[482,1902,1903,1904,1906],{},"another ",[33,1905,1074],{}," from somewhere else later",[14,1908,1909],{},"A safer version would check whether the destination file already exists before moving.",[942,1911,1913],{"id":1912},"files-with-no-extension","Files with no extension",[14,1915,1916],{},"Some files do not have an extension at all.",[14,1918,1919,1920,1922],{},"In this script, those files will go into the ",[33,1921,347],{}," folder because they do not match any key in the dictionary.",[21,1924,1926],{"id":1925},"common-mistakes-to-check","Common mistakes to check",[14,1928,1929],{},"If the script is not working as expected, these checks can help:",[26,1931,1933],{"className":28,"code":1932,"language":30,"meta":31,"style":31},"print(source_folder.resolve())\nprint(item.name)\nprint(item.suffix.lower())\nprint(destination_folder)\nprint(source_folder.exists())\n",[33,1934,1935,1949,1963,1981,1991],{"__ignoreMap":31},[36,1936,1937,1939,1941,1943,1945,1947],{"class":38,"line":39},[36,1938,450],{"class":449},[36,1940,86],{"class":85},[36,1942,901],{"class":81},[36,1944,272],{"class":85},[36,1946,1790],{"class":81},[36,1948,1793],{"class":85},[36,1950,1951,1953,1955,1957,1959,1961],{"class":38,"line":56},[36,1952,450],{"class":449},[36,1954,86],{"class":85},[36,1956,415],{"class":81},[36,1958,272],{"class":85},[36,1960,435],{"class":309},[36,1962,99],{"class":85},[36,1964,1965,1967,1969,1971,1973,1975,1977,1979],{"class":38,"line":64},[36,1966,450],{"class":449},[36,1968,86],{"class":85},[36,1970,415],{"class":81},[36,1972,272],{"class":85},[36,1974,310],{"class":309},[36,1976,272],{"class":85},[36,1978,315],{"class":81},[36,1980,1793],{"class":85},[36,1982,1983,1985,1987,1989],{"class":38,"line":71},[36,1984,450],{"class":449},[36,1986,86],{"class":85},[36,1988,1173],{"class":81},[36,1990,99],{"class":85},[36,1992,1993,1995,1997,1999,2001,2003],{"class":38,"line":102},[36,1994,450],{"class":449},[36,1996,86],{"class":85},[36,1998,901],{"class":81},[36,2000,272],{"class":85},[36,2002,1806],{"class":81},[36,2004,1793],{"class":85},[14,2006,2007],{},"These print statements help you see:",[479,2009,2010,2013,2016,2019,2022],{},[482,2011,2012],{},"The full folder path Python is using",[482,2014,2015],{},"Each file name being processed",[482,2017,2018],{},"The extension Python reads",[482,2020,2021],{},"The destination folder for that file",[482,2023,2024],{},"Whether the source folder actually exists",[14,2026,2027],{},"Common causes of problems include:",[479,2029,2030,2032,2035,2037,2042],{},[482,2031,1766],{},[482,2033,2034],{},"Running the script in a different working directory than expected",[482,2036,1831],{},[482,2038,2039,2040],{},"Forgetting that extensions can be uppercase like ",[33,2041,1851],{},[482,2043,2044],{},"Not handling duplicate file names in destination folders",[21,2046,2048],{"id":2047},"faq","FAQ",[942,2050,2052],{"id":2051},"does-this-script-move-files-or-copy-them","Does this script move files or copy them?",[14,2054,2055],{},"It moves files. After running, the files are no longer in their original location.",[942,2057,2059],{"id":2058},"can-i-organize-files-by-type-without-using-pathlib","Can I organize files by type without using pathlib?",[14,2061,2062,2063,494,2066,2069,2070,2072,2073,272],{},"Yes. You can use ",[33,2064,2065],{},"os",[33,2067,2068],{},"os.path",", but ",[33,2071,888],{}," is usually easier for beginners to read. If you want a broader overview, see the ",[505,2074,2076],{"href":2075},"\u002Fstandard-library\u002Fpython-os-module-overview","Python os module overview",[942,2078,2080],{"id":2079},"what-happens-to-files-with-unknown-extensions","What happens to files with unknown extensions?",[14,2082,2083,2084,470],{},"In this example, they go into the ",[33,2085,347],{},[942,2087,2089],{"id":2088},"will-this-script-organize-files-inside-subfolders-too","Will this script organize files inside subfolders too?",[14,2091,2092],{},"No. This version only looks at items directly inside the source folder.",[942,2094,2096],{"id":2095},"how-can-i-avoid-overwriting-files-with-the-same-name","How can I avoid overwriting files with the same name?",[14,2098,2099,2100,272],{},"Add a check before moving. Rename the file or skip it if the destination already exists. You may also want to learn ",[505,2101,2103],{"href":2102},"\u002Fhow-to\u002Fhow-to-rename-a-file-in-python","how to rename a file in Python",[21,2105,2107],{"id":2106},"see-also","See also",[479,2109,2110,2115,2120,2124,2130,2134,2138,2143],{},[482,2111,2112],{},[505,2113,2114],{"href":935},"How to list files in a directory in Python",[482,2116,2117],{},[505,2118,2119],{"href":507},"Working with file paths in Python",[482,2121,2122],{},[505,2123,2076],{"href":2075},[482,2125,2126],{},[505,2127,2129],{"href":2128},"\u002Fstandard-library\u002Fos.path.join-function-explained","os.path.join() function explained",[482,2131,2132],{},[505,2133,1815],{"href":1814},[482,2135,2136],{},[505,2137,1841],{"href":1840},[482,2139,2140],{},[505,2141,2142],{"href":2102},"How to rename a file in Python",[482,2144,2145],{},[505,2146,2147],{"href":1200},"How to create a directory in Python",[14,2149,2150,2151,2154],{},"Try changing this example for your own ",[33,2152,2153],{},"Downloads"," folder, or build a safer version that copies files instead of moving them.",[2156,2157,2158],"style",{},"html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s99_P, html code.shiki .s99_P{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#E36209;--shiki-default-font-style:inherit;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit}html pre.shiki code .s39Yj, html code.shiki .s39Yj{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":31,"searchDepth":56,"depth":56,"links":2160},[2161,2162,2163,2164,2165,2173,2174,2175,2176,2183,2184,2191],{"id":23,"depth":56,"text":24},{"id":473,"depth":56,"text":474},{"id":511,"depth":56,"text":512},{"id":544,"depth":56,"text":545},{"id":939,"depth":56,"text":940,"children":2166},[2167,2168,2169,2170,2171,2172],{"id":944,"depth":64,"text":947},{"id":1005,"depth":64,"text":1008},{"id":1034,"depth":64,"text":1037},{"id":1093,"depth":64,"text":1096},{"id":1160,"depth":64,"text":1163},{"id":1204,"depth":64,"text":1207},{"id":1255,"depth":56,"text":1256},{"id":1292,"depth":56,"text":1293},{"id":1711,"depth":56,"text":1712},{"id":1745,"depth":56,"text":1746,"children":2177},[2178,2179,2180,2181,2182],{"id":1752,"depth":64,"text":1755},{"id":1818,"depth":64,"text":1821},{"id":1844,"depth":64,"text":1845},{"id":1886,"depth":64,"text":1887},{"id":1912,"depth":64,"text":1913},{"id":1925,"depth":56,"text":1926},{"id":2047,"depth":56,"text":2048,"children":2185},[2186,2187,2188,2189,2190],{"id":2051,"depth":64,"text":2052},{"id":2058,"depth":64,"text":2059},{"id":2079,"depth":64,"text":2080},{"id":2088,"depth":64,"text":2089},{"id":2095,"depth":64,"text":2096},{"id":2106,"depth":56,"text":2107},"Master python file organizer script example in our comprehensive Python beginner guide.","md",{},"\u002Fexamples\u002Fpython-file-organizer-script-example",{"title":5,"description":2192},"examples\u002Fpython-file-organizer-script-example","jrktYhLn2pyVqUHFOBftbnpXHhaYCL3c_NQWBnHwbTE",1777585507270]