[{"data":1,"prerenderedAt":1117},["ShallowReactive",2],{"doc-\u002Fhow-to\u002Fhow-to-rename-a-file-in-python":3},{"id":4,"title":5,"body":6,"description":1110,"extension":1111,"meta":1112,"navigation":76,"path":1113,"seo":1114,"stem":1115,"__hash__":1116},"content\u002Fhow-to\u002Fhow-to-rename-a-file-in-python.md","How to Rename a File in Python",{"type":7,"value":8,"toc":1087},"minimark",[9,13,22,25,44,49,166,169,172,176,189,193,199,214,255,258,272,275,283,287,290,293,303,384,389,392,407,411,414,417,557,560,571,578,582,585,591,719,722,736,743,747,750,767,771,788,792,795,822,825,864,867,893,896,934,937,944,948,954,976,986,989,992,1002,1005,1009,1013,1016,1020,1023,1027,1030,1037,1041,1046,1050,1083],[10,11,5],"h1",{"id":12},"how-to-rename-a-file-in-python",[14,15,16,17,21],"p",{},"If you want to rename a file in Python, the simplest built-in option is ",[18,19,20],"code",{},"os.rename()",".",[14,23,24],{},"This page shows you how to:",[26,27,28,32,38,41],"ul",{},[29,30,31],"li",{},"Rename one existing file",[29,33,34,35,37],{},"Use Python’s built-in ",[18,36,20],{}," function",[29,39,40],{},"Understand what the old path and new path mean",[29,42,43],{},"Avoid common path and file existence mistakes",[45,46,48],"h2",{"id":47},"quick-answer","Quick answer",[50,51,56],"pre",{"className":52,"code":53,"language":54,"meta":55,"style":55},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","import os\n\nold_name = \"old_file.txt\"\nnew_name = \"new_file.txt\"\n\nos.rename(old_name, new_name)\nprint(\"File renamed\")\n","python","",[18,57,58,71,78,99,114,119,147],{"__ignoreMap":55},[59,60,63,67],"span",{"class":61,"line":62},"line",1,[59,64,66],{"class":65},"sVHd0","import",[59,68,70],{"class":69},"su5hD"," os\n",[59,72,74],{"class":61,"line":73},2,[59,75,77],{"emptyLinePlaceholder":76},true,"\n",[59,79,81,84,88,92,96],{"class":61,"line":80},3,[59,82,83],{"class":69},"old_name ",[59,85,87],{"class":86},"smGrS","=",[59,89,91],{"class":90},"sjJ54"," \"",[59,93,95],{"class":94},"s_sjI","old_file.txt",[59,97,98],{"class":90},"\"\n",[59,100,102,105,107,109,112],{"class":61,"line":101},4,[59,103,104],{"class":69},"new_name ",[59,106,87],{"class":86},[59,108,91],{"class":90},[59,110,111],{"class":94},"new_file.txt",[59,113,98],{"class":90},[59,115,117],{"class":61,"line":116},5,[59,118,77],{"emptyLinePlaceholder":76},[59,120,122,125,128,132,135,138,141,144],{"class":61,"line":121},6,[59,123,124],{"class":69},"os",[59,126,21],{"class":127},"sP7_E",[59,129,131],{"class":130},"slqww","rename",[59,133,134],{"class":127},"(",[59,136,137],{"class":130},"old_name",[59,139,140],{"class":127},",",[59,142,143],{"class":130}," new_name",[59,145,146],{"class":127},")\n",[59,148,150,154,156,159,162,164],{"class":61,"line":149},7,[59,151,153],{"class":152},"sptTA","print",[59,155,134],{"class":127},[59,157,158],{"class":90},"\"",[59,160,161],{"class":94},"File renamed",[59,163,158],{"class":90},[59,165,146],{"class":127},[14,167,168],{},"This works when the file exists and both paths are correct.",[14,170,171],{},"If the file is in a different folder, use full paths instead of just the file names.",[45,173,175],{"id":174},"what-this-page-helps-you-do","What this page helps you do",[26,177,178,180,185,187],{},[29,179,31],{},[29,181,182,183,37],{},"Use Python's built-in ",[18,184,20],{},[29,186,40],{},[29,188,43],{},[45,190,192],{"id":191},"basic-way-to-rename-a-file","Basic way to rename a file",[14,194,195,196,198],{},"To rename a file with ",[18,197,20],{},":",[200,201,202,208,211],"ol",{},[29,203,204,205,207],{},"Import the ",[18,206,124],{}," module",[29,209,210],{},"Pass the current file name as the first argument",[29,212,213],{},"Pass the new file name as the second argument",[50,215,217],{"className":52,"code":216,"language":54,"meta":55,"style":55},"import os\n\nos.rename(\"old_file.txt\", \"new_file.txt\")\n",[18,218,219,225,229],{"__ignoreMap":55},[59,220,221,223],{"class":61,"line":62},[59,222,66],{"class":65},[59,224,70],{"class":69},[59,226,227],{"class":61,"line":73},[59,228,77],{"emptyLinePlaceholder":76},[59,230,231,233,235,237,239,241,243,245,247,249,251,253],{"class":61,"line":80},[59,232,124],{"class":69},[59,234,21],{"class":127},[59,236,131],{"class":130},[59,238,134],{"class":127},[59,240,158],{"class":90},[59,242,95],{"class":94},[59,244,158],{"class":90},[59,246,140],{"class":127},[59,248,91],{"class":90},[59,250,111],{"class":94},[59,252,158],{"class":90},[59,254,146],{"class":127},[14,256,257],{},"In this example:",[26,259,260,266],{},[29,261,262,265],{},[18,263,264],{},"\"old_file.txt\""," is the current name of the file",[29,267,268,271],{},[18,269,270],{},"\"new_file.txt\""," is the new name you want to give it",[14,273,274],{},"Run this code from the folder where the file exists, or use full paths.",[14,276,277,278,21],{},"If you are not sure whether the file is really there, see ",[279,280,282],"a",{"href":281},"\u002Fhow-to\u002Fhow-to-check-if-a-file-exists-in-python","how to check if a file exists in Python",[45,284,286],{"id":285},"example-with-file-names-in-the-current-folder","Example with file names in the current folder",[14,288,289],{},"This is the easiest example for beginners.",[14,291,292],{},"It works when:",[26,294,295,298],{},[29,296,297],{},"Your Python script is in the same folder as the file",[29,299,300,301],{},"The file is already named ",[18,302,95],{},[50,304,306],{"className":52,"code":305,"language":54,"meta":55,"style":55},"import os\n\nold_name = \"old_file.txt\"\nnew_name = \"new_file.txt\"\n\nos.rename(old_name, new_name)\n\nprint(\"Renamed successfully\")\n",[18,307,308,314,318,330,342,346,364,368],{"__ignoreMap":55},[59,309,310,312],{"class":61,"line":62},[59,311,66],{"class":65},[59,313,70],{"class":69},[59,315,316],{"class":61,"line":73},[59,317,77],{"emptyLinePlaceholder":76},[59,319,320,322,324,326,328],{"class":61,"line":80},[59,321,83],{"class":69},[59,323,87],{"class":86},[59,325,91],{"class":90},[59,327,95],{"class":94},[59,329,98],{"class":90},[59,331,332,334,336,338,340],{"class":61,"line":101},[59,333,104],{"class":69},[59,335,87],{"class":86},[59,337,91],{"class":90},[59,339,111],{"class":94},[59,341,98],{"class":90},[59,343,344],{"class":61,"line":116},[59,345,77],{"emptyLinePlaceholder":76},[59,347,348,350,352,354,356,358,360,362],{"class":61,"line":121},[59,349,124],{"class":69},[59,351,21],{"class":127},[59,353,131],{"class":130},[59,355,134],{"class":127},[59,357,137],{"class":130},[59,359,140],{"class":127},[59,361,143],{"class":130},[59,363,146],{"class":127},[59,365,366],{"class":61,"line":149},[59,367,77],{"emptyLinePlaceholder":76},[59,369,371,373,375,377,380,382],{"class":61,"line":370},8,[59,372,153],{"class":152},[59,374,134],{"class":127},[59,376,158],{"class":90},[59,378,379],{"class":94},"Renamed successfully",[59,381,158],{"class":90},[59,383,146],{"class":127},[385,386,388],"h3",{"id":387},"expected-result","Expected result",[14,390,391],{},"After the code runs:",[26,393,394,399,404],{},[29,395,396,398],{},[18,397,95],{}," no longer appears in the folder",[29,400,401,403],{},[18,402,111],{}," appears in the same folder",[29,405,406],{},"The file contents stay the same",[45,408,410],{"id":409},"example-with-full-file-paths","Example with full file paths",[14,412,413],{},"Use full paths when the file is in another folder.",[14,415,416],{},"This helps avoid confusion about the current working directory.",[50,418,420],{"className":52,"code":419,"language":54,"meta":55,"style":55},"import os\n\nold_name = r\"C:\\Users\\YourName\\Documents\\old_file.txt\"\nnew_name = r\"C:\\Users\\YourName\\Documents\\new_file.txt\"\n\nos.rename(old_name, new_name)\n\nprint(\"Renamed successfully\")\n",[18,421,422,428,432,481,517,521,539,543],{"__ignoreMap":55},[59,423,424,426],{"class":61,"line":62},[59,425,66],{"class":65},[59,427,70],{"class":69},[59,429,430],{"class":61,"line":73},[59,431,77],{"emptyLinePlaceholder":76},[59,433,434,436,438,442,444,448,452,455,458,461,465,468,471,474,476,479],{"class":61,"line":80},[59,435,83],{"class":69},[59,437,87],{"class":86},[59,439,441],{"class":440},"sbsja"," r",[59,443,158],{"class":90},[59,445,447],{"class":446},"sQRbd","C:",[59,449,451],{"class":450},"sjYin","\\U",[59,453,454],{"class":446},"sers",[59,456,457],{"class":450},"\\Y",[59,459,460],{"class":446},"ourName",[59,462,464],{"class":463},"stzsN","\\D",[59,466,467],{"class":446},"ocuments",[59,469,470],{"class":450},"\\o",[59,472,473],{"class":446},"ld_file",[59,475,21],{"class":463},[59,477,478],{"class":446},"txt",[59,480,98],{"class":90},[59,482,483,485,487,489,491,493,495,497,499,501,503,505,508,511,513,515],{"class":61,"line":101},[59,484,104],{"class":69},[59,486,87],{"class":86},[59,488,441],{"class":440},[59,490,158],{"class":90},[59,492,447],{"class":446},[59,494,451],{"class":450},[59,496,454],{"class":446},[59,498,457],{"class":450},[59,500,460],{"class":446},[59,502,464],{"class":463},[59,504,467],{"class":446},[59,506,507],{"class":450},"\\n",[59,509,510],{"class":446},"ew_file",[59,512,21],{"class":463},[59,514,478],{"class":446},[59,516,98],{"class":90},[59,518,519],{"class":61,"line":116},[59,520,77],{"emptyLinePlaceholder":76},[59,522,523,525,527,529,531,533,535,537],{"class":61,"line":121},[59,524,124],{"class":69},[59,526,21],{"class":127},[59,528,131],{"class":130},[59,530,134],{"class":127},[59,532,137],{"class":130},[59,534,140],{"class":127},[59,536,143],{"class":130},[59,538,146],{"class":127},[59,540,541],{"class":61,"line":149},[59,542,77],{"emptyLinePlaceholder":76},[59,544,545,547,549,551,553,555],{"class":61,"line":370},[59,546,153],{"class":152},[59,548,134],{"class":127},[59,550,158],{"class":90},[59,552,379],{"class":94},[59,554,158],{"class":90},[59,556,146],{"class":127},[14,558,559],{},"Why this is useful:",[26,561,562,565,568],{},[29,563,564],{},"You tell Python exactly where the file is",[29,566,567],{},"You do not depend on where the script is running",[29,569,570],{},"Path errors are less common",[14,572,573,574,21],{},"If file paths are confusing, read ",[279,575,577],{"href":576},"\u002Flearn\u002Fworking-with-file-paths-in-python","working with file paths in Python",[45,579,581],{"id":580},"check-that-the-file-exists-before-renaming","Check that the file exists before renaming",[14,583,584],{},"A common error is trying to rename a file that is not there.",[14,586,587,588,198],{},"You can check first with ",[18,589,590],{},"os.path.exists()",[50,592,594],{"className":52,"code":593,"language":54,"meta":55,"style":55},"import os\n\nold_name = \"old_file.txt\"\nnew_name = \"new_file.txt\"\n\nif os.path.exists(old_name):\n    os.rename(old_name, new_name)\n    print(\"File renamed\")\nelse:\n    print(\"The file does not exist\")\n",[18,595,596,602,606,618,630,634,660,679,694,703],{"__ignoreMap":55},[59,597,598,600],{"class":61,"line":62},[59,599,66],{"class":65},[59,601,70],{"class":69},[59,603,604],{"class":61,"line":73},[59,605,77],{"emptyLinePlaceholder":76},[59,607,608,610,612,614,616],{"class":61,"line":80},[59,609,83],{"class":69},[59,611,87],{"class":86},[59,613,91],{"class":90},[59,615,95],{"class":94},[59,617,98],{"class":90},[59,619,620,622,624,626,628],{"class":61,"line":101},[59,621,104],{"class":69},[59,623,87],{"class":86},[59,625,91],{"class":90},[59,627,111],{"class":94},[59,629,98],{"class":90},[59,631,632],{"class":61,"line":116},[59,633,77],{"emptyLinePlaceholder":76},[59,635,636,639,642,644,648,650,653,655,657],{"class":61,"line":121},[59,637,638],{"class":65},"if",[59,640,641],{"class":69}," os",[59,643,21],{"class":127},[59,645,647],{"class":646},"skxfh","path",[59,649,21],{"class":127},[59,651,652],{"class":130},"exists",[59,654,134],{"class":127},[59,656,137],{"class":130},[59,658,659],{"class":127},"):\n",[59,661,662,665,667,669,671,673,675,677],{"class":61,"line":149},[59,663,664],{"class":69},"    os",[59,666,21],{"class":127},[59,668,131],{"class":130},[59,670,134],{"class":127},[59,672,137],{"class":130},[59,674,140],{"class":127},[59,676,143],{"class":130},[59,678,146],{"class":127},[59,680,681,684,686,688,690,692],{"class":61,"line":370},[59,682,683],{"class":152},"    print",[59,685,134],{"class":127},[59,687,158],{"class":90},[59,689,161],{"class":94},[59,691,158],{"class":90},[59,693,146],{"class":127},[59,695,697,700],{"class":61,"line":696},9,[59,698,699],{"class":65},"else",[59,701,702],{"class":127},":\n",[59,704,706,708,710,712,715,717],{"class":61,"line":705},10,[59,707,683],{"class":152},[59,709,134],{"class":127},[59,711,158],{"class":90},[59,713,714],{"class":94},"The file does not exist",[59,716,158],{"class":90},[59,718,146],{"class":127},[14,720,721],{},"This is helpful because:",[26,723,724,730,733],{},[29,725,726,727],{},"It can prevent a ",[18,728,729],{},"FileNotFoundError",[29,731,732],{},"It gives you a clearer message",[29,734,735],{},"It makes your code safer",[14,737,738,739,21],{},"If you get this error anyway, see ",[279,740,742],{"href":741},"\u002Ferrors\u002Ffilenotfounderror-in-python-causes-and-fixes","how to fix FileNotFoundError: No such file or directory",[45,744,746],{"id":745},"common-problems-when-renaming-files","Common problems when renaming files",[14,748,749],{},"Here are the most common reasons file renaming fails:",[26,751,752,755,758,761,764],{},[29,753,754],{},"The old file name is wrong",[29,756,757],{},"The file is in a different folder",[29,759,760],{},"The new file name already exists",[29,762,763],{},"You do not have permission to change the file",[29,765,766],{},"You passed a folder path instead of a file path",[385,768,770],{"id":769},"common-causes","Common causes",[26,772,773,776,779,782,785],{},[29,774,775],{},"Misspelled old file name",[29,777,778],{},"Wrong folder or working directory",[29,780,781],{},"Using a path to a directory instead of a file",[29,783,784],{},"Trying to rename a file without permission",[29,786,787],{},"Using relative paths without knowing where the script is running",[385,789,791],{"id":790},"debugging-commands","Debugging commands",[14,793,794],{},"These quick checks can help:",[50,796,798],{"className":52,"code":797,"language":54,"meta":55,"style":55},"import os\nprint(os.getcwd())\n",[18,799,800,806],{"__ignoreMap":55},[59,801,802,804],{"class":61,"line":62},[59,803,66],{"class":65},[59,805,70],{"class":69},[59,807,808,810,812,814,816,819],{"class":61,"line":73},[59,809,153],{"class":152},[59,811,134],{"class":127},[59,813,124],{"class":130},[59,815,21],{"class":127},[59,817,818],{"class":130},"getcwd",[59,820,821],{"class":127},"())\n",[14,823,824],{},"Shows the current working directory.",[50,826,828],{"className":52,"code":827,"language":54,"meta":55,"style":55},"import os\nprint(os.path.exists('old_file.txt'))\n",[18,829,830,836],{"__ignoreMap":55},[59,831,832,834],{"class":61,"line":62},[59,833,66],{"class":65},[59,835,70],{"class":69},[59,837,838,840,842,844,846,848,850,852,854,857,859,861],{"class":61,"line":73},[59,839,153],{"class":152},[59,841,134],{"class":127},[59,843,124],{"class":130},[59,845,21],{"class":127},[59,847,647],{"class":646},[59,849,21],{"class":127},[59,851,652],{"class":130},[59,853,134],{"class":127},[59,855,856],{"class":90},"'",[59,858,95],{"class":94},[59,860,856],{"class":90},[59,862,863],{"class":127},"))\n",[14,865,866],{},"Checks whether the path exists.",[50,868,870],{"className":52,"code":869,"language":54,"meta":55,"style":55},"import os\nprint(os.listdir())\n",[18,871,872,878],{"__ignoreMap":55},[59,873,874,876],{"class":61,"line":62},[59,875,66],{"class":65},[59,877,70],{"class":69},[59,879,880,882,884,886,888,891],{"class":61,"line":73},[59,881,153],{"class":152},[59,883,134],{"class":127},[59,885,124],{"class":130},[59,887,21],{"class":127},[59,889,890],{"class":130},"listdir",[59,892,821],{"class":127},[14,894,895],{},"Shows files and folders in the current directory.",[50,897,899],{"className":52,"code":898,"language":54,"meta":55,"style":55},"import os\nprint(os.path.isfile('old_file.txt'))\n",[18,900,901,907],{"__ignoreMap":55},[59,902,903,905],{"class":61,"line":62},[59,904,66],{"class":65},[59,906,70],{"class":69},[59,908,909,911,913,915,917,919,921,924,926,928,930,932],{"class":61,"line":73},[59,910,153],{"class":152},[59,912,134],{"class":127},[59,914,124],{"class":130},[59,916,21],{"class":127},[59,918,647],{"class":646},[59,920,21],{"class":127},[59,922,923],{"class":130},"isfile",[59,925,134],{"class":127},[59,927,856],{"class":90},[59,929,95],{"class":94},[59,931,856],{"class":90},[59,933,863],{"class":127},[14,935,936],{},"Checks whether the path is a file.",[14,938,939,940,21],{},"If Python says permission is denied, read ",[279,941,943],{"href":942},"\u002Ferrors\u002Fpermissionerror-errno-13-permission-denied-fix","how to fix PermissionError: Errno 13 permission denied",[45,945,947],{"id":946},"when-to-use-osrename-vs-pathlib","When to use os.rename() vs pathlib",[14,949,950,951,953],{},"For a beginner, ",[18,952,20],{}," is a good place to start because it is simple and direct.",[26,955,956,962,968,973],{},[29,957,958,959,961],{},"Use ",[18,960,20],{}," for the simplest example",[29,963,964,967],{},[18,965,966],{},"pathlib"," is also a valid option",[29,969,970,972],{},[18,971,966],{}," often reads more clearly",[29,974,975],{},"This page stays focused on the basic built-in solution",[14,977,978,979,981,982,21],{},"If you want to understand ",[18,980,20],{}," in more detail, see ",[279,983,985],{"href":984},"\u002Fstandard-library\u002Fos.chdir-function-explained","the os.rename() function explained",[45,987,388],{"id":988},"expected-result-1",[14,990,991],{},"When the rename works:",[26,993,994,997,1000],{},[29,995,996],{},"The old file name no longer appears",[29,998,999],{},"The new file name appears in the same folder unless you changed the path",[29,1001,406],{},[14,1003,1004],{},"Also, if the new path points to another folder, the file may be moved and renamed in one step.",[45,1006,1008],{"id":1007},"faq","FAQ",[385,1010,1012],{"id":1011},"does-renaming-a-file-change-its-contents","Does renaming a file change its contents?",[14,1014,1015],{},"No. It changes the file name or path, not the data inside the file.",[385,1017,1019],{"id":1018},"can-i-move-a-file-by-renaming-it","Can I move a file by renaming it?",[14,1021,1022],{},"Yes. If you give a new path in another folder, Python can move and rename it in one step in many cases.",[385,1024,1026],{"id":1025},"what-if-python-says-the-file-does-not-exist","What if Python says the file does not exist?",[14,1028,1029],{},"Check the file name, extension, and folder path.",[14,1031,1032,1033,1036],{},"Also print ",[18,1034,1035],{},"os.getcwd()"," to see where your script is running.",[385,1038,1040],{"id":1039},"what-function-renames-a-file-in-python","What function renames a file in Python?",[14,1042,1043,1044,21],{},"A common built-in option is ",[18,1045,20],{},[45,1047,1049],{"id":1048},"see-also","See also",[26,1051,1052,1057,1062,1067,1072,1077],{},[29,1053,1054],{},[279,1055,1056],{"href":984},"os.rename() function explained",[29,1058,1059],{},[279,1060,1061],{"href":281},"How to check if a file exists in Python",[29,1063,1064],{},[279,1065,1066],{"href":576},"Working with file paths in Python",[29,1068,1069],{},[279,1070,1071],{"href":741},"Fix FileNotFoundError: No such file or directory",[29,1073,1074],{},[279,1075,1076],{"href":942},"Fix PermissionError: Errno 13 permission denied",[29,1078,1079],{},[279,1080,1082],{"href":1081},"\u002Fhow-to\u002Fhow-to-delete-a-file-in-python","How to delete a file in Python",[1084,1085,1086],"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 .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 .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}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 .sQRbd, html code.shiki .sQRbd{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#DBEDFF}html pre.shiki code .sjYin, html code.shiki .sjYin{--shiki-light:#90A4AE;--shiki-light-font-weight:inherit;--shiki-default:#22863A;--shiki-default-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold}html pre.shiki code .stzsN, html code.shiki .stzsN{--shiki-light:#91B859;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":55,"searchDepth":73,"depth":73,"links":1088},[1089,1090,1091,1092,1095,1096,1097,1101,1102,1103,1109],{"id":47,"depth":73,"text":48},{"id":174,"depth":73,"text":175},{"id":191,"depth":73,"text":192},{"id":285,"depth":73,"text":286,"children":1093},[1094],{"id":387,"depth":80,"text":388},{"id":409,"depth":73,"text":410},{"id":580,"depth":73,"text":581},{"id":745,"depth":73,"text":746,"children":1098},[1099,1100],{"id":769,"depth":80,"text":770},{"id":790,"depth":80,"text":791},{"id":946,"depth":73,"text":947},{"id":988,"depth":73,"text":388},{"id":1007,"depth":73,"text":1008,"children":1104},[1105,1106,1107,1108],{"id":1011,"depth":80,"text":1012},{"id":1018,"depth":80,"text":1019},{"id":1025,"depth":80,"text":1026},{"id":1039,"depth":80,"text":1040},{"id":1048,"depth":73,"text":1049},"Master how to rename a file in python in our comprehensive Python beginner guide.","md",{},"\u002Fhow-to\u002Fhow-to-rename-a-file-in-python",{"title":5,"description":1110},"how-to\u002Fhow-to-rename-a-file-in-python","cY9S2bMmuBs21xyTkCj13EE-c_fgijlKPi0ApAszdig",1777585509508]