[{"data":1,"prerenderedAt":4143},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/handle-file-paths":601},[4,22,31,40,49,58,67,76,86,94,103,112,121,130,139,148,158,167,176,185,194,203,212,222,231,240,249,258,267,276,285,297,306,315,324,333,342,351,362,371,380,389,398,407,418,427,436,445,454,463,472,483,492,501,510,519,528,539,548,557,566,575,584,593],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"slug":11,"order":12,"isParent":13,"icon":14,"_type":15,"_id":16,"_source":17,"_file":18,"_stem":19,"_extension":20,"children":21,"expanded":13},"/python-how-to/string-manipulation","python-how-to",false,"","String Manipulation","Learn essential string manipulation techniques in Python","string-manipulation",1,true,"pi pi-folder","markdown","content:python-how-to:1.string-manipulation.md","content","python-how-to/1.string-manipulation.md","python-how-to/1.string-manipulation","md",[22,31,40,49,58,67],{"_path":23,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":15,"_id":28,"_source":17,"_file":29,"_stem":30,"_extension":20},"/python-how-to/split-join-strings","Split and Join Strings","Learn how to split strings into lists and join lists back into strings in Python","split-join-strings",2,"content:python-how-to:2.split-join-strings.md","python-how-to/2.split-join-strings.md","python-how-to/2.split-join-strings",{"_path":32,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":15,"_id":37,"_source":17,"_file":38,"_stem":39,"_extension":20},"/python-how-to/remove-whitespace","Remove Whitespace","Learn how to clean up and remove unwanted whitespace from strings in Python","remove-whitespace",3,"content:python-how-to:3.remove-whitespace.md","python-how-to/3.remove-whitespace.md","python-how-to/3.remove-whitespace",{"_path":41,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":15,"_id":46,"_source":17,"_file":47,"_stem":48,"_extension":20},"/python-how-to/find-replace-text","Find and Replace Text","Learn how to search for and replace text within strings in Python","find-replace-text",4,"content:python-how-to:4.find-replace-text.md","python-how-to/4.find-replace-text.md","python-how-to/4.find-replace-text",{"_path":50,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":15,"_id":55,"_source":17,"_file":56,"_stem":57,"_extension":20},"/python-how-to/check-string-content","Check String Content","Learn how to validate and check the content of strings in Python","check-string-content",5,"content:python-how-to:5.check-string-content.md","python-how-to/5.check-string-content.md","python-how-to/5.check-string-content",{"_path":59,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":15,"_id":64,"_source":17,"_file":65,"_stem":66,"_extension":20},"/python-how-to/format-strings","Format Strings","Learn how to format strings in Python using f-strings and format() method","format-strings",6,"content:python-how-to:6.format-strings.md","python-how-to/6.format-strings.md","python-how-to/6.format-strings",{"_path":68,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":69,"description":70,"slug":71,"parentId":5,"order":72,"_type":15,"_id":73,"_source":17,"_file":74,"_stem":75,"_extension":20},"/python-how-to/unicode-special-chars","Handle Unicode and Special Characters","Learn how to work with Unicode and special characters in Python strings","unicode-special-chars",7,"content:python-how-to:7.unicode-special-chars.md","python-how-to/7.unicode-special-chars.md","python-how-to/7.unicode-special-chars",{"_path":77,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":78,"description":79,"slug":80,"order":81,"isParent":13,"icon":14,"_type":15,"_id":82,"_source":17,"_file":83,"_stem":84,"_extension":20,"children":85,"expanded":13},"/python-how-to/list-operations","List Operations","Learn essential operations for working with lists in Python","list-operations",8,"content:python-how-to:8.list-operations.md","python-how-to/8.list-operations.md","python-how-to/8.list-operations",[86,94,103,112,121,130,139],{"_path":87,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":88,"description":89,"slug":90,"parentId":77,"order":81,"_type":15,"_id":91,"_source":17,"_file":92,"_stem":93,"_extension":20},"/python-how-to/sort-lists","Sort Lists","Learn how to sort lists in Python using different methods and custom sorting","sort-lists","content:python-how-to:9.sort-lists.md","python-how-to/9.sort-lists.md","python-how-to/9.sort-lists",{"_path":95,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":96,"description":97,"slug":98,"parentId":77,"order":99,"_type":15,"_id":100,"_source":17,"_file":101,"_stem":102,"_extension":20},"/python-how-to/remove-duplicates","Remove Duplicates","Learn how to remove duplicate elements from lists in Python","remove-duplicates",10,"content:python-how-to:10.remove-duplicates.md","python-how-to/10.remove-duplicates.md","python-how-to/10.remove-duplicates",{"_path":104,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":105,"description":106,"slug":107,"parentId":77,"order":108,"_type":15,"_id":109,"_source":17,"_file":110,"_stem":111,"_extension":20},"/python-how-to/filter-lists","Filter Lists","Learn how to filter lists in Python using different methods","filter-lists",11,"content:python-how-to:11.filter-lists.md","python-how-to/11.filter-lists.md","python-how-to/11.filter-lists",{"_path":113,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":114,"description":115,"slug":116,"parentId":77,"order":117,"_type":15,"_id":118,"_source":17,"_file":119,"_stem":120,"_extension":20},"/python-how-to/combine-lists","Combine Lists","Learn different methods to combine lists in Python","combine-lists",12,"content:python-how-to:12.combine-lists.md","python-how-to/12.combine-lists.md","python-how-to/12.combine-lists",{"_path":122,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":123,"description":124,"slug":125,"parentId":77,"order":126,"_type":15,"_id":127,"_source":17,"_file":128,"_stem":129,"_extension":20},"/python-how-to/list-comprehensions","Use List Comprehensions","Learn how to create and transform lists efficiently using Python's list comprehension syntax","list-comprehensions",13,"content:python-how-to:13.list-comprehensions.md","python-how-to/13.list-comprehensions.md","python-how-to/13.list-comprehensions",{"_path":131,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":132,"description":133,"slug":134,"parentId":77,"order":135,"_type":15,"_id":136,"_source":17,"_file":137,"_stem":138,"_extension":20},"/python-how-to/nested-lists","Work with Nested Lists","Learn how to work with nested lists (2D arrays) in Python","nested-lists",14,"content:python-how-to:14.nested-lists.md","python-how-to/14.nested-lists.md","python-how-to/14.nested-lists",{"_path":140,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":141,"description":142,"slug":143,"parentId":77,"order":144,"_type":15,"_id":145,"_source":17,"_file":146,"_stem":147,"_extension":20},"/python-how-to/enumerate-zip","Use enumerate() and zip()","Learn how to use enumerate() and zip() for efficient iteration in Python","enumerate-zip",15,"content:python-how-to:15.enumerate-zip.md","python-how-to/15.enumerate-zip.md","python-how-to/15.enumerate-zip",{"_path":149,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":150,"description":151,"slug":152,"order":153,"isParent":13,"icon":14,"_type":15,"_id":154,"_source":17,"_file":155,"_stem":156,"_extension":20,"children":157,"expanded":13},"/python-how-to/dictionary-operations","Dictionary Operations","Learn essential operations for working with dictionaries in Python","dictionary-operations",16,"content:python-how-to:16.dictionary-operations.md","python-how-to/16.dictionary-operations.md","python-how-to/16.dictionary-operations",[158,167,176,185,194,203],{"_path":159,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":160,"description":161,"slug":162,"parentId":149,"order":163,"_type":15,"_id":164,"_source":17,"_file":165,"_stem":166,"_extension":20},"/python-how-to/merge-dictionaries","Merge Dictionaries","Learn different methods to merge dictionaries in Python","merge-dictionaries",17,"content:python-how-to:17.merge-dictionaries.md","python-how-to/17.merge-dictionaries.md","python-how-to/17.merge-dictionaries",{"_path":168,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":169,"description":170,"slug":171,"parentId":149,"order":172,"_type":15,"_id":173,"_source":17,"_file":174,"_stem":175,"_extension":20},"/python-how-to/sort-dictionaries","Sort Dictionaries","Learn how to sort dictionaries by keys or values in Python","sort-dictionaries",18,"content:python-how-to:18.sort-dictionaries.md","python-how-to/18.sort-dictionaries.md","python-how-to/18.sort-dictionaries",{"_path":177,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":178,"description":179,"slug":180,"parentId":149,"order":181,"_type":15,"_id":182,"_source":17,"_file":183,"_stem":184,"_extension":20},"/python-how-to/filter-dictionaries","Filter Dictionaries","Learn how to filter dictionaries based on keys or values in Python","filter-dictionaries",19,"content:python-how-to:19.filter-dictionaries.md","python-how-to/19.filter-dictionaries.md","python-how-to/19.filter-dictionaries",{"_path":186,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":187,"description":188,"slug":189,"parentId":149,"order":190,"_type":15,"_id":191,"_source":17,"_file":192,"_stem":193,"_extension":20},"/python-how-to/handle-missing-keys","Handle Missing Keys","Learn safe ways to access dictionary keys and handle missing values","handle-missing-keys",20,"content:python-how-to:20.handle-missing-keys.md","python-how-to/20.handle-missing-keys.md","python-how-to/20.handle-missing-keys",{"_path":195,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":196,"description":197,"slug":198,"parentId":149,"order":199,"_type":15,"_id":200,"_source":17,"_file":201,"_stem":202,"_extension":20},"/python-how-to/dictionary-comprehensions","Use Dictionary Comprehensions","Learn how to create dictionaries efficiently using comprehensions","dictionary-comprehensions",21,"content:python-how-to:21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions",{"_path":204,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":205,"description":206,"slug":207,"parentId":149,"order":208,"_type":15,"_id":209,"_source":17,"_file":210,"_stem":211,"_extension":20},"/python-how-to/convert-lists-dictionaries","Convert Between Lists and Dictionaries","Learn how to transform data between lists and dictionaries in Python","convert-lists-dictionaries",22,"content:python-how-to:22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries",{"_path":213,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":214,"description":215,"slug":216,"order":217,"isParent":13,"icon":14,"_type":15,"_id":218,"_source":17,"_file":219,"_stem":220,"_extension":20,"children":221,"expanded":13},"/python-how-to/file-operations","File Operations","Learn essential file operations in Python for reading, writing, and managing files","file-operations",23,"content:python-how-to:23.file-operations.md","python-how-to/23.file-operations.md","python-how-to/23.file-operations",[222,231,240,249,258,267,276],{"_path":223,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":224,"description":225,"slug":226,"parentId":213,"order":227,"_type":15,"_id":228,"_source":17,"_file":229,"_stem":230,"_extension":20},"/python-how-to/read-text-files","Read Text Files","Learn how to read text files in Python using different methods","read-text-files",24,"content:python-how-to:24.read-text-files.md","python-how-to/24.read-text-files.md","python-how-to/24.read-text-files",{"_path":232,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":233,"description":234,"slug":235,"parentId":213,"order":236,"_type":15,"_id":237,"_source":17,"_file":238,"_stem":239,"_extension":20},"/python-how-to/write-to-files","Write to Files","Learn how to write and create files in Python using different methods","write-to-files",25,"content:python-how-to:25.write-to-files.md","python-how-to/25.write-to-files.md","python-how-to/25.write-to-files",{"_path":241,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":242,"description":243,"slug":244,"parentId":213,"order":245,"_type":15,"_id":246,"_source":17,"_file":247,"_stem":248,"_extension":20},"/python-how-to/work-csv-files","Work with CSV Files","Learn how to read and write CSV files in Python using the csv module","work-csv-files",26,"content:python-how-to:26.work-csv-files.md","python-how-to/26.work-csv-files.md","python-how-to/26.work-csv-files",{"_path":250,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":251,"description":252,"slug":253,"parentId":213,"order":254,"_type":15,"_id":255,"_source":17,"_file":256,"_stem":257,"_extension":20},"/python-how-to/handle-file-paths","Handle File Paths","Learn how to work with file and directory paths in Python using pathlib and os modules","handle-file-paths",27,"content:python-how-to:27.handle-file-paths.md","python-how-to/27.handle-file-paths.md","python-how-to/27.handle-file-paths",{"_path":259,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":260,"description":261,"slug":262,"parentId":213,"order":263,"_type":15,"_id":264,"_source":17,"_file":265,"_stem":266,"_extension":20},"/python-how-to/work-json-files","Work with JSON Files","Learn how to read and write JSON files in Python using the json module","work-json-files",28,"content:python-how-to:28.work-json-files.md","python-how-to/28.work-json-files.md","python-how-to/28.work-json-files",{"_path":268,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":269,"description":270,"slug":271,"parentId":213,"order":272,"_type":15,"_id":273,"_source":17,"_file":274,"_stem":275,"_extension":20},"/python-how-to/handle-binary-files","Handle Binary Files","Learn how to work with binary files in Python for images, data, and other non-text content","handle-binary-files",29,"content:python-how-to:29.handle-binary-files.md","python-how-to/29.handle-binary-files.md","python-how-to/29.handle-binary-files",{"_path":277,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":278,"description":279,"slug":280,"parentId":213,"order":281,"_type":15,"_id":282,"_source":17,"_file":283,"_stem":284,"_extension":20},"/python-how-to/use-context-managers","Use Context Managers","Learn how to use context managers for safe resource handling in Python","use-context-managers",30,"content:python-how-to:30.use-context-managers.md","python-how-to/30.use-context-managers.md","python-how-to/30.use-context-managers",{"_path":286,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":287,"description":288,"slug":289,"parentId":290,"order":291,"isParent":13,"icon":292,"_type":15,"_id":293,"_source":17,"_file":294,"_stem":295,"_extension":20,"children":296},"/python-how-to/date-and-time","Date and Time","Master Python's date and time handling with datetime, time zones, formatting, and calculations","date-and-time","/python-how-to",31,"pi pi-calendar","content:python-how-to:31.date-and-time.md","python-how-to/31.date-and-time.md","python-how-to/31.date-and-time",[297,306,315,324,333,342],{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":286,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python-how-to/get-current-datetime","Get Current Date/Time","Learn how to get current date, time, and timestamps using Python's datetime module","get-current-datetime",32,"content:python-how-to:32.get-current-datetime.md","python-how-to/32.get-current-datetime.md","python-how-to/32.get-current-datetime",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":286,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python-how-to/format-dates","Format Dates","Master date formatting with strftime, custom formats, and locale-aware formatting for user-friendly displays","format-dates",33,"content:python-how-to:33.format-dates.md","python-how-to/33.format-dates.md","python-how-to/33.format-dates",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":286,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python-how-to/calculate-date-differences","Calculate Date Differences","Learn to calculate time differences, durations, and intervals using Python's timedelta for scheduling and analytics","calculate-date-differences",34,"content:python-how-to:34.calculate-date-differences.md","python-how-to/34.calculate-date-differences.md","python-how-to/34.calculate-date-differences",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":286,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python-how-to/parse-date-strings","Parse Date Strings","Convert text dates into Python datetime objects using strptime, handle multiple formats, and validate date input","parse-date-strings",35,"content:python-how-to:35.parse-date-strings.md","python-how-to/35.parse-date-strings.md","python-how-to/35.parse-date-strings",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":286,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python-how-to/handle-timezones","Handle Timezones","Master timezone handling with zoneinfo, UTC conversions, and timezone-aware datetime objects for global applications","handle-timezones",36,"content:python-how-to:36.handle-timezones.md","python-how-to/36.handle-timezones.md","python-how-to/36.handle-timezones",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":286,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python-how-to/work-with-timestamps","Work with Timestamps","Master Unix timestamps in Python - convert between datetime objects and timestamps for APIs, databases, and system integration","work-with-timestamps",37,"content:python-how-to:37.work-with-timestamps.md","python-how-to/37.work-with-timestamps.md","python-how-to/37.work-with-timestamps",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":290,"order":356,"isParent":13,"icon":357,"_type":15,"_id":358,"_source":17,"_file":359,"_stem":360,"_extension":20,"children":361},"/python-how-to/error-handling","Error Handling","Learn Python's error handling with try/except, custom exceptions, debugging, logging, and retry logic for robust applications","error-handling",38,"pi pi-exclamation-triangle","content:python-how-to:38.error-handling.md","python-how-to/38.error-handling.md","python-how-to/38.error-handling",[362,371,380,389,398],{"_path":363,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":364,"description":365,"slug":366,"parentId":352,"order":367,"_type":15,"_id":368,"_source":17,"_file":369,"_stem":370,"_extension":20},"/python-how-to/handle-exceptions","Handle Exceptions","Master try/except blocks, multiple exception handling, and finally clauses for robust error handling in Python","handle-exceptions",39,"content:python-how-to:39.handle-exceptions.md","python-how-to/39.handle-exceptions.md","python-how-to/39.handle-exceptions",{"_path":372,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":373,"description":374,"slug":375,"parentId":352,"order":376,"_type":15,"_id":377,"_source":17,"_file":378,"_stem":379,"_extension":20},"/python-how-to/create-custom-exceptions","Create Custom Exceptions","Learn to create custom exception classes in Python for specific error handling and better code organization","create-custom-exceptions",40,"content:python-how-to:40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions",{"_path":381,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":382,"description":383,"slug":384,"parentId":352,"order":385,"_type":15,"_id":386,"_source":17,"_file":387,"_stem":388,"_extension":20},"/python-how-to/debug-code","Debug Code","Learn Python debugging techniques using print statements, the debugger, and tools to find and fix code issues","debug-code",41,"content:python-how-to:41.debug-code.md","python-how-to/41.debug-code.md","python-how-to/41.debug-code",{"_path":390,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":391,"description":392,"slug":393,"parentId":352,"order":394,"_type":15,"_id":395,"_source":17,"_file":396,"_stem":397,"_extension":20},"/python-how-to/use-logging","Use Logging","Learn Python's logging module for tracking application behavior, errors, and debugging information","use-logging",42,"content:python-how-to:42.use-logging.md","python-how-to/42.use-logging.md","python-how-to/42.use-logging",{"_path":399,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":400,"description":401,"slug":402,"parentId":352,"order":403,"_type":15,"_id":404,"_source":17,"_file":405,"_stem":406,"_extension":20},"/python-how-to/implement-retry-logic","Implement Retry Logic","Learn to implement retry mechanisms in Python for handling temporary failures and building resilient applications","implement-retry-logic",43,"content:python-how-to:43.implement-retry-logic.md","python-how-to/43.implement-retry-logic.md","python-how-to/43.implement-retry-logic",{"_path":408,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":409,"description":410,"slug":411,"parentId":290,"order":412,"isParent":13,"icon":413,"_type":15,"_id":414,"_source":17,"_file":415,"_stem":416,"_extension":20,"children":417},"/python-how-to/functions-and-modules","Functions and Modules","Learn Python functions, modules, and code organization for building reusable, maintainable applications","functions-and-modules",44,"pi pi-box","content:python-how-to:44.functions-and-modules.md","python-how-to/44.functions-and-modules.md","python-how-to/44.functions-and-modules",[418,427,436,445,454,463],{"_path":419,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":420,"description":421,"slug":422,"parentId":408,"order":423,"_type":15,"_id":424,"_source":17,"_file":425,"_stem":426,"_extension":20},"/python-how-to/write-functions","Write Functions","Learn to create Python functions with parameters, return values, and documentation for reusable code","write-functions",45,"content:python-how-to:45.write-functions.md","python-how-to/45.write-functions.md","python-how-to/45.write-functions",{"_path":428,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":429,"description":430,"slug":431,"parentId":408,"order":432,"_type":15,"_id":433,"_source":17,"_file":434,"_stem":435,"_extension":20},"/python-how-to/use-args-kwargs","Use *args and **kwargs","Learn to use *args and **kwargs for flexible function arguments in Python","use-args-kwargs",46,"content:python-how-to:46.use-args-kwargs.md","python-how-to/46.use-args-kwargs.md","python-how-to/46.use-args-kwargs",{"_path":437,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":438,"description":439,"slug":440,"parentId":408,"order":441,"_type":15,"_id":442,"_source":17,"_file":443,"_stem":444,"_extension":20},"/python-how-to/create-decorators","Create Decorators","Learn to create and use Python decorators to enhance function behavior and add functionality","create-decorators",47,"content:python-how-to:47.create-decorators.md","python-how-to/47.create-decorators.md","python-how-to/47.create-decorators",{"_path":446,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":447,"description":448,"slug":449,"parentId":408,"order":450,"_type":15,"_id":451,"_source":17,"_file":452,"_stem":453,"_extension":20},"/python-how-to/use-generators","Use Generators","Learn to create memory-efficient generators with yield for processing large datasets and sequences","use-generators",48,"content:python-how-to:48.use-generators.md","python-how-to/48.use-generators.md","python-how-to/48.use-generators",{"_path":455,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":456,"description":457,"slug":458,"parentId":408,"order":459,"_type":15,"_id":460,"_source":17,"_file":461,"_stem":462,"_extension":20},"/python-how-to/work-modules-packages","Work with Modules and Packages","Learn to organize Python code with modules and packages, and use imports effectively","work-modules-packages",49,"content:python-how-to:49.work-modules-packages.md","python-how-to/49.work-modules-packages.md","python-how-to/49.work-modules-packages",{"_path":464,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":465,"description":466,"slug":467,"parentId":408,"order":468,"_type":15,"_id":469,"_source":17,"_file":470,"_stem":471,"_extension":20},"/python-how-to/create-virtual-environments","Create Virtual Environments","Learn to create and manage Python virtual environments for project dependency isolation","create-virtual-environments",50,"content:python-how-to:50.create-virtual-environments.md","python-how-to/50.create-virtual-environments.md","python-how-to/50.create-virtual-environments",{"_path":473,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":474,"description":475,"slug":476,"parentId":290,"order":477,"isParent":13,"icon":478,"_type":15,"_id":479,"_source":17,"_file":480,"_stem":481,"_extension":20,"children":482},"/python-how-to/data-processing","Data Processing","Learn Python data processing techniques including regex, APIs, databases, and large file handling","data-processing",51,"pi pi-database","content:python-how-to:51.data-processing.md","python-how-to/51.data-processing.md","python-how-to/51.data-processing",[483,492,501,510,519],{"_path":484,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":485,"description":486,"slug":487,"parentId":473,"order":488,"_type":15,"_id":489,"_source":17,"_file":490,"_stem":491,"_extension":20},"/python-how-to/work-regular-expressions","Work with Regular Expressions","Learn to use Python's re module for pattern matching, text extraction, and data validation","work-regular-expressions",52,"content:python-how-to:52.work-regular-expressions.md","python-how-to/52.work-regular-expressions.md","python-how-to/52.work-regular-expressions",{"_path":493,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":494,"description":495,"slug":496,"parentId":473,"order":497,"_type":15,"_id":498,"_source":17,"_file":499,"_stem":500,"_extension":20},"/python-how-to/parse-xml-html","Parse XML and HTML","Learn to extract data from XML and HTML documents using Python's built-in parsing tools","parse-xml-html",53,"content:python-how-to:53.parse-xml-html.md","python-how-to/53.parse-xml-html.md","python-how-to/53.parse-xml-html",{"_path":502,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":503,"description":504,"slug":505,"parentId":473,"order":506,"_type":15,"_id":507,"_source":17,"_file":508,"_stem":509,"_extension":20},"/python-how-to/handle-api-requests","Handle API Requests","Learn to fetch and process data from web APIs using Python's urllib and external requests library","handle-api-requests",54,"content:python-how-to:54.handle-api-requests.md","python-how-to/54.handle-api-requests.md","python-how-to/54.handle-api-requests",{"_path":511,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":512,"description":513,"slug":514,"parentId":473,"order":515,"_type":15,"_id":516,"_source":17,"_file":517,"_stem":518,"_extension":20},"/python-how-to/work-databases","Work with Databases","Learn to connect to and query SQL databases using Python's sqlite3 and database techniques","work-databases",55,"content:python-how-to:55.work-databases.md","python-how-to/55.work-databases.md","python-how-to/55.work-databases",{"_path":520,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":521,"description":522,"slug":523,"parentId":473,"order":524,"_type":15,"_id":525,"_source":17,"_file":526,"_stem":527,"_extension":20},"/python-how-to/process-large-files","Process Large Files","Learn memory-efficient techniques for handling large files and datasets in Python","process-large-files",56,"content:python-how-to:56.process-large-files.md","python-how-to/56.process-large-files.md","python-how-to/56.process-large-files",{"_path":529,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":530,"description":531,"slug":532,"parentId":290,"order":533,"isParent":13,"icon":534,"_type":15,"_id":535,"_source":17,"_file":536,"_stem":537,"_extension":20,"children":538},"/python-how-to/best-practices","Best Practices","Learn Python best practices for writing clean, maintainable, and efficient code","best-practices",57,"pi pi-star","content:python-how-to:57.best-practices.md","python-how-to/57.best-practices.md","python-how-to/57.best-practices",[539,548,557,566,575,584],{"_path":540,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":541,"description":542,"slug":543,"parentId":529,"order":544,"_type":15,"_id":545,"_source":17,"_file":546,"_stem":547,"_extension":20},"/python-how-to/structure-code","Structure Your Code","Learn to organize Python code with proper module structure, functions, and classes","structure-code",58,"content:python-how-to:58.structure-code.md","python-how-to/58.structure-code.md","python-how-to/58.structure-code",{"_path":549,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":550,"description":551,"slug":552,"parentId":529,"order":553,"_type":15,"_id":554,"_source":17,"_file":555,"_stem":556,"_extension":20},"/python-how-to/write-clean-code","Write Clean Code","Learn to write readable, maintainable Python code with proper naming, comments, and clear logic","write-clean-code",59,"content:python-how-to:59.write-clean-code.md","python-how-to/59.write-clean-code.md","python-how-to/59.write-clean-code",{"_path":558,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":559,"description":560,"slug":561,"parentId":529,"order":562,"_type":15,"_id":563,"_source":17,"_file":564,"_stem":565,"_extension":20},"/python-how-to/optimize-performance","Optimize Performance","Learn to identify and fix performance bottlenecks in Python code for faster execution","optimize-performance",60,"content:python-how-to:60.optimize-performance.md","python-how-to/60.optimize-performance.md","python-how-to/60.optimize-performance",{"_path":567,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":568,"description":569,"slug":570,"parentId":529,"order":571,"_type":15,"_id":572,"_source":17,"_file":573,"_stem":574,"_extension":20},"/python-how-to/write-unit-tests","Write Unit Tests","Learn to create reliable unit tests to verify your Python code works correctly and catch bugs early","write-unit-tests",61,"content:python-how-to:61.write-unit-tests.md","python-how-to/61.write-unit-tests.md","python-how-to/61.write-unit-tests",{"_path":576,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":577,"description":578,"slug":579,"parentId":529,"order":580,"_type":15,"_id":581,"_source":17,"_file":582,"_stem":583,"_extension":20},"/python-how-to/document-code","Document Your Code","Learn to write clear documentation and helpful comments for your Python code","document-code",62,"content:python-how-to:62.document-code.md","python-how-to/62.document-code.md","python-how-to/62.document-code",{"_path":585,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":586,"description":587,"slug":588,"parentId":529,"order":589,"_type":15,"_id":590,"_source":17,"_file":591,"_stem":592,"_extension":20},"/python-how-to/use-type-hints","Use Type Hints","Learn to add type annotations to Python code for better clarity, tooling support, and error detection","use-type-hints",63,"content:python-how-to:63.use-type-hints.md","python-how-to/63.use-type-hints.md","python-how-to/63.use-type-hints",{"_path":290,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":594,"description":595,"slug":6,"order":596,"icon":14,"_type":15,"_id":597,"_source":17,"_file":598,"_stem":599,"_extension":20},"Python How-To Guide","Practical Python tutorials for common programming tasks. Learn step-by-step solutions for string manipulation, file operations, data processing, and more with real-world examples.",0,"content:python-how-to:index.md","python-how-to/index.md","python-how-to/index",[249],{"_path":250,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":251,"description":252,"slug":253,"parentId":213,"order":254,"body":602,"_type":15,"_id":255,"_source":17,"_file":256,"_stem":257,"_extension":20},{"type":603,"children":604,"toc":4128},"root",[605,614,637,854,861,866,956,963,1291,1297,1640,1646,1907,1913,1918,1924,2332,2338,2606,2612,3242,3248,3665,3671,3976,3982,4122],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"️-handling-file-paths",[611],{"type":612,"value":613},"text","🗂️ Handling File Paths",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618,620,627,629,635],{"type":612,"value":619},"Python provides powerful tools for working with file and directory paths. The modern ",{"type":606,"tag":621,"props":622,"children":624},"code",{"className":623},[],[625],{"type":612,"value":626},"pathlib",{"type":612,"value":628}," module and traditional ",{"type":606,"tag":621,"props":630,"children":632},{"className":631},[],[633],{"type":612,"value":634},"os.path",{"type":612,"value":636}," module offer cross-platform path handling.",{"type":606,"tag":638,"props":639,"children":640},"code-try",{},[641],{"type":606,"tag":642,"props":643,"children":647},"pre",{"className":644,"code":645,"language":646,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","from pathlib import Path\n\n# Basic path operations\nfile_path = Path('documents/report.txt')\nprint(f\"File name: {file_path.name}\")\nprint(f\"Parent directory: {file_path.parent}\")\nprint(f\"File exists: {file_path.exists()}\")\n","python",[648],{"type":606,"tag":621,"props":649,"children":650},{"__ignoreMap":8},[651,678,686,695,724,772,813],{"type":606,"tag":652,"props":653,"children":655},"span",{"class":654,"line":12},"line",[656,662,668,673],{"type":606,"tag":652,"props":657,"children":659},{"style":658},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[660],{"type":612,"value":661},"from",{"type":606,"tag":652,"props":663,"children":665},{"style":664},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[666],{"type":612,"value":667}," pathlib ",{"type":606,"tag":652,"props":669,"children":670},{"style":658},[671],{"type":612,"value":672},"import",{"type":606,"tag":652,"props":674,"children":675},{"style":664},[676],{"type":612,"value":677}," Path\n",{"type":606,"tag":652,"props":679,"children":680},{"class":654,"line":27},[681],{"type":606,"tag":652,"props":682,"children":683},{"emptyLinePlaceholder":13},[684],{"type":612,"value":685},"\n",{"type":606,"tag":652,"props":687,"children":688},{"class":654,"line":36},[689],{"type":606,"tag":652,"props":690,"children":692},{"style":691},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[693],{"type":612,"value":694},"# Basic path operations\n",{"type":606,"tag":652,"props":696,"children":697},{"class":654,"line":45},[698,703,708,713,719],{"type":606,"tag":652,"props":699,"children":700},{"style":664},[701],{"type":612,"value":702},"file_path ",{"type":606,"tag":652,"props":704,"children":705},{"style":658},[706],{"type":612,"value":707},"=",{"type":606,"tag":652,"props":709,"children":710},{"style":664},[711],{"type":612,"value":712}," Path(",{"type":606,"tag":652,"props":714,"children":716},{"style":715},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[717],{"type":612,"value":718},"'documents/report.txt'",{"type":606,"tag":652,"props":720,"children":721},{"style":664},[722],{"type":612,"value":723},")\n",{"type":606,"tag":652,"props":725,"children":726},{"class":654,"line":54},[727,733,738,743,748,753,758,763,768],{"type":606,"tag":652,"props":728,"children":730},{"style":729},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[731],{"type":612,"value":732},"print",{"type":606,"tag":652,"props":734,"children":735},{"style":664},[736],{"type":612,"value":737},"(",{"type":606,"tag":652,"props":739,"children":740},{"style":658},[741],{"type":612,"value":742},"f",{"type":606,"tag":652,"props":744,"children":745},{"style":715},[746],{"type":612,"value":747},"\"File name: ",{"type":606,"tag":652,"props":749,"children":750},{"style":729},[751],{"type":612,"value":752},"{",{"type":606,"tag":652,"props":754,"children":755},{"style":664},[756],{"type":612,"value":757},"file_path.name",{"type":606,"tag":652,"props":759,"children":760},{"style":729},[761],{"type":612,"value":762},"}",{"type":606,"tag":652,"props":764,"children":765},{"style":715},[766],{"type":612,"value":767},"\"",{"type":606,"tag":652,"props":769,"children":770},{"style":664},[771],{"type":612,"value":723},{"type":606,"tag":652,"props":773,"children":774},{"class":654,"line":63},[775,779,783,787,792,796,801,805,809],{"type":606,"tag":652,"props":776,"children":777},{"style":729},[778],{"type":612,"value":732},{"type":606,"tag":652,"props":780,"children":781},{"style":664},[782],{"type":612,"value":737},{"type":606,"tag":652,"props":784,"children":785},{"style":658},[786],{"type":612,"value":742},{"type":606,"tag":652,"props":788,"children":789},{"style":715},[790],{"type":612,"value":791},"\"Parent directory: ",{"type":606,"tag":652,"props":793,"children":794},{"style":729},[795],{"type":612,"value":752},{"type":606,"tag":652,"props":797,"children":798},{"style":664},[799],{"type":612,"value":800},"file_path.parent",{"type":606,"tag":652,"props":802,"children":803},{"style":729},[804],{"type":612,"value":762},{"type":606,"tag":652,"props":806,"children":807},{"style":715},[808],{"type":612,"value":767},{"type":606,"tag":652,"props":810,"children":811},{"style":664},[812],{"type":612,"value":723},{"type":606,"tag":652,"props":814,"children":815},{"class":654,"line":72},[816,820,824,828,833,837,842,846,850],{"type":606,"tag":652,"props":817,"children":818},{"style":729},[819],{"type":612,"value":732},{"type":606,"tag":652,"props":821,"children":822},{"style":664},[823],{"type":612,"value":737},{"type":606,"tag":652,"props":825,"children":826},{"style":658},[827],{"type":612,"value":742},{"type":606,"tag":652,"props":829,"children":830},{"style":715},[831],{"type":612,"value":832},"\"File exists: ",{"type":606,"tag":652,"props":834,"children":835},{"style":729},[836],{"type":612,"value":752},{"type":606,"tag":652,"props":838,"children":839},{"style":664},[840],{"type":612,"value":841},"file_path.exists()",{"type":606,"tag":652,"props":843,"children":844},{"style":729},[845],{"type":612,"value":762},{"type":606,"tag":652,"props":847,"children":848},{"style":715},[849],{"type":612,"value":767},{"type":606,"tag":652,"props":851,"children":852},{"style":664},[853],{"type":612,"value":723},{"type":606,"tag":855,"props":856,"children":858},"h2",{"id":857},"path-modules",[859],{"type":612,"value":860},"🎯 Path Modules",{"type":606,"tag":615,"props":862,"children":863},{},[864],{"type":612,"value":865},"Python offers two main approaches for path handling.",{"type":606,"tag":867,"props":868,"children":872},"info-box",{"emoji":869,"title":870,"type":871},"📝","Path Handling Modules","info",[873,882,908,916,939],{"type":606,"tag":615,"props":874,"children":875},{},[876],{"type":606,"tag":877,"props":878,"children":879},"strong",{},[880],{"type":612,"value":881},"Modern Approach:",{"type":606,"tag":883,"props":884,"children":885},"ul",{},[886,898,903],{"type":606,"tag":887,"props":888,"children":889},"li",{},[890,896],{"type":606,"tag":621,"props":891,"children":893},{"className":892},[],[894],{"type":612,"value":895},"pathlib.Path",{"type":612,"value":897},": Object-oriented paths",{"type":606,"tag":887,"props":899,"children":900},{},[901],{"type":612,"value":902},"Cross-platform compatibility",{"type":606,"tag":887,"props":904,"children":905},{},[906],{"type":612,"value":907},"Intuitive method names",{"type":606,"tag":615,"props":909,"children":910},{},[911],{"type":606,"tag":877,"props":912,"children":913},{},[914],{"type":612,"value":915},"Traditional Approach:",{"type":606,"tag":883,"props":917,"children":918},{},[919,929,934],{"type":606,"tag":887,"props":920,"children":921},{},[922,927],{"type":606,"tag":621,"props":923,"children":925},{"className":924},[],[926],{"type":612,"value":634},{"type":612,"value":928},": Function-based paths",{"type":606,"tag":887,"props":930,"children":931},{},[932],{"type":612,"value":933},"Legacy compatibility",{"type":606,"tag":887,"props":935,"children":936},{},[937],{"type":612,"value":938},"String-based operations",{"type":606,"tag":615,"props":940,"children":941},{},[942,947,949,954],{"type":606,"tag":877,"props":943,"children":944},{},[945],{"type":612,"value":946},"Recommendation:",{"type":612,"value":948}," Use ",{"type":606,"tag":621,"props":950,"children":952},{"className":951},[],[953],{"type":612,"value":626},{"type":612,"value":955}," for new code",{"type":606,"tag":957,"props":958,"children":960},"h3",{"id":959},"path-creation-and-properties",[961],{"type":612,"value":962},"Path Creation and Properties",{"type":606,"tag":638,"props":964,"children":965},{},[966],{"type":606,"tag":642,"props":967,"children":969},{"className":644,"code":968,"language":646,"meta":8,"style":8},"from pathlib import Path\n\n# Creating paths\nfile_path = Path('documents/reports/annual.txt')\nprint(f\"Path: {file_path}\")\n\n# Path properties\nprint(f\"Name: {file_path.name}\")\nprint(f\"Suffix: {file_path.suffix}\")\nprint(f\"Stem: {file_path.stem}\")\nprint(f\"Parent: {file_path.parent}\")\nprint(f\"Parts: {file_path.parts}\")\n",[970],{"type":606,"tag":621,"props":971,"children":972},{"__ignoreMap":8},[973,992,999,1007,1031,1072,1079,1087,1127,1169,1210,1250],{"type":606,"tag":652,"props":974,"children":975},{"class":654,"line":12},[976,980,984,988],{"type":606,"tag":652,"props":977,"children":978},{"style":658},[979],{"type":612,"value":661},{"type":606,"tag":652,"props":981,"children":982},{"style":664},[983],{"type":612,"value":667},{"type":606,"tag":652,"props":985,"children":986},{"style":658},[987],{"type":612,"value":672},{"type":606,"tag":652,"props":989,"children":990},{"style":664},[991],{"type":612,"value":677},{"type":606,"tag":652,"props":993,"children":994},{"class":654,"line":27},[995],{"type":606,"tag":652,"props":996,"children":997},{"emptyLinePlaceholder":13},[998],{"type":612,"value":685},{"type":606,"tag":652,"props":1000,"children":1001},{"class":654,"line":36},[1002],{"type":606,"tag":652,"props":1003,"children":1004},{"style":691},[1005],{"type":612,"value":1006},"# Creating paths\n",{"type":606,"tag":652,"props":1008,"children":1009},{"class":654,"line":45},[1010,1014,1018,1022,1027],{"type":606,"tag":652,"props":1011,"children":1012},{"style":664},[1013],{"type":612,"value":702},{"type":606,"tag":652,"props":1015,"children":1016},{"style":658},[1017],{"type":612,"value":707},{"type":606,"tag":652,"props":1019,"children":1020},{"style":664},[1021],{"type":612,"value":712},{"type":606,"tag":652,"props":1023,"children":1024},{"style":715},[1025],{"type":612,"value":1026},"'documents/reports/annual.txt'",{"type":606,"tag":652,"props":1028,"children":1029},{"style":664},[1030],{"type":612,"value":723},{"type":606,"tag":652,"props":1032,"children":1033},{"class":654,"line":54},[1034,1038,1042,1046,1051,1055,1060,1064,1068],{"type":606,"tag":652,"props":1035,"children":1036},{"style":729},[1037],{"type":612,"value":732},{"type":606,"tag":652,"props":1039,"children":1040},{"style":664},[1041],{"type":612,"value":737},{"type":606,"tag":652,"props":1043,"children":1044},{"style":658},[1045],{"type":612,"value":742},{"type":606,"tag":652,"props":1047,"children":1048},{"style":715},[1049],{"type":612,"value":1050},"\"Path: ",{"type":606,"tag":652,"props":1052,"children":1053},{"style":729},[1054],{"type":612,"value":752},{"type":606,"tag":652,"props":1056,"children":1057},{"style":664},[1058],{"type":612,"value":1059},"file_path",{"type":606,"tag":652,"props":1061,"children":1062},{"style":729},[1063],{"type":612,"value":762},{"type":606,"tag":652,"props":1065,"children":1066},{"style":715},[1067],{"type":612,"value":767},{"type":606,"tag":652,"props":1069,"children":1070},{"style":664},[1071],{"type":612,"value":723},{"type":606,"tag":652,"props":1073,"children":1074},{"class":654,"line":63},[1075],{"type":606,"tag":652,"props":1076,"children":1077},{"emptyLinePlaceholder":13},[1078],{"type":612,"value":685},{"type":606,"tag":652,"props":1080,"children":1081},{"class":654,"line":72},[1082],{"type":606,"tag":652,"props":1083,"children":1084},{"style":691},[1085],{"type":612,"value":1086},"# Path properties\n",{"type":606,"tag":652,"props":1088,"children":1089},{"class":654,"line":81},[1090,1094,1098,1102,1107,1111,1115,1119,1123],{"type":606,"tag":652,"props":1091,"children":1092},{"style":729},[1093],{"type":612,"value":732},{"type":606,"tag":652,"props":1095,"children":1096},{"style":664},[1097],{"type":612,"value":737},{"type":606,"tag":652,"props":1099,"children":1100},{"style":658},[1101],{"type":612,"value":742},{"type":606,"tag":652,"props":1103,"children":1104},{"style":715},[1105],{"type":612,"value":1106},"\"Name: ",{"type":606,"tag":652,"props":1108,"children":1109},{"style":729},[1110],{"type":612,"value":752},{"type":606,"tag":652,"props":1112,"children":1113},{"style":664},[1114],{"type":612,"value":757},{"type":606,"tag":652,"props":1116,"children":1117},{"style":729},[1118],{"type":612,"value":762},{"type":606,"tag":652,"props":1120,"children":1121},{"style":715},[1122],{"type":612,"value":767},{"type":606,"tag":652,"props":1124,"children":1125},{"style":664},[1126],{"type":612,"value":723},{"type":606,"tag":652,"props":1128,"children":1130},{"class":654,"line":1129},9,[1131,1135,1139,1143,1148,1152,1157,1161,1165],{"type":606,"tag":652,"props":1132,"children":1133},{"style":729},[1134],{"type":612,"value":732},{"type":606,"tag":652,"props":1136,"children":1137},{"style":664},[1138],{"type":612,"value":737},{"type":606,"tag":652,"props":1140,"children":1141},{"style":658},[1142],{"type":612,"value":742},{"type":606,"tag":652,"props":1144,"children":1145},{"style":715},[1146],{"type":612,"value":1147},"\"Suffix: ",{"type":606,"tag":652,"props":1149,"children":1150},{"style":729},[1151],{"type":612,"value":752},{"type":606,"tag":652,"props":1153,"children":1154},{"style":664},[1155],{"type":612,"value":1156},"file_path.suffix",{"type":606,"tag":652,"props":1158,"children":1159},{"style":729},[1160],{"type":612,"value":762},{"type":606,"tag":652,"props":1162,"children":1163},{"style":715},[1164],{"type":612,"value":767},{"type":606,"tag":652,"props":1166,"children":1167},{"style":664},[1168],{"type":612,"value":723},{"type":606,"tag":652,"props":1170,"children":1171},{"class":654,"line":99},[1172,1176,1180,1184,1189,1193,1198,1202,1206],{"type":606,"tag":652,"props":1173,"children":1174},{"style":729},[1175],{"type":612,"value":732},{"type":606,"tag":652,"props":1177,"children":1178},{"style":664},[1179],{"type":612,"value":737},{"type":606,"tag":652,"props":1181,"children":1182},{"style":658},[1183],{"type":612,"value":742},{"type":606,"tag":652,"props":1185,"children":1186},{"style":715},[1187],{"type":612,"value":1188},"\"Stem: ",{"type":606,"tag":652,"props":1190,"children":1191},{"style":729},[1192],{"type":612,"value":752},{"type":606,"tag":652,"props":1194,"children":1195},{"style":664},[1196],{"type":612,"value":1197},"file_path.stem",{"type":606,"tag":652,"props":1199,"children":1200},{"style":729},[1201],{"type":612,"value":762},{"type":606,"tag":652,"props":1203,"children":1204},{"style":715},[1205],{"type":612,"value":767},{"type":606,"tag":652,"props":1207,"children":1208},{"style":664},[1209],{"type":612,"value":723},{"type":606,"tag":652,"props":1211,"children":1212},{"class":654,"line":108},[1213,1217,1221,1225,1230,1234,1238,1242,1246],{"type":606,"tag":652,"props":1214,"children":1215},{"style":729},[1216],{"type":612,"value":732},{"type":606,"tag":652,"props":1218,"children":1219},{"style":664},[1220],{"type":612,"value":737},{"type":606,"tag":652,"props":1222,"children":1223},{"style":658},[1224],{"type":612,"value":742},{"type":606,"tag":652,"props":1226,"children":1227},{"style":715},[1228],{"type":612,"value":1229},"\"Parent: ",{"type":606,"tag":652,"props":1231,"children":1232},{"style":729},[1233],{"type":612,"value":752},{"type":606,"tag":652,"props":1235,"children":1236},{"style":664},[1237],{"type":612,"value":800},{"type":606,"tag":652,"props":1239,"children":1240},{"style":729},[1241],{"type":612,"value":762},{"type":606,"tag":652,"props":1243,"children":1244},{"style":715},[1245],{"type":612,"value":767},{"type":606,"tag":652,"props":1247,"children":1248},{"style":664},[1249],{"type":612,"value":723},{"type":606,"tag":652,"props":1251,"children":1252},{"class":654,"line":117},[1253,1257,1261,1265,1270,1274,1279,1283,1287],{"type":606,"tag":652,"props":1254,"children":1255},{"style":729},[1256],{"type":612,"value":732},{"type":606,"tag":652,"props":1258,"children":1259},{"style":664},[1260],{"type":612,"value":737},{"type":606,"tag":652,"props":1262,"children":1263},{"style":658},[1264],{"type":612,"value":742},{"type":606,"tag":652,"props":1266,"children":1267},{"style":715},[1268],{"type":612,"value":1269},"\"Parts: ",{"type":606,"tag":652,"props":1271,"children":1272},{"style":729},[1273],{"type":612,"value":752},{"type":606,"tag":652,"props":1275,"children":1276},{"style":664},[1277],{"type":612,"value":1278},"file_path.parts",{"type":606,"tag":652,"props":1280,"children":1281},{"style":729},[1282],{"type":612,"value":762},{"type":606,"tag":652,"props":1284,"children":1285},{"style":715},[1286],{"type":612,"value":767},{"type":606,"tag":652,"props":1288,"children":1289},{"style":664},[1290],{"type":612,"value":723},{"type":606,"tag":957,"props":1292,"children":1294},{"id":1293},"path-operations",[1295],{"type":612,"value":1296},"Path Operations",{"type":606,"tag":638,"props":1298,"children":1299},{},[1300],{"type":606,"tag":642,"props":1301,"children":1303},{"className":644,"code":1302,"language":646,"meta":8,"style":8},"# Path operations and checks\nprint(f\"Absolute path: {file_path.absolute()}\")\nprint(f\"Exists: {file_path.exists()}\")\nprint(f\"Is file: {file_path.is_file()}\")\nprint(f\"Is directory: {file_path.is_dir()}\")\n\n# Creating new paths from existing\nnew_path = file_path.with_suffix('.pdf')\nprint(f\"New path: {new_path}\")\n\nbackup_path = file_path.with_name('backup_' + file_path.name)\nprint(f\"Backup path: {backup_path}\")\n",[1304],{"type":606,"tag":621,"props":1305,"children":1306},{"__ignoreMap":8},[1307,1315,1356,1396,1437,1478,1485,1493,1519,1560,1567,1599],{"type":606,"tag":652,"props":1308,"children":1309},{"class":654,"line":12},[1310],{"type":606,"tag":652,"props":1311,"children":1312},{"style":691},[1313],{"type":612,"value":1314},"# Path operations and checks\n",{"type":606,"tag":652,"props":1316,"children":1317},{"class":654,"line":27},[1318,1322,1326,1330,1335,1339,1344,1348,1352],{"type":606,"tag":652,"props":1319,"children":1320},{"style":729},[1321],{"type":612,"value":732},{"type":606,"tag":652,"props":1323,"children":1324},{"style":664},[1325],{"type":612,"value":737},{"type":606,"tag":652,"props":1327,"children":1328},{"style":658},[1329],{"type":612,"value":742},{"type":606,"tag":652,"props":1331,"children":1332},{"style":715},[1333],{"type":612,"value":1334},"\"Absolute path: ",{"type":606,"tag":652,"props":1336,"children":1337},{"style":729},[1338],{"type":612,"value":752},{"type":606,"tag":652,"props":1340,"children":1341},{"style":664},[1342],{"type":612,"value":1343},"file_path.absolute()",{"type":606,"tag":652,"props":1345,"children":1346},{"style":729},[1347],{"type":612,"value":762},{"type":606,"tag":652,"props":1349,"children":1350},{"style":715},[1351],{"type":612,"value":767},{"type":606,"tag":652,"props":1353,"children":1354},{"style":664},[1355],{"type":612,"value":723},{"type":606,"tag":652,"props":1357,"children":1358},{"class":654,"line":36},[1359,1363,1367,1371,1376,1380,1384,1388,1392],{"type":606,"tag":652,"props":1360,"children":1361},{"style":729},[1362],{"type":612,"value":732},{"type":606,"tag":652,"props":1364,"children":1365},{"style":664},[1366],{"type":612,"value":737},{"type":606,"tag":652,"props":1368,"children":1369},{"style":658},[1370],{"type":612,"value":742},{"type":606,"tag":652,"props":1372,"children":1373},{"style":715},[1374],{"type":612,"value":1375},"\"Exists: ",{"type":606,"tag":652,"props":1377,"children":1378},{"style":729},[1379],{"type":612,"value":752},{"type":606,"tag":652,"props":1381,"children":1382},{"style":664},[1383],{"type":612,"value":841},{"type":606,"tag":652,"props":1385,"children":1386},{"style":729},[1387],{"type":612,"value":762},{"type":606,"tag":652,"props":1389,"children":1390},{"style":715},[1391],{"type":612,"value":767},{"type":606,"tag":652,"props":1393,"children":1394},{"style":664},[1395],{"type":612,"value":723},{"type":606,"tag":652,"props":1397,"children":1398},{"class":654,"line":45},[1399,1403,1407,1411,1416,1420,1425,1429,1433],{"type":606,"tag":652,"props":1400,"children":1401},{"style":729},[1402],{"type":612,"value":732},{"type":606,"tag":652,"props":1404,"children":1405},{"style":664},[1406],{"type":612,"value":737},{"type":606,"tag":652,"props":1408,"children":1409},{"style":658},[1410],{"type":612,"value":742},{"type":606,"tag":652,"props":1412,"children":1413},{"style":715},[1414],{"type":612,"value":1415},"\"Is file: ",{"type":606,"tag":652,"props":1417,"children":1418},{"style":729},[1419],{"type":612,"value":752},{"type":606,"tag":652,"props":1421,"children":1422},{"style":664},[1423],{"type":612,"value":1424},"file_path.is_file()",{"type":606,"tag":652,"props":1426,"children":1427},{"style":729},[1428],{"type":612,"value":762},{"type":606,"tag":652,"props":1430,"children":1431},{"style":715},[1432],{"type":612,"value":767},{"type":606,"tag":652,"props":1434,"children":1435},{"style":664},[1436],{"type":612,"value":723},{"type":606,"tag":652,"props":1438,"children":1439},{"class":654,"line":54},[1440,1444,1448,1452,1457,1461,1466,1470,1474],{"type":606,"tag":652,"props":1441,"children":1442},{"style":729},[1443],{"type":612,"value":732},{"type":606,"tag":652,"props":1445,"children":1446},{"style":664},[1447],{"type":612,"value":737},{"type":606,"tag":652,"props":1449,"children":1450},{"style":658},[1451],{"type":612,"value":742},{"type":606,"tag":652,"props":1453,"children":1454},{"style":715},[1455],{"type":612,"value":1456},"\"Is directory: ",{"type":606,"tag":652,"props":1458,"children":1459},{"style":729},[1460],{"type":612,"value":752},{"type":606,"tag":652,"props":1462,"children":1463},{"style":664},[1464],{"type":612,"value":1465},"file_path.is_dir()",{"type":606,"tag":652,"props":1467,"children":1468},{"style":729},[1469],{"type":612,"value":762},{"type":606,"tag":652,"props":1471,"children":1472},{"style":715},[1473],{"type":612,"value":767},{"type":606,"tag":652,"props":1475,"children":1476},{"style":664},[1477],{"type":612,"value":723},{"type":606,"tag":652,"props":1479,"children":1480},{"class":654,"line":63},[1481],{"type":606,"tag":652,"props":1482,"children":1483},{"emptyLinePlaceholder":13},[1484],{"type":612,"value":685},{"type":606,"tag":652,"props":1486,"children":1487},{"class":654,"line":72},[1488],{"type":606,"tag":652,"props":1489,"children":1490},{"style":691},[1491],{"type":612,"value":1492},"# Creating new paths from existing\n",{"type":606,"tag":652,"props":1494,"children":1495},{"class":654,"line":81},[1496,1501,1505,1510,1515],{"type":606,"tag":652,"props":1497,"children":1498},{"style":664},[1499],{"type":612,"value":1500},"new_path ",{"type":606,"tag":652,"props":1502,"children":1503},{"style":658},[1504],{"type":612,"value":707},{"type":606,"tag":652,"props":1506,"children":1507},{"style":664},[1508],{"type":612,"value":1509}," file_path.with_suffix(",{"type":606,"tag":652,"props":1511,"children":1512},{"style":715},[1513],{"type":612,"value":1514},"'.pdf'",{"type":606,"tag":652,"props":1516,"children":1517},{"style":664},[1518],{"type":612,"value":723},{"type":606,"tag":652,"props":1520,"children":1521},{"class":654,"line":1129},[1522,1526,1530,1534,1539,1543,1548,1552,1556],{"type":606,"tag":652,"props":1523,"children":1524},{"style":729},[1525],{"type":612,"value":732},{"type":606,"tag":652,"props":1527,"children":1528},{"style":664},[1529],{"type":612,"value":737},{"type":606,"tag":652,"props":1531,"children":1532},{"style":658},[1533],{"type":612,"value":742},{"type":606,"tag":652,"props":1535,"children":1536},{"style":715},[1537],{"type":612,"value":1538},"\"New path: ",{"type":606,"tag":652,"props":1540,"children":1541},{"style":729},[1542],{"type":612,"value":752},{"type":606,"tag":652,"props":1544,"children":1545},{"style":664},[1546],{"type":612,"value":1547},"new_path",{"type":606,"tag":652,"props":1549,"children":1550},{"style":729},[1551],{"type":612,"value":762},{"type":606,"tag":652,"props":1553,"children":1554},{"style":715},[1555],{"type":612,"value":767},{"type":606,"tag":652,"props":1557,"children":1558},{"style":664},[1559],{"type":612,"value":723},{"type":606,"tag":652,"props":1561,"children":1562},{"class":654,"line":99},[1563],{"type":606,"tag":652,"props":1564,"children":1565},{"emptyLinePlaceholder":13},[1566],{"type":612,"value":685},{"type":606,"tag":652,"props":1568,"children":1569},{"class":654,"line":108},[1570,1575,1579,1584,1589,1594],{"type":606,"tag":652,"props":1571,"children":1572},{"style":664},[1573],{"type":612,"value":1574},"backup_path ",{"type":606,"tag":652,"props":1576,"children":1577},{"style":658},[1578],{"type":612,"value":707},{"type":606,"tag":652,"props":1580,"children":1581},{"style":664},[1582],{"type":612,"value":1583}," file_path.with_name(",{"type":606,"tag":652,"props":1585,"children":1586},{"style":715},[1587],{"type":612,"value":1588},"'backup_'",{"type":606,"tag":652,"props":1590,"children":1591},{"style":658},[1592],{"type":612,"value":1593}," +",{"type":606,"tag":652,"props":1595,"children":1596},{"style":664},[1597],{"type":612,"value":1598}," file_path.name)\n",{"type":606,"tag":652,"props":1600,"children":1601},{"class":654,"line":117},[1602,1606,1610,1614,1619,1623,1628,1632,1636],{"type":606,"tag":652,"props":1603,"children":1604},{"style":729},[1605],{"type":612,"value":732},{"type":606,"tag":652,"props":1607,"children":1608},{"style":664},[1609],{"type":612,"value":737},{"type":606,"tag":652,"props":1611,"children":1612},{"style":658},[1613],{"type":612,"value":742},{"type":606,"tag":652,"props":1615,"children":1616},{"style":715},[1617],{"type":612,"value":1618},"\"Backup path: ",{"type":606,"tag":652,"props":1620,"children":1621},{"style":729},[1622],{"type":612,"value":752},{"type":606,"tag":652,"props":1624,"children":1625},{"style":664},[1626],{"type":612,"value":1627},"backup_path",{"type":606,"tag":652,"props":1629,"children":1630},{"style":729},[1631],{"type":612,"value":762},{"type":606,"tag":652,"props":1633,"children":1634},{"style":715},[1635],{"type":612,"value":767},{"type":606,"tag":652,"props":1637,"children":1638},{"style":664},[1639],{"type":612,"value":723},{"type":606,"tag":957,"props":1641,"children":1643},{"id":1642},"path-joining-and-navigation",[1644],{"type":612,"value":1645},"Path Joining and Navigation",{"type":606,"tag":638,"props":1647,"children":1648},{},[1649],{"type":606,"tag":642,"props":1650,"children":1652},{"className":644,"code":1651,"language":646,"meta":8,"style":8},"# Joining paths\nbase_dir = Path('projects')\nproject_path = base_dir / 'my_project' / 'src' / 'main.py'\nprint(f\"Joined path: {project_path}\")\n\n# Current directory operations\ncurrent_dir = Path.cwd()\nhome_dir = Path.home()\nprint(f\"Current directory: {current_dir}\")\nprint(f\"Home directory: {home_dir}\")\n",[1653],{"type":606,"tag":621,"props":1654,"children":1655},{"__ignoreMap":8},[1656,1664,1689,1735,1776,1783,1791,1808,1825,1866],{"type":606,"tag":652,"props":1657,"children":1658},{"class":654,"line":12},[1659],{"type":606,"tag":652,"props":1660,"children":1661},{"style":691},[1662],{"type":612,"value":1663},"# Joining paths\n",{"type":606,"tag":652,"props":1665,"children":1666},{"class":654,"line":27},[1667,1672,1676,1680,1685],{"type":606,"tag":652,"props":1668,"children":1669},{"style":664},[1670],{"type":612,"value":1671},"base_dir ",{"type":606,"tag":652,"props":1673,"children":1674},{"style":658},[1675],{"type":612,"value":707},{"type":606,"tag":652,"props":1677,"children":1678},{"style":664},[1679],{"type":612,"value":712},{"type":606,"tag":652,"props":1681,"children":1682},{"style":715},[1683],{"type":612,"value":1684},"'projects'",{"type":606,"tag":652,"props":1686,"children":1687},{"style":664},[1688],{"type":612,"value":723},{"type":606,"tag":652,"props":1690,"children":1691},{"class":654,"line":36},[1692,1697,1701,1706,1711,1716,1721,1726,1730],{"type":606,"tag":652,"props":1693,"children":1694},{"style":664},[1695],{"type":612,"value":1696},"project_path ",{"type":606,"tag":652,"props":1698,"children":1699},{"style":658},[1700],{"type":612,"value":707},{"type":606,"tag":652,"props":1702,"children":1703},{"style":664},[1704],{"type":612,"value":1705}," base_dir ",{"type":606,"tag":652,"props":1707,"children":1708},{"style":658},[1709],{"type":612,"value":1710},"/",{"type":606,"tag":652,"props":1712,"children":1713},{"style":715},[1714],{"type":612,"value":1715}," 'my_project'",{"type":606,"tag":652,"props":1717,"children":1718},{"style":658},[1719],{"type":612,"value":1720}," /",{"type":606,"tag":652,"props":1722,"children":1723},{"style":715},[1724],{"type":612,"value":1725}," 'src'",{"type":606,"tag":652,"props":1727,"children":1728},{"style":658},[1729],{"type":612,"value":1720},{"type":606,"tag":652,"props":1731,"children":1732},{"style":715},[1733],{"type":612,"value":1734}," 'main.py'\n",{"type":606,"tag":652,"props":1736,"children":1737},{"class":654,"line":45},[1738,1742,1746,1750,1755,1759,1764,1768,1772],{"type":606,"tag":652,"props":1739,"children":1740},{"style":729},[1741],{"type":612,"value":732},{"type":606,"tag":652,"props":1743,"children":1744},{"style":664},[1745],{"type":612,"value":737},{"type":606,"tag":652,"props":1747,"children":1748},{"style":658},[1749],{"type":612,"value":742},{"type":606,"tag":652,"props":1751,"children":1752},{"style":715},[1753],{"type":612,"value":1754},"\"Joined path: ",{"type":606,"tag":652,"props":1756,"children":1757},{"style":729},[1758],{"type":612,"value":752},{"type":606,"tag":652,"props":1760,"children":1761},{"style":664},[1762],{"type":612,"value":1763},"project_path",{"type":606,"tag":652,"props":1765,"children":1766},{"style":729},[1767],{"type":612,"value":762},{"type":606,"tag":652,"props":1769,"children":1770},{"style":715},[1771],{"type":612,"value":767},{"type":606,"tag":652,"props":1773,"children":1774},{"style":664},[1775],{"type":612,"value":723},{"type":606,"tag":652,"props":1777,"children":1778},{"class":654,"line":54},[1779],{"type":606,"tag":652,"props":1780,"children":1781},{"emptyLinePlaceholder":13},[1782],{"type":612,"value":685},{"type":606,"tag":652,"props":1784,"children":1785},{"class":654,"line":63},[1786],{"type":606,"tag":652,"props":1787,"children":1788},{"style":691},[1789],{"type":612,"value":1790},"# Current directory operations\n",{"type":606,"tag":652,"props":1792,"children":1793},{"class":654,"line":72},[1794,1799,1803],{"type":606,"tag":652,"props":1795,"children":1796},{"style":664},[1797],{"type":612,"value":1798},"current_dir ",{"type":606,"tag":652,"props":1800,"children":1801},{"style":658},[1802],{"type":612,"value":707},{"type":606,"tag":652,"props":1804,"children":1805},{"style":664},[1806],{"type":612,"value":1807}," Path.cwd()\n",{"type":606,"tag":652,"props":1809,"children":1810},{"class":654,"line":81},[1811,1816,1820],{"type":606,"tag":652,"props":1812,"children":1813},{"style":664},[1814],{"type":612,"value":1815},"home_dir ",{"type":606,"tag":652,"props":1817,"children":1818},{"style":658},[1819],{"type":612,"value":707},{"type":606,"tag":652,"props":1821,"children":1822},{"style":664},[1823],{"type":612,"value":1824}," Path.home()\n",{"type":606,"tag":652,"props":1826,"children":1827},{"class":654,"line":1129},[1828,1832,1836,1840,1845,1849,1854,1858,1862],{"type":606,"tag":652,"props":1829,"children":1830},{"style":729},[1831],{"type":612,"value":732},{"type":606,"tag":652,"props":1833,"children":1834},{"style":664},[1835],{"type":612,"value":737},{"type":606,"tag":652,"props":1837,"children":1838},{"style":658},[1839],{"type":612,"value":742},{"type":606,"tag":652,"props":1841,"children":1842},{"style":715},[1843],{"type":612,"value":1844},"\"Current directory: ",{"type":606,"tag":652,"props":1846,"children":1847},{"style":729},[1848],{"type":612,"value":752},{"type":606,"tag":652,"props":1850,"children":1851},{"style":664},[1852],{"type":612,"value":1853},"current_dir",{"type":606,"tag":652,"props":1855,"children":1856},{"style":729},[1857],{"type":612,"value":762},{"type":606,"tag":652,"props":1859,"children":1860},{"style":715},[1861],{"type":612,"value":767},{"type":606,"tag":652,"props":1863,"children":1864},{"style":664},[1865],{"type":612,"value":723},{"type":606,"tag":652,"props":1867,"children":1868},{"class":654,"line":99},[1869,1873,1877,1881,1886,1890,1895,1899,1903],{"type":606,"tag":652,"props":1870,"children":1871},{"style":729},[1872],{"type":612,"value":732},{"type":606,"tag":652,"props":1874,"children":1875},{"style":664},[1876],{"type":612,"value":737},{"type":606,"tag":652,"props":1878,"children":1879},{"style":658},[1880],{"type":612,"value":742},{"type":606,"tag":652,"props":1882,"children":1883},{"style":715},[1884],{"type":612,"value":1885},"\"Home directory: ",{"type":606,"tag":652,"props":1887,"children":1888},{"style":729},[1889],{"type":612,"value":752},{"type":606,"tag":652,"props":1891,"children":1892},{"style":664},[1893],{"type":612,"value":1894},"home_dir",{"type":606,"tag":652,"props":1896,"children":1897},{"style":729},[1898],{"type":612,"value":762},{"type":606,"tag":652,"props":1900,"children":1901},{"style":715},[1902],{"type":612,"value":767},{"type":606,"tag":652,"props":1904,"children":1905},{"style":664},[1906],{"type":612,"value":723},{"type":606,"tag":855,"props":1908,"children":1910},{"id":1909},"advanced-path-operations",[1911],{"type":612,"value":1912},"🔍 Advanced Path Operations",{"type":606,"tag":615,"props":1914,"children":1915},{},[1916],{"type":612,"value":1917},"Python allows sophisticated path manipulation and file system operations.",{"type":606,"tag":957,"props":1919,"children":1921},{"id":1920},"directory-operations",[1922],{"type":612,"value":1923},"Directory Operations",{"type":606,"tag":638,"props":1925,"children":1926},{},[1927],{"type":606,"tag":642,"props":1928,"children":1930},{"className":644,"code":1929,"language":646,"meta":8,"style":8},"from pathlib import Path\n\n# Directory creation and structure\nproject_dir = Path('my_project')\n\n# Create directory structure\n(project_dir / 'src').mkdir(parents=True, exist_ok=True)\n(project_dir / 'tests').mkdir(exist_ok=True)\n(project_dir / 'docs').mkdir(exist_ok=True)\n\nprint(f\"Created directory structure in {project_dir}\")\n\n# List directory contents\nfor item in project_dir.iterdir():\n    if item.is_dir():\n        print(f\"Directory: {item.name}\")\n    else:\n        print(f\"File: {item.name}\")\n",[1931],{"type":606,"tag":621,"props":1932,"children":1933},{"__ignoreMap":8},[1934,1953,1960,1968,1993,2000,2008,2066,2102,2138,2145,2186,2193,2201,2224,2237,2279,2292],{"type":606,"tag":652,"props":1935,"children":1936},{"class":654,"line":12},[1937,1941,1945,1949],{"type":606,"tag":652,"props":1938,"children":1939},{"style":658},[1940],{"type":612,"value":661},{"type":606,"tag":652,"props":1942,"children":1943},{"style":664},[1944],{"type":612,"value":667},{"type":606,"tag":652,"props":1946,"children":1947},{"style":658},[1948],{"type":612,"value":672},{"type":606,"tag":652,"props":1950,"children":1951},{"style":664},[1952],{"type":612,"value":677},{"type":606,"tag":652,"props":1954,"children":1955},{"class":654,"line":27},[1956],{"type":606,"tag":652,"props":1957,"children":1958},{"emptyLinePlaceholder":13},[1959],{"type":612,"value":685},{"type":606,"tag":652,"props":1961,"children":1962},{"class":654,"line":36},[1963],{"type":606,"tag":652,"props":1964,"children":1965},{"style":691},[1966],{"type":612,"value":1967},"# Directory creation and structure\n",{"type":606,"tag":652,"props":1969,"children":1970},{"class":654,"line":45},[1971,1976,1980,1984,1989],{"type":606,"tag":652,"props":1972,"children":1973},{"style":664},[1974],{"type":612,"value":1975},"project_dir ",{"type":606,"tag":652,"props":1977,"children":1978},{"style":658},[1979],{"type":612,"value":707},{"type":606,"tag":652,"props":1981,"children":1982},{"style":664},[1983],{"type":612,"value":712},{"type":606,"tag":652,"props":1985,"children":1986},{"style":715},[1987],{"type":612,"value":1988},"'my_project'",{"type":606,"tag":652,"props":1990,"children":1991},{"style":664},[1992],{"type":612,"value":723},{"type":606,"tag":652,"props":1994,"children":1995},{"class":654,"line":54},[1996],{"type":606,"tag":652,"props":1997,"children":1998},{"emptyLinePlaceholder":13},[1999],{"type":612,"value":685},{"type":606,"tag":652,"props":2001,"children":2002},{"class":654,"line":63},[2003],{"type":606,"tag":652,"props":2004,"children":2005},{"style":691},[2006],{"type":612,"value":2007},"# Create directory structure\n",{"type":606,"tag":652,"props":2009,"children":2010},{"class":654,"line":72},[2011,2016,2020,2024,2029,2035,2039,2044,2049,2054,2058,2062],{"type":606,"tag":652,"props":2012,"children":2013},{"style":664},[2014],{"type":612,"value":2015},"(project_dir ",{"type":606,"tag":652,"props":2017,"children":2018},{"style":658},[2019],{"type":612,"value":1710},{"type":606,"tag":652,"props":2021,"children":2022},{"style":715},[2023],{"type":612,"value":1725},{"type":606,"tag":652,"props":2025,"children":2026},{"style":664},[2027],{"type":612,"value":2028},").mkdir(",{"type":606,"tag":652,"props":2030,"children":2032},{"style":2031},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[2033],{"type":612,"value":2034},"parents",{"type":606,"tag":652,"props":2036,"children":2037},{"style":658},[2038],{"type":612,"value":707},{"type":606,"tag":652,"props":2040,"children":2041},{"style":729},[2042],{"type":612,"value":2043},"True",{"type":606,"tag":652,"props":2045,"children":2046},{"style":664},[2047],{"type":612,"value":2048},", ",{"type":606,"tag":652,"props":2050,"children":2051},{"style":2031},[2052],{"type":612,"value":2053},"exist_ok",{"type":606,"tag":652,"props":2055,"children":2056},{"style":658},[2057],{"type":612,"value":707},{"type":606,"tag":652,"props":2059,"children":2060},{"style":729},[2061],{"type":612,"value":2043},{"type":606,"tag":652,"props":2063,"children":2064},{"style":664},[2065],{"type":612,"value":723},{"type":606,"tag":652,"props":2067,"children":2068},{"class":654,"line":81},[2069,2073,2077,2082,2086,2090,2094,2098],{"type":606,"tag":652,"props":2070,"children":2071},{"style":664},[2072],{"type":612,"value":2015},{"type":606,"tag":652,"props":2074,"children":2075},{"style":658},[2076],{"type":612,"value":1710},{"type":606,"tag":652,"props":2078,"children":2079},{"style":715},[2080],{"type":612,"value":2081}," 'tests'",{"type":606,"tag":652,"props":2083,"children":2084},{"style":664},[2085],{"type":612,"value":2028},{"type":606,"tag":652,"props":2087,"children":2088},{"style":2031},[2089],{"type":612,"value":2053},{"type":606,"tag":652,"props":2091,"children":2092},{"style":658},[2093],{"type":612,"value":707},{"type":606,"tag":652,"props":2095,"children":2096},{"style":729},[2097],{"type":612,"value":2043},{"type":606,"tag":652,"props":2099,"children":2100},{"style":664},[2101],{"type":612,"value":723},{"type":606,"tag":652,"props":2103,"children":2104},{"class":654,"line":1129},[2105,2109,2113,2118,2122,2126,2130,2134],{"type":606,"tag":652,"props":2106,"children":2107},{"style":664},[2108],{"type":612,"value":2015},{"type":606,"tag":652,"props":2110,"children":2111},{"style":658},[2112],{"type":612,"value":1710},{"type":606,"tag":652,"props":2114,"children":2115},{"style":715},[2116],{"type":612,"value":2117}," 'docs'",{"type":606,"tag":652,"props":2119,"children":2120},{"style":664},[2121],{"type":612,"value":2028},{"type":606,"tag":652,"props":2123,"children":2124},{"style":2031},[2125],{"type":612,"value":2053},{"type":606,"tag":652,"props":2127,"children":2128},{"style":658},[2129],{"type":612,"value":707},{"type":606,"tag":652,"props":2131,"children":2132},{"style":729},[2133],{"type":612,"value":2043},{"type":606,"tag":652,"props":2135,"children":2136},{"style":664},[2137],{"type":612,"value":723},{"type":606,"tag":652,"props":2139,"children":2140},{"class":654,"line":99},[2141],{"type":606,"tag":652,"props":2142,"children":2143},{"emptyLinePlaceholder":13},[2144],{"type":612,"value":685},{"type":606,"tag":652,"props":2146,"children":2147},{"class":654,"line":108},[2148,2152,2156,2160,2165,2169,2174,2178,2182],{"type":606,"tag":652,"props":2149,"children":2150},{"style":729},[2151],{"type":612,"value":732},{"type":606,"tag":652,"props":2153,"children":2154},{"style":664},[2155],{"type":612,"value":737},{"type":606,"tag":652,"props":2157,"children":2158},{"style":658},[2159],{"type":612,"value":742},{"type":606,"tag":652,"props":2161,"children":2162},{"style":715},[2163],{"type":612,"value":2164},"\"Created directory structure in ",{"type":606,"tag":652,"props":2166,"children":2167},{"style":729},[2168],{"type":612,"value":752},{"type":606,"tag":652,"props":2170,"children":2171},{"style":664},[2172],{"type":612,"value":2173},"project_dir",{"type":606,"tag":652,"props":2175,"children":2176},{"style":729},[2177],{"type":612,"value":762},{"type":606,"tag":652,"props":2179,"children":2180},{"style":715},[2181],{"type":612,"value":767},{"type":606,"tag":652,"props":2183,"children":2184},{"style":664},[2185],{"type":612,"value":723},{"type":606,"tag":652,"props":2187,"children":2188},{"class":654,"line":117},[2189],{"type":606,"tag":652,"props":2190,"children":2191},{"emptyLinePlaceholder":13},[2192],{"type":612,"value":685},{"type":606,"tag":652,"props":2194,"children":2195},{"class":654,"line":126},[2196],{"type":606,"tag":652,"props":2197,"children":2198},{"style":691},[2199],{"type":612,"value":2200},"# List directory contents\n",{"type":606,"tag":652,"props":2202,"children":2203},{"class":654,"line":135},[2204,2209,2214,2219],{"type":606,"tag":652,"props":2205,"children":2206},{"style":658},[2207],{"type":612,"value":2208},"for",{"type":606,"tag":652,"props":2210,"children":2211},{"style":664},[2212],{"type":612,"value":2213}," item ",{"type":606,"tag":652,"props":2215,"children":2216},{"style":658},[2217],{"type":612,"value":2218},"in",{"type":606,"tag":652,"props":2220,"children":2221},{"style":664},[2222],{"type":612,"value":2223}," project_dir.iterdir():\n",{"type":606,"tag":652,"props":2225,"children":2226},{"class":654,"line":144},[2227,2232],{"type":606,"tag":652,"props":2228,"children":2229},{"style":658},[2230],{"type":612,"value":2231},"    if",{"type":606,"tag":652,"props":2233,"children":2234},{"style":664},[2235],{"type":612,"value":2236}," item.is_dir():\n",{"type":606,"tag":652,"props":2238,"children":2239},{"class":654,"line":153},[2240,2245,2249,2253,2258,2262,2267,2271,2275],{"type":606,"tag":652,"props":2241,"children":2242},{"style":729},[2243],{"type":612,"value":2244},"        print",{"type":606,"tag":652,"props":2246,"children":2247},{"style":664},[2248],{"type":612,"value":737},{"type":606,"tag":652,"props":2250,"children":2251},{"style":658},[2252],{"type":612,"value":742},{"type":606,"tag":652,"props":2254,"children":2255},{"style":715},[2256],{"type":612,"value":2257},"\"Directory: ",{"type":606,"tag":652,"props":2259,"children":2260},{"style":729},[2261],{"type":612,"value":752},{"type":606,"tag":652,"props":2263,"children":2264},{"style":664},[2265],{"type":612,"value":2266},"item.name",{"type":606,"tag":652,"props":2268,"children":2269},{"style":729},[2270],{"type":612,"value":762},{"type":606,"tag":652,"props":2272,"children":2273},{"style":715},[2274],{"type":612,"value":767},{"type":606,"tag":652,"props":2276,"children":2277},{"style":664},[2278],{"type":612,"value":723},{"type":606,"tag":652,"props":2280,"children":2281},{"class":654,"line":163},[2282,2287],{"type":606,"tag":652,"props":2283,"children":2284},{"style":658},[2285],{"type":612,"value":2286},"    else",{"type":606,"tag":652,"props":2288,"children":2289},{"style":664},[2290],{"type":612,"value":2291},":\n",{"type":606,"tag":652,"props":2293,"children":2294},{"class":654,"line":172},[2295,2299,2303,2307,2312,2316,2320,2324,2328],{"type":606,"tag":652,"props":2296,"children":2297},{"style":729},[2298],{"type":612,"value":2244},{"type":606,"tag":652,"props":2300,"children":2301},{"style":664},[2302],{"type":612,"value":737},{"type":606,"tag":652,"props":2304,"children":2305},{"style":658},[2306],{"type":612,"value":742},{"type":606,"tag":652,"props":2308,"children":2309},{"style":715},[2310],{"type":612,"value":2311},"\"File: ",{"type":606,"tag":652,"props":2313,"children":2314},{"style":729},[2315],{"type":612,"value":752},{"type":606,"tag":652,"props":2317,"children":2318},{"style":664},[2319],{"type":612,"value":2266},{"type":606,"tag":652,"props":2321,"children":2322},{"style":729},[2323],{"type":612,"value":762},{"type":606,"tag":652,"props":2325,"children":2326},{"style":715},[2327],{"type":612,"value":767},{"type":606,"tag":652,"props":2329,"children":2330},{"style":664},[2331],{"type":612,"value":723},{"type":606,"tag":957,"props":2333,"children":2335},{"id":2334},"file-pattern-matching",[2336],{"type":612,"value":2337},"File Pattern Matching",{"type":606,"tag":638,"props":2339,"children":2340},{},[2341],{"type":606,"tag":642,"props":2342,"children":2344},{"className":644,"code":2343,"language":646,"meta":8,"style":8},"# Find files with patterns\npy_files = list(project_dir.rglob('*.py'))\nprint(f\"Python files: {py_files}\")\n\ntxt_files = list(project_dir.glob('**/*.txt'))\nprint(f\"Text files: {txt_files}\")\n\n# Find files in specific directory\nsrc_files = list((project_dir / 'src').glob('*'))\nprint(f\"Files in src: {src_files}\")\n",[2345],{"type":606,"tag":621,"props":2346,"children":2347},{"__ignoreMap":8},[2348,2356,2388,2429,2436,2466,2507,2514,2522,2565],{"type":606,"tag":652,"props":2349,"children":2350},{"class":654,"line":12},[2351],{"type":606,"tag":652,"props":2352,"children":2353},{"style":691},[2354],{"type":612,"value":2355},"# Find files with patterns\n",{"type":606,"tag":652,"props":2357,"children":2358},{"class":654,"line":27},[2359,2364,2368,2373,2378,2383],{"type":606,"tag":652,"props":2360,"children":2361},{"style":664},[2362],{"type":612,"value":2363},"py_files ",{"type":606,"tag":652,"props":2365,"children":2366},{"style":658},[2367],{"type":612,"value":707},{"type":606,"tag":652,"props":2369,"children":2370},{"style":729},[2371],{"type":612,"value":2372}," list",{"type":606,"tag":652,"props":2374,"children":2375},{"style":664},[2376],{"type":612,"value":2377},"(project_dir.rglob(",{"type":606,"tag":652,"props":2379,"children":2380},{"style":715},[2381],{"type":612,"value":2382},"'*.py'",{"type":606,"tag":652,"props":2384,"children":2385},{"style":664},[2386],{"type":612,"value":2387},"))\n",{"type":606,"tag":652,"props":2389,"children":2390},{"class":654,"line":36},[2391,2395,2399,2403,2408,2412,2417,2421,2425],{"type":606,"tag":652,"props":2392,"children":2393},{"style":729},[2394],{"type":612,"value":732},{"type":606,"tag":652,"props":2396,"children":2397},{"style":664},[2398],{"type":612,"value":737},{"type":606,"tag":652,"props":2400,"children":2401},{"style":658},[2402],{"type":612,"value":742},{"type":606,"tag":652,"props":2404,"children":2405},{"style":715},[2406],{"type":612,"value":2407},"\"Python files: ",{"type":606,"tag":652,"props":2409,"children":2410},{"style":729},[2411],{"type":612,"value":752},{"type":606,"tag":652,"props":2413,"children":2414},{"style":664},[2415],{"type":612,"value":2416},"py_files",{"type":606,"tag":652,"props":2418,"children":2419},{"style":729},[2420],{"type":612,"value":762},{"type":606,"tag":652,"props":2422,"children":2423},{"style":715},[2424],{"type":612,"value":767},{"type":606,"tag":652,"props":2426,"children":2427},{"style":664},[2428],{"type":612,"value":723},{"type":606,"tag":652,"props":2430,"children":2431},{"class":654,"line":45},[2432],{"type":606,"tag":652,"props":2433,"children":2434},{"emptyLinePlaceholder":13},[2435],{"type":612,"value":685},{"type":606,"tag":652,"props":2437,"children":2438},{"class":654,"line":54},[2439,2444,2448,2452,2457,2462],{"type":606,"tag":652,"props":2440,"children":2441},{"style":664},[2442],{"type":612,"value":2443},"txt_files ",{"type":606,"tag":652,"props":2445,"children":2446},{"style":658},[2447],{"type":612,"value":707},{"type":606,"tag":652,"props":2449,"children":2450},{"style":729},[2451],{"type":612,"value":2372},{"type":606,"tag":652,"props":2453,"children":2454},{"style":664},[2455],{"type":612,"value":2456},"(project_dir.glob(",{"type":606,"tag":652,"props":2458,"children":2459},{"style":715},[2460],{"type":612,"value":2461},"'**/*.txt'",{"type":606,"tag":652,"props":2463,"children":2464},{"style":664},[2465],{"type":612,"value":2387},{"type":606,"tag":652,"props":2467,"children":2468},{"class":654,"line":63},[2469,2473,2477,2481,2486,2490,2495,2499,2503],{"type":606,"tag":652,"props":2470,"children":2471},{"style":729},[2472],{"type":612,"value":732},{"type":606,"tag":652,"props":2474,"children":2475},{"style":664},[2476],{"type":612,"value":737},{"type":606,"tag":652,"props":2478,"children":2479},{"style":658},[2480],{"type":612,"value":742},{"type":606,"tag":652,"props":2482,"children":2483},{"style":715},[2484],{"type":612,"value":2485},"\"Text files: ",{"type":606,"tag":652,"props":2487,"children":2488},{"style":729},[2489],{"type":612,"value":752},{"type":606,"tag":652,"props":2491,"children":2492},{"style":664},[2493],{"type":612,"value":2494},"txt_files",{"type":606,"tag":652,"props":2496,"children":2497},{"style":729},[2498],{"type":612,"value":762},{"type":606,"tag":652,"props":2500,"children":2501},{"style":715},[2502],{"type":612,"value":767},{"type":606,"tag":652,"props":2504,"children":2505},{"style":664},[2506],{"type":612,"value":723},{"type":606,"tag":652,"props":2508,"children":2509},{"class":654,"line":72},[2510],{"type":606,"tag":652,"props":2511,"children":2512},{"emptyLinePlaceholder":13},[2513],{"type":612,"value":685},{"type":606,"tag":652,"props":2515,"children":2516},{"class":654,"line":81},[2517],{"type":606,"tag":652,"props":2518,"children":2519},{"style":691},[2520],{"type":612,"value":2521},"# Find files in specific directory\n",{"type":606,"tag":652,"props":2523,"children":2524},{"class":654,"line":1129},[2525,2530,2534,2538,2543,2547,2551,2556,2561],{"type":606,"tag":652,"props":2526,"children":2527},{"style":664},[2528],{"type":612,"value":2529},"src_files ",{"type":606,"tag":652,"props":2531,"children":2532},{"style":658},[2533],{"type":612,"value":707},{"type":606,"tag":652,"props":2535,"children":2536},{"style":729},[2537],{"type":612,"value":2372},{"type":606,"tag":652,"props":2539,"children":2540},{"style":664},[2541],{"type":612,"value":2542},"((project_dir ",{"type":606,"tag":652,"props":2544,"children":2545},{"style":658},[2546],{"type":612,"value":1710},{"type":606,"tag":652,"props":2548,"children":2549},{"style":715},[2550],{"type":612,"value":1725},{"type":606,"tag":652,"props":2552,"children":2553},{"style":664},[2554],{"type":612,"value":2555},").glob(",{"type":606,"tag":652,"props":2557,"children":2558},{"style":715},[2559],{"type":612,"value":2560},"'*'",{"type":606,"tag":652,"props":2562,"children":2563},{"style":664},[2564],{"type":612,"value":2387},{"type":606,"tag":652,"props":2566,"children":2567},{"class":654,"line":99},[2568,2572,2576,2580,2585,2589,2594,2598,2602],{"type":606,"tag":652,"props":2569,"children":2570},{"style":729},[2571],{"type":612,"value":732},{"type":606,"tag":652,"props":2573,"children":2574},{"style":664},[2575],{"type":612,"value":737},{"type":606,"tag":652,"props":2577,"children":2578},{"style":658},[2579],{"type":612,"value":742},{"type":606,"tag":652,"props":2581,"children":2582},{"style":715},[2583],{"type":612,"value":2584},"\"Files in src: ",{"type":606,"tag":652,"props":2586,"children":2587},{"style":729},[2588],{"type":612,"value":752},{"type":606,"tag":652,"props":2590,"children":2591},{"style":664},[2592],{"type":612,"value":2593},"src_files",{"type":606,"tag":652,"props":2595,"children":2596},{"style":729},[2597],{"type":612,"value":762},{"type":606,"tag":652,"props":2599,"children":2600},{"style":715},[2601],{"type":612,"value":767},{"type":606,"tag":652,"props":2603,"children":2604},{"style":664},[2605],{"type":612,"value":723},{"type":606,"tag":957,"props":2607,"children":2609},{"id":2608},"path-validation-and-safe-operations",[2610],{"type":612,"value":2611},"Path Validation and Safe Operations",{"type":606,"tag":638,"props":2613,"children":2614},{},[2615],{"type":606,"tag":642,"props":2616,"children":2618},{"className":644,"code":2617,"language":646,"meta":8,"style":8},"import shutil\n\n# Path validation and normalization\ndef validate_path(path_str):\n    try:\n        path = Path(path_str)\n        # Resolve to absolute path\n        resolved = path.resolve()\n        print(f\"Resolved path: {resolved}\")\n        return resolved\n    except Exception as e:\n        print(f\"Invalid path: {e}\")\n        return None\n\n# Safe file operations\ndef safe_file_operation(source, destination):\n    source_path = Path(source)\n    dest_path = Path(destination)\n    \n    if not source_path.exists():\n        print(f\"Source file {source} does not exist\")\n        return False\n    \n    # Create destination directory if needed\n    dest_path.parent.mkdir(parents=True, exist_ok=True)\n    \n    try:\n        shutil.copy2(source_path, dest_path)\n        print(f\"Copied {source} to {destination}\")\n        return True\n    except Exception as e:\n        print(f\"Copy failed: {e}\")\n        return False\n\nvalidate_path('../documents/file.txt')\n",[2619],{"type":606,"tag":621,"props":2620,"children":2621},{"__ignoreMap":8},[2622,2634,2641,2649,2668,2680,2697,2705,2722,2763,2776,2799,2840,2852,2859,2867,2884,2901,2918,2926,2943,2985,2997,3004,3012,3052,3059,3070,3078,3136,3148,3167,3207,3218,3225],{"type":606,"tag":652,"props":2623,"children":2624},{"class":654,"line":12},[2625,2629],{"type":606,"tag":652,"props":2626,"children":2627},{"style":658},[2628],{"type":612,"value":672},{"type":606,"tag":652,"props":2630,"children":2631},{"style":664},[2632],{"type":612,"value":2633}," shutil\n",{"type":606,"tag":652,"props":2635,"children":2636},{"class":654,"line":27},[2637],{"type":606,"tag":652,"props":2638,"children":2639},{"emptyLinePlaceholder":13},[2640],{"type":612,"value":685},{"type":606,"tag":652,"props":2642,"children":2643},{"class":654,"line":36},[2644],{"type":606,"tag":652,"props":2645,"children":2646},{"style":691},[2647],{"type":612,"value":2648},"# Path validation and normalization\n",{"type":606,"tag":652,"props":2650,"children":2651},{"class":654,"line":45},[2652,2657,2663],{"type":606,"tag":652,"props":2653,"children":2654},{"style":658},[2655],{"type":612,"value":2656},"def",{"type":606,"tag":652,"props":2658,"children":2660},{"style":2659},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[2661],{"type":612,"value":2662}," validate_path",{"type":606,"tag":652,"props":2664,"children":2665},{"style":664},[2666],{"type":612,"value":2667},"(path_str):\n",{"type":606,"tag":652,"props":2669,"children":2670},{"class":654,"line":54},[2671,2676],{"type":606,"tag":652,"props":2672,"children":2673},{"style":658},[2674],{"type":612,"value":2675},"    try",{"type":606,"tag":652,"props":2677,"children":2678},{"style":664},[2679],{"type":612,"value":2291},{"type":606,"tag":652,"props":2681,"children":2682},{"class":654,"line":63},[2683,2688,2692],{"type":606,"tag":652,"props":2684,"children":2685},{"style":664},[2686],{"type":612,"value":2687},"        path ",{"type":606,"tag":652,"props":2689,"children":2690},{"style":658},[2691],{"type":612,"value":707},{"type":606,"tag":652,"props":2693,"children":2694},{"style":664},[2695],{"type":612,"value":2696}," Path(path_str)\n",{"type":606,"tag":652,"props":2698,"children":2699},{"class":654,"line":72},[2700],{"type":606,"tag":652,"props":2701,"children":2702},{"style":691},[2703],{"type":612,"value":2704},"        # Resolve to absolute path\n",{"type":606,"tag":652,"props":2706,"children":2707},{"class":654,"line":81},[2708,2713,2717],{"type":606,"tag":652,"props":2709,"children":2710},{"style":664},[2711],{"type":612,"value":2712},"        resolved ",{"type":606,"tag":652,"props":2714,"children":2715},{"style":658},[2716],{"type":612,"value":707},{"type":606,"tag":652,"props":2718,"children":2719},{"style":664},[2720],{"type":612,"value":2721}," path.resolve()\n",{"type":606,"tag":652,"props":2723,"children":2724},{"class":654,"line":1129},[2725,2729,2733,2737,2742,2746,2751,2755,2759],{"type":606,"tag":652,"props":2726,"children":2727},{"style":729},[2728],{"type":612,"value":2244},{"type":606,"tag":652,"props":2730,"children":2731},{"style":664},[2732],{"type":612,"value":737},{"type":606,"tag":652,"props":2734,"children":2735},{"style":658},[2736],{"type":612,"value":742},{"type":606,"tag":652,"props":2738,"children":2739},{"style":715},[2740],{"type":612,"value":2741},"\"Resolved path: ",{"type":606,"tag":652,"props":2743,"children":2744},{"style":729},[2745],{"type":612,"value":752},{"type":606,"tag":652,"props":2747,"children":2748},{"style":664},[2749],{"type":612,"value":2750},"resolved",{"type":606,"tag":652,"props":2752,"children":2753},{"style":729},[2754],{"type":612,"value":762},{"type":606,"tag":652,"props":2756,"children":2757},{"style":715},[2758],{"type":612,"value":767},{"type":606,"tag":652,"props":2760,"children":2761},{"style":664},[2762],{"type":612,"value":723},{"type":606,"tag":652,"props":2764,"children":2765},{"class":654,"line":99},[2766,2771],{"type":606,"tag":652,"props":2767,"children":2768},{"style":658},[2769],{"type":612,"value":2770},"        return",{"type":606,"tag":652,"props":2772,"children":2773},{"style":664},[2774],{"type":612,"value":2775}," resolved\n",{"type":606,"tag":652,"props":2777,"children":2778},{"class":654,"line":108},[2779,2784,2789,2794],{"type":606,"tag":652,"props":2780,"children":2781},{"style":658},[2782],{"type":612,"value":2783},"    except",{"type":606,"tag":652,"props":2785,"children":2786},{"style":729},[2787],{"type":612,"value":2788}," Exception",{"type":606,"tag":652,"props":2790,"children":2791},{"style":658},[2792],{"type":612,"value":2793}," as",{"type":606,"tag":652,"props":2795,"children":2796},{"style":664},[2797],{"type":612,"value":2798}," e:\n",{"type":606,"tag":652,"props":2800,"children":2801},{"class":654,"line":117},[2802,2806,2810,2814,2819,2823,2828,2832,2836],{"type":606,"tag":652,"props":2803,"children":2804},{"style":729},[2805],{"type":612,"value":2244},{"type":606,"tag":652,"props":2807,"children":2808},{"style":664},[2809],{"type":612,"value":737},{"type":606,"tag":652,"props":2811,"children":2812},{"style":658},[2813],{"type":612,"value":742},{"type":606,"tag":652,"props":2815,"children":2816},{"style":715},[2817],{"type":612,"value":2818},"\"Invalid path: ",{"type":606,"tag":652,"props":2820,"children":2821},{"style":729},[2822],{"type":612,"value":752},{"type":606,"tag":652,"props":2824,"children":2825},{"style":664},[2826],{"type":612,"value":2827},"e",{"type":606,"tag":652,"props":2829,"children":2830},{"style":729},[2831],{"type":612,"value":762},{"type":606,"tag":652,"props":2833,"children":2834},{"style":715},[2835],{"type":612,"value":767},{"type":606,"tag":652,"props":2837,"children":2838},{"style":664},[2839],{"type":612,"value":723},{"type":606,"tag":652,"props":2841,"children":2842},{"class":654,"line":126},[2843,2847],{"type":606,"tag":652,"props":2844,"children":2845},{"style":658},[2846],{"type":612,"value":2770},{"type":606,"tag":652,"props":2848,"children":2849},{"style":729},[2850],{"type":612,"value":2851}," None\n",{"type":606,"tag":652,"props":2853,"children":2854},{"class":654,"line":135},[2855],{"type":606,"tag":652,"props":2856,"children":2857},{"emptyLinePlaceholder":13},[2858],{"type":612,"value":685},{"type":606,"tag":652,"props":2860,"children":2861},{"class":654,"line":144},[2862],{"type":606,"tag":652,"props":2863,"children":2864},{"style":691},[2865],{"type":612,"value":2866},"# Safe file operations\n",{"type":606,"tag":652,"props":2868,"children":2869},{"class":654,"line":153},[2870,2874,2879],{"type":606,"tag":652,"props":2871,"children":2872},{"style":658},[2873],{"type":612,"value":2656},{"type":606,"tag":652,"props":2875,"children":2876},{"style":2659},[2877],{"type":612,"value":2878}," safe_file_operation",{"type":606,"tag":652,"props":2880,"children":2881},{"style":664},[2882],{"type":612,"value":2883},"(source, destination):\n",{"type":606,"tag":652,"props":2885,"children":2886},{"class":654,"line":163},[2887,2892,2896],{"type":606,"tag":652,"props":2888,"children":2889},{"style":664},[2890],{"type":612,"value":2891},"    source_path ",{"type":606,"tag":652,"props":2893,"children":2894},{"style":658},[2895],{"type":612,"value":707},{"type":606,"tag":652,"props":2897,"children":2898},{"style":664},[2899],{"type":612,"value":2900}," Path(source)\n",{"type":606,"tag":652,"props":2902,"children":2903},{"class":654,"line":172},[2904,2909,2913],{"type":606,"tag":652,"props":2905,"children":2906},{"style":664},[2907],{"type":612,"value":2908},"    dest_path ",{"type":606,"tag":652,"props":2910,"children":2911},{"style":658},[2912],{"type":612,"value":707},{"type":606,"tag":652,"props":2914,"children":2915},{"style":664},[2916],{"type":612,"value":2917}," Path(destination)\n",{"type":606,"tag":652,"props":2919,"children":2920},{"class":654,"line":181},[2921],{"type":606,"tag":652,"props":2922,"children":2923},{"style":664},[2924],{"type":612,"value":2925},"    \n",{"type":606,"tag":652,"props":2927,"children":2928},{"class":654,"line":190},[2929,2933,2938],{"type":606,"tag":652,"props":2930,"children":2931},{"style":658},[2932],{"type":612,"value":2231},{"type":606,"tag":652,"props":2934,"children":2935},{"style":658},[2936],{"type":612,"value":2937}," not",{"type":606,"tag":652,"props":2939,"children":2940},{"style":664},[2941],{"type":612,"value":2942}," source_path.exists():\n",{"type":606,"tag":652,"props":2944,"children":2945},{"class":654,"line":199},[2946,2950,2954,2958,2963,2967,2972,2976,2981],{"type":606,"tag":652,"props":2947,"children":2948},{"style":729},[2949],{"type":612,"value":2244},{"type":606,"tag":652,"props":2951,"children":2952},{"style":664},[2953],{"type":612,"value":737},{"type":606,"tag":652,"props":2955,"children":2956},{"style":658},[2957],{"type":612,"value":742},{"type":606,"tag":652,"props":2959,"children":2960},{"style":715},[2961],{"type":612,"value":2962},"\"Source file ",{"type":606,"tag":652,"props":2964,"children":2965},{"style":729},[2966],{"type":612,"value":752},{"type":606,"tag":652,"props":2968,"children":2969},{"style":664},[2970],{"type":612,"value":2971},"source",{"type":606,"tag":652,"props":2973,"children":2974},{"style":729},[2975],{"type":612,"value":762},{"type":606,"tag":652,"props":2977,"children":2978},{"style":715},[2979],{"type":612,"value":2980}," does not exist\"",{"type":606,"tag":652,"props":2982,"children":2983},{"style":664},[2984],{"type":612,"value":723},{"type":606,"tag":652,"props":2986,"children":2987},{"class":654,"line":208},[2988,2992],{"type":606,"tag":652,"props":2989,"children":2990},{"style":658},[2991],{"type":612,"value":2770},{"type":606,"tag":652,"props":2993,"children":2994},{"style":729},[2995],{"type":612,"value":2996}," False\n",{"type":606,"tag":652,"props":2998,"children":2999},{"class":654,"line":217},[3000],{"type":606,"tag":652,"props":3001,"children":3002},{"style":664},[3003],{"type":612,"value":2925},{"type":606,"tag":652,"props":3005,"children":3006},{"class":654,"line":227},[3007],{"type":606,"tag":652,"props":3008,"children":3009},{"style":691},[3010],{"type":612,"value":3011},"    # Create destination directory if needed\n",{"type":606,"tag":652,"props":3013,"children":3014},{"class":654,"line":236},[3015,3020,3024,3028,3032,3036,3040,3044,3048],{"type":606,"tag":652,"props":3016,"children":3017},{"style":664},[3018],{"type":612,"value":3019},"    dest_path.parent.mkdir(",{"type":606,"tag":652,"props":3021,"children":3022},{"style":2031},[3023],{"type":612,"value":2034},{"type":606,"tag":652,"props":3025,"children":3026},{"style":658},[3027],{"type":612,"value":707},{"type":606,"tag":652,"props":3029,"children":3030},{"style":729},[3031],{"type":612,"value":2043},{"type":606,"tag":652,"props":3033,"children":3034},{"style":664},[3035],{"type":612,"value":2048},{"type":606,"tag":652,"props":3037,"children":3038},{"style":2031},[3039],{"type":612,"value":2053},{"type":606,"tag":652,"props":3041,"children":3042},{"style":658},[3043],{"type":612,"value":707},{"type":606,"tag":652,"props":3045,"children":3046},{"style":729},[3047],{"type":612,"value":2043},{"type":606,"tag":652,"props":3049,"children":3050},{"style":664},[3051],{"type":612,"value":723},{"type":606,"tag":652,"props":3053,"children":3054},{"class":654,"line":245},[3055],{"type":606,"tag":652,"props":3056,"children":3057},{"style":664},[3058],{"type":612,"value":2925},{"type":606,"tag":652,"props":3060,"children":3061},{"class":654,"line":254},[3062,3066],{"type":606,"tag":652,"props":3063,"children":3064},{"style":658},[3065],{"type":612,"value":2675},{"type":606,"tag":652,"props":3067,"children":3068},{"style":664},[3069],{"type":612,"value":2291},{"type":606,"tag":652,"props":3071,"children":3072},{"class":654,"line":263},[3073],{"type":606,"tag":652,"props":3074,"children":3075},{"style":664},[3076],{"type":612,"value":3077},"        shutil.copy2(source_path, dest_path)\n",{"type":606,"tag":652,"props":3079,"children":3080},{"class":654,"line":272},[3081,3085,3089,3093,3098,3102,3106,3110,3115,3119,3124,3128,3132],{"type":606,"tag":652,"props":3082,"children":3083},{"style":729},[3084],{"type":612,"value":2244},{"type":606,"tag":652,"props":3086,"children":3087},{"style":664},[3088],{"type":612,"value":737},{"type":606,"tag":652,"props":3090,"children":3091},{"style":658},[3092],{"type":612,"value":742},{"type":606,"tag":652,"props":3094,"children":3095},{"style":715},[3096],{"type":612,"value":3097},"\"Copied ",{"type":606,"tag":652,"props":3099,"children":3100},{"style":729},[3101],{"type":612,"value":752},{"type":606,"tag":652,"props":3103,"children":3104},{"style":664},[3105],{"type":612,"value":2971},{"type":606,"tag":652,"props":3107,"children":3108},{"style":729},[3109],{"type":612,"value":762},{"type":606,"tag":652,"props":3111,"children":3112},{"style":715},[3113],{"type":612,"value":3114}," to ",{"type":606,"tag":652,"props":3116,"children":3117},{"style":729},[3118],{"type":612,"value":752},{"type":606,"tag":652,"props":3120,"children":3121},{"style":664},[3122],{"type":612,"value":3123},"destination",{"type":606,"tag":652,"props":3125,"children":3126},{"style":729},[3127],{"type":612,"value":762},{"type":606,"tag":652,"props":3129,"children":3130},{"style":715},[3131],{"type":612,"value":767},{"type":606,"tag":652,"props":3133,"children":3134},{"style":664},[3135],{"type":612,"value":723},{"type":606,"tag":652,"props":3137,"children":3138},{"class":654,"line":281},[3139,3143],{"type":606,"tag":652,"props":3140,"children":3141},{"style":658},[3142],{"type":612,"value":2770},{"type":606,"tag":652,"props":3144,"children":3145},{"style":729},[3146],{"type":612,"value":3147}," True\n",{"type":606,"tag":652,"props":3149,"children":3150},{"class":654,"line":291},[3151,3155,3159,3163],{"type":606,"tag":652,"props":3152,"children":3153},{"style":658},[3154],{"type":612,"value":2783},{"type":606,"tag":652,"props":3156,"children":3157},{"style":729},[3158],{"type":612,"value":2788},{"type":606,"tag":652,"props":3160,"children":3161},{"style":658},[3162],{"type":612,"value":2793},{"type":606,"tag":652,"props":3164,"children":3165},{"style":664},[3166],{"type":612,"value":2798},{"type":606,"tag":652,"props":3168,"children":3169},{"class":654,"line":302},[3170,3174,3178,3182,3187,3191,3195,3199,3203],{"type":606,"tag":652,"props":3171,"children":3172},{"style":729},[3173],{"type":612,"value":2244},{"type":606,"tag":652,"props":3175,"children":3176},{"style":664},[3177],{"type":612,"value":737},{"type":606,"tag":652,"props":3179,"children":3180},{"style":658},[3181],{"type":612,"value":742},{"type":606,"tag":652,"props":3183,"children":3184},{"style":715},[3185],{"type":612,"value":3186},"\"Copy failed: ",{"type":606,"tag":652,"props":3188,"children":3189},{"style":729},[3190],{"type":612,"value":752},{"type":606,"tag":652,"props":3192,"children":3193},{"style":664},[3194],{"type":612,"value":2827},{"type":606,"tag":652,"props":3196,"children":3197},{"style":729},[3198],{"type":612,"value":762},{"type":606,"tag":652,"props":3200,"children":3201},{"style":715},[3202],{"type":612,"value":767},{"type":606,"tag":652,"props":3204,"children":3205},{"style":664},[3206],{"type":612,"value":723},{"type":606,"tag":652,"props":3208,"children":3209},{"class":654,"line":311},[3210,3214],{"type":606,"tag":652,"props":3211,"children":3212},{"style":658},[3213],{"type":612,"value":2770},{"type":606,"tag":652,"props":3215,"children":3216},{"style":729},[3217],{"type":612,"value":2996},{"type":606,"tag":652,"props":3219,"children":3220},{"class":654,"line":320},[3221],{"type":606,"tag":652,"props":3222,"children":3223},{"emptyLinePlaceholder":13},[3224],{"type":612,"value":685},{"type":606,"tag":652,"props":3226,"children":3227},{"class":654,"line":329},[3228,3233,3238],{"type":606,"tag":652,"props":3229,"children":3230},{"style":664},[3231],{"type":612,"value":3232},"validate_path(",{"type":606,"tag":652,"props":3234,"children":3235},{"style":715},[3236],{"type":612,"value":3237},"'../documents/file.txt'",{"type":606,"tag":652,"props":3239,"children":3240},{"style":664},[3241],{"type":612,"value":723},{"type":606,"tag":957,"props":3243,"children":3245},{"id":3244},"cross-platform-and-relative-paths",[3246],{"type":612,"value":3247},"Cross-Platform and Relative Paths",{"type":606,"tag":638,"props":3249,"children":3250},{},[3251],{"type":606,"tag":642,"props":3252,"children":3254},{"className":644,"code":3253,"language":646,"meta":8,"style":8},"import os\n\n# Cross-platform path handling\ndef get_config_path():\n    \"\"\"Get platform-appropriate config directory\"\"\"\n    if os.name == 'nt':  # Windows\n        return Path.home() / 'AppData' / 'Local' / 'MyApp'\n    else:  # Unix-like\n        return Path.home() / '.config' / 'myapp'\n\n# Working with relative paths\ndef make_relative_path(file_path, base_path):\n    \"\"\"Make file_path relative to base_path\"\"\"\n    try:\n        return Path(file_path).relative_to(base_path)\n    except ValueError:\n        return Path(file_path)\n\nconfig_dir = get_config_path()\nprint(f\"Config directory: {config_dir}\")\n\nrel_path = make_relative_path('/home/user/projects/file.py', '/home/user')\nprint(f\"Relative path: {rel_path}\")\n",[3255],{"type":606,"tag":621,"props":3256,"children":3257},{"__ignoreMap":8},[3258,3270,3277,3285,3302,3310,3342,3381,3397,3426,3433,3441,3458,3466,3477,3489,3505,3517,3524,3541,3582,3589,3624],{"type":606,"tag":652,"props":3259,"children":3260},{"class":654,"line":12},[3261,3265],{"type":606,"tag":652,"props":3262,"children":3263},{"style":658},[3264],{"type":612,"value":672},{"type":606,"tag":652,"props":3266,"children":3267},{"style":664},[3268],{"type":612,"value":3269}," os\n",{"type":606,"tag":652,"props":3271,"children":3272},{"class":654,"line":27},[3273],{"type":606,"tag":652,"props":3274,"children":3275},{"emptyLinePlaceholder":13},[3276],{"type":612,"value":685},{"type":606,"tag":652,"props":3278,"children":3279},{"class":654,"line":36},[3280],{"type":606,"tag":652,"props":3281,"children":3282},{"style":691},[3283],{"type":612,"value":3284},"# Cross-platform path handling\n",{"type":606,"tag":652,"props":3286,"children":3287},{"class":654,"line":45},[3288,3292,3297],{"type":606,"tag":652,"props":3289,"children":3290},{"style":658},[3291],{"type":612,"value":2656},{"type":606,"tag":652,"props":3293,"children":3294},{"style":2659},[3295],{"type":612,"value":3296}," get_config_path",{"type":606,"tag":652,"props":3298,"children":3299},{"style":664},[3300],{"type":612,"value":3301},"():\n",{"type":606,"tag":652,"props":3303,"children":3304},{"class":654,"line":54},[3305],{"type":606,"tag":652,"props":3306,"children":3307},{"style":715},[3308],{"type":612,"value":3309},"    \"\"\"Get platform-appropriate config directory\"\"\"\n",{"type":606,"tag":652,"props":3311,"children":3312},{"class":654,"line":63},[3313,3317,3322,3327,3332,3337],{"type":606,"tag":652,"props":3314,"children":3315},{"style":658},[3316],{"type":612,"value":2231},{"type":606,"tag":652,"props":3318,"children":3319},{"style":664},[3320],{"type":612,"value":3321}," os.name ",{"type":606,"tag":652,"props":3323,"children":3324},{"style":658},[3325],{"type":612,"value":3326},"==",{"type":606,"tag":652,"props":3328,"children":3329},{"style":715},[3330],{"type":612,"value":3331}," 'nt'",{"type":606,"tag":652,"props":3333,"children":3334},{"style":664},[3335],{"type":612,"value":3336},":  ",{"type":606,"tag":652,"props":3338,"children":3339},{"style":691},[3340],{"type":612,"value":3341},"# Windows\n",{"type":606,"tag":652,"props":3343,"children":3344},{"class":654,"line":72},[3345,3349,3354,3358,3363,3367,3372,3376],{"type":606,"tag":652,"props":3346,"children":3347},{"style":658},[3348],{"type":612,"value":2770},{"type":606,"tag":652,"props":3350,"children":3351},{"style":664},[3352],{"type":612,"value":3353}," Path.home() ",{"type":606,"tag":652,"props":3355,"children":3356},{"style":658},[3357],{"type":612,"value":1710},{"type":606,"tag":652,"props":3359,"children":3360},{"style":715},[3361],{"type":612,"value":3362}," 'AppData'",{"type":606,"tag":652,"props":3364,"children":3365},{"style":658},[3366],{"type":612,"value":1720},{"type":606,"tag":652,"props":3368,"children":3369},{"style":715},[3370],{"type":612,"value":3371}," 'Local'",{"type":606,"tag":652,"props":3373,"children":3374},{"style":658},[3375],{"type":612,"value":1720},{"type":606,"tag":652,"props":3377,"children":3378},{"style":715},[3379],{"type":612,"value":3380}," 'MyApp'\n",{"type":606,"tag":652,"props":3382,"children":3383},{"class":654,"line":81},[3384,3388,3392],{"type":606,"tag":652,"props":3385,"children":3386},{"style":658},[3387],{"type":612,"value":2286},{"type":606,"tag":652,"props":3389,"children":3390},{"style":664},[3391],{"type":612,"value":3336},{"type":606,"tag":652,"props":3393,"children":3394},{"style":691},[3395],{"type":612,"value":3396},"# Unix-like\n",{"type":606,"tag":652,"props":3398,"children":3399},{"class":654,"line":1129},[3400,3404,3408,3412,3417,3421],{"type":606,"tag":652,"props":3401,"children":3402},{"style":658},[3403],{"type":612,"value":2770},{"type":606,"tag":652,"props":3405,"children":3406},{"style":664},[3407],{"type":612,"value":3353},{"type":606,"tag":652,"props":3409,"children":3410},{"style":658},[3411],{"type":612,"value":1710},{"type":606,"tag":652,"props":3413,"children":3414},{"style":715},[3415],{"type":612,"value":3416}," '.config'",{"type":606,"tag":652,"props":3418,"children":3419},{"style":658},[3420],{"type":612,"value":1720},{"type":606,"tag":652,"props":3422,"children":3423},{"style":715},[3424],{"type":612,"value":3425}," 'myapp'\n",{"type":606,"tag":652,"props":3427,"children":3428},{"class":654,"line":99},[3429],{"type":606,"tag":652,"props":3430,"children":3431},{"emptyLinePlaceholder":13},[3432],{"type":612,"value":685},{"type":606,"tag":652,"props":3434,"children":3435},{"class":654,"line":108},[3436],{"type":606,"tag":652,"props":3437,"children":3438},{"style":691},[3439],{"type":612,"value":3440},"# Working with relative paths\n",{"type":606,"tag":652,"props":3442,"children":3443},{"class":654,"line":117},[3444,3448,3453],{"type":606,"tag":652,"props":3445,"children":3446},{"style":658},[3447],{"type":612,"value":2656},{"type":606,"tag":652,"props":3449,"children":3450},{"style":2659},[3451],{"type":612,"value":3452}," make_relative_path",{"type":606,"tag":652,"props":3454,"children":3455},{"style":664},[3456],{"type":612,"value":3457},"(file_path, base_path):\n",{"type":606,"tag":652,"props":3459,"children":3460},{"class":654,"line":126},[3461],{"type":606,"tag":652,"props":3462,"children":3463},{"style":715},[3464],{"type":612,"value":3465},"    \"\"\"Make file_path relative to base_path\"\"\"\n",{"type":606,"tag":652,"props":3467,"children":3468},{"class":654,"line":135},[3469,3473],{"type":606,"tag":652,"props":3470,"children":3471},{"style":658},[3472],{"type":612,"value":2675},{"type":606,"tag":652,"props":3474,"children":3475},{"style":664},[3476],{"type":612,"value":2291},{"type":606,"tag":652,"props":3478,"children":3479},{"class":654,"line":144},[3480,3484],{"type":606,"tag":652,"props":3481,"children":3482},{"style":658},[3483],{"type":612,"value":2770},{"type":606,"tag":652,"props":3485,"children":3486},{"style":664},[3487],{"type":612,"value":3488}," Path(file_path).relative_to(base_path)\n",{"type":606,"tag":652,"props":3490,"children":3491},{"class":654,"line":153},[3492,3496,3501],{"type":606,"tag":652,"props":3493,"children":3494},{"style":658},[3495],{"type":612,"value":2783},{"type":606,"tag":652,"props":3497,"children":3498},{"style":729},[3499],{"type":612,"value":3500}," ValueError",{"type":606,"tag":652,"props":3502,"children":3503},{"style":664},[3504],{"type":612,"value":2291},{"type":606,"tag":652,"props":3506,"children":3507},{"class":654,"line":163},[3508,3512],{"type":606,"tag":652,"props":3509,"children":3510},{"style":658},[3511],{"type":612,"value":2770},{"type":606,"tag":652,"props":3513,"children":3514},{"style":664},[3515],{"type":612,"value":3516}," Path(file_path)\n",{"type":606,"tag":652,"props":3518,"children":3519},{"class":654,"line":172},[3520],{"type":606,"tag":652,"props":3521,"children":3522},{"emptyLinePlaceholder":13},[3523],{"type":612,"value":685},{"type":606,"tag":652,"props":3525,"children":3526},{"class":654,"line":181},[3527,3532,3536],{"type":606,"tag":652,"props":3528,"children":3529},{"style":664},[3530],{"type":612,"value":3531},"config_dir ",{"type":606,"tag":652,"props":3533,"children":3534},{"style":658},[3535],{"type":612,"value":707},{"type":606,"tag":652,"props":3537,"children":3538},{"style":664},[3539],{"type":612,"value":3540}," get_config_path()\n",{"type":606,"tag":652,"props":3542,"children":3543},{"class":654,"line":190},[3544,3548,3552,3556,3561,3565,3570,3574,3578],{"type":606,"tag":652,"props":3545,"children":3546},{"style":729},[3547],{"type":612,"value":732},{"type":606,"tag":652,"props":3549,"children":3550},{"style":664},[3551],{"type":612,"value":737},{"type":606,"tag":652,"props":3553,"children":3554},{"style":658},[3555],{"type":612,"value":742},{"type":606,"tag":652,"props":3557,"children":3558},{"style":715},[3559],{"type":612,"value":3560},"\"Config directory: ",{"type":606,"tag":652,"props":3562,"children":3563},{"style":729},[3564],{"type":612,"value":752},{"type":606,"tag":652,"props":3566,"children":3567},{"style":664},[3568],{"type":612,"value":3569},"config_dir",{"type":606,"tag":652,"props":3571,"children":3572},{"style":729},[3573],{"type":612,"value":762},{"type":606,"tag":652,"props":3575,"children":3576},{"style":715},[3577],{"type":612,"value":767},{"type":606,"tag":652,"props":3579,"children":3580},{"style":664},[3581],{"type":612,"value":723},{"type":606,"tag":652,"props":3583,"children":3584},{"class":654,"line":199},[3585],{"type":606,"tag":652,"props":3586,"children":3587},{"emptyLinePlaceholder":13},[3588],{"type":612,"value":685},{"type":606,"tag":652,"props":3590,"children":3591},{"class":654,"line":208},[3592,3597,3601,3606,3611,3615,3620],{"type":606,"tag":652,"props":3593,"children":3594},{"style":664},[3595],{"type":612,"value":3596},"rel_path ",{"type":606,"tag":652,"props":3598,"children":3599},{"style":658},[3600],{"type":612,"value":707},{"type":606,"tag":652,"props":3602,"children":3603},{"style":664},[3604],{"type":612,"value":3605}," make_relative_path(",{"type":606,"tag":652,"props":3607,"children":3608},{"style":715},[3609],{"type":612,"value":3610},"'/home/user/projects/file.py'",{"type":606,"tag":652,"props":3612,"children":3613},{"style":664},[3614],{"type":612,"value":2048},{"type":606,"tag":652,"props":3616,"children":3617},{"style":715},[3618],{"type":612,"value":3619},"'/home/user'",{"type":606,"tag":652,"props":3621,"children":3622},{"style":664},[3623],{"type":612,"value":723},{"type":606,"tag":652,"props":3625,"children":3626},{"class":654,"line":217},[3627,3631,3635,3639,3644,3648,3653,3657,3661],{"type":606,"tag":652,"props":3628,"children":3629},{"style":729},[3630],{"type":612,"value":732},{"type":606,"tag":652,"props":3632,"children":3633},{"style":664},[3634],{"type":612,"value":737},{"type":606,"tag":652,"props":3636,"children":3637},{"style":658},[3638],{"type":612,"value":742},{"type":606,"tag":652,"props":3640,"children":3641},{"style":715},[3642],{"type":612,"value":3643},"\"Relative path: ",{"type":606,"tag":652,"props":3645,"children":3646},{"style":729},[3647],{"type":612,"value":752},{"type":606,"tag":652,"props":3649,"children":3650},{"style":664},[3651],{"type":612,"value":3652},"rel_path",{"type":606,"tag":652,"props":3654,"children":3655},{"style":729},[3656],{"type":612,"value":762},{"type":606,"tag":652,"props":3658,"children":3659},{"style":715},[3660],{"type":612,"value":767},{"type":606,"tag":652,"props":3662,"children":3663},{"style":664},[3664],{"type":612,"value":723},{"type":606,"tag":855,"props":3666,"children":3668},{"id":3667},"path-methods-reference-table",[3669],{"type":612,"value":3670},"📋 Path Methods Reference Table",{"type":606,"tag":3672,"props":3673,"children":3674},"table",{},[3675,3699],{"type":606,"tag":3676,"props":3677,"children":3678},"thead",{},[3679],{"type":606,"tag":3680,"props":3681,"children":3682},"tr",{},[3683,3689,3694],{"type":606,"tag":3684,"props":3685,"children":3686},"th",{},[3687],{"type":612,"value":3688},"Method",{"type":606,"tag":3684,"props":3690,"children":3691},{},[3692],{"type":612,"value":3693},"Purpose",{"type":606,"tag":3684,"props":3695,"children":3696},{},[3697],{"type":612,"value":3698},"Example",{"type":606,"tag":3700,"props":3701,"children":3702},"tbody",{},[3703,3730,3756,3782,3808,3834,3860,3885,3910,3932,3954],{"type":606,"tag":3680,"props":3704,"children":3705},{},[3706,3716,3721],{"type":606,"tag":3707,"props":3708,"children":3709},"td",{},[3710],{"type":606,"tag":621,"props":3711,"children":3713},{"className":3712},[],[3714],{"type":612,"value":3715},".name",{"type":606,"tag":3707,"props":3717,"children":3718},{},[3719],{"type":612,"value":3720},"File name with extension",{"type":606,"tag":3707,"props":3722,"children":3723},{},[3724],{"type":606,"tag":621,"props":3725,"children":3727},{"className":3726},[],[3728],{"type":612,"value":3729},"'report.txt'",{"type":606,"tag":3680,"props":3731,"children":3732},{},[3733,3742,3747],{"type":606,"tag":3707,"props":3734,"children":3735},{},[3736],{"type":606,"tag":621,"props":3737,"children":3739},{"className":3738},[],[3740],{"type":612,"value":3741},".stem",{"type":606,"tag":3707,"props":3743,"children":3744},{},[3745],{"type":612,"value":3746},"File name without extension",{"type":606,"tag":3707,"props":3748,"children":3749},{},[3750],{"type":606,"tag":621,"props":3751,"children":3753},{"className":3752},[],[3754],{"type":612,"value":3755},"'report'",{"type":606,"tag":3680,"props":3757,"children":3758},{},[3759,3768,3773],{"type":606,"tag":3707,"props":3760,"children":3761},{},[3762],{"type":606,"tag":621,"props":3763,"children":3765},{"className":3764},[],[3766],{"type":612,"value":3767},".suffix",{"type":606,"tag":3707,"props":3769,"children":3770},{},[3771],{"type":612,"value":3772},"File extension",{"type":606,"tag":3707,"props":3774,"children":3775},{},[3776],{"type":606,"tag":621,"props":3777,"children":3779},{"className":3778},[],[3780],{"type":612,"value":3781},"'.txt'",{"type":606,"tag":3680,"props":3783,"children":3784},{},[3785,3794,3799],{"type":606,"tag":3707,"props":3786,"children":3787},{},[3788],{"type":606,"tag":621,"props":3789,"children":3791},{"className":3790},[],[3792],{"type":612,"value":3793},".parent",{"type":606,"tag":3707,"props":3795,"children":3796},{},[3797],{"type":612,"value":3798},"Parent directory",{"type":606,"tag":3707,"props":3800,"children":3801},{},[3802],{"type":606,"tag":621,"props":3803,"children":3805},{"className":3804},[],[3806],{"type":612,"value":3807},"Path('docs')",{"type":606,"tag":3680,"props":3809,"children":3810},{},[3811,3820,3825],{"type":606,"tag":3707,"props":3812,"children":3813},{},[3814],{"type":606,"tag":621,"props":3815,"children":3817},{"className":3816},[],[3818],{"type":612,"value":3819},".parts",{"type":606,"tag":3707,"props":3821,"children":3822},{},[3823],{"type":612,"value":3824},"Path components",{"type":606,"tag":3707,"props":3826,"children":3827},{},[3828],{"type":606,"tag":621,"props":3829,"children":3831},{"className":3830},[],[3832],{"type":612,"value":3833},"('documents', 'report.txt')",{"type":606,"tag":3680,"props":3835,"children":3836},{},[3837,3846,3851],{"type":606,"tag":3707,"props":3838,"children":3839},{},[3840],{"type":606,"tag":621,"props":3841,"children":3843},{"className":3842},[],[3844],{"type":612,"value":3845},".exists()",{"type":606,"tag":3707,"props":3847,"children":3848},{},[3849],{"type":612,"value":3850},"Check if path exists",{"type":606,"tag":3707,"props":3852,"children":3853},{},[3854],{"type":606,"tag":621,"props":3855,"children":3857},{"className":3856},[],[3858],{"type":612,"value":3859},"True/False",{"type":606,"tag":3680,"props":3861,"children":3862},{},[3863,3872,3877],{"type":606,"tag":3707,"props":3864,"children":3865},{},[3866],{"type":606,"tag":621,"props":3867,"children":3869},{"className":3868},[],[3870],{"type":612,"value":3871},".is_file()",{"type":606,"tag":3707,"props":3873,"children":3874},{},[3875],{"type":612,"value":3876},"Check if it's a file",{"type":606,"tag":3707,"props":3878,"children":3879},{},[3880],{"type":606,"tag":621,"props":3881,"children":3883},{"className":3882},[],[3884],{"type":612,"value":3859},{"type":606,"tag":3680,"props":3886,"children":3887},{},[3888,3897,3902],{"type":606,"tag":3707,"props":3889,"children":3890},{},[3891],{"type":606,"tag":621,"props":3892,"children":3894},{"className":3893},[],[3895],{"type":612,"value":3896},".is_dir()",{"type":606,"tag":3707,"props":3898,"children":3899},{},[3900],{"type":612,"value":3901},"Check if it's a directory",{"type":606,"tag":3707,"props":3903,"children":3904},{},[3905],{"type":606,"tag":621,"props":3906,"children":3908},{"className":3907},[],[3909],{"type":612,"value":3859},{"type":606,"tag":3680,"props":3911,"children":3912},{},[3913,3922,3927],{"type":606,"tag":3707,"props":3914,"children":3915},{},[3916],{"type":606,"tag":621,"props":3917,"children":3919},{"className":3918},[],[3920],{"type":612,"value":3921},".mkdir()",{"type":606,"tag":3707,"props":3923,"children":3924},{},[3925],{"type":612,"value":3926},"Create directory",{"type":606,"tag":3707,"props":3928,"children":3929},{},[3930],{"type":612,"value":3931},"Creates directory",{"type":606,"tag":3680,"props":3933,"children":3934},{},[3935,3944,3949],{"type":606,"tag":3707,"props":3936,"children":3937},{},[3938],{"type":606,"tag":621,"props":3939,"children":3941},{"className":3940},[],[3942],{"type":612,"value":3943},".iterdir()",{"type":606,"tag":3707,"props":3945,"children":3946},{},[3947],{"type":612,"value":3948},"List directory contents",{"type":606,"tag":3707,"props":3950,"children":3951},{},[3952],{"type":612,"value":3953},"Iterator of paths",{"type":606,"tag":3680,"props":3955,"children":3956},{},[3957,3966,3971],{"type":606,"tag":3707,"props":3958,"children":3959},{},[3960],{"type":606,"tag":621,"props":3961,"children":3963},{"className":3962},[],[3964],{"type":612,"value":3965},".glob()",{"type":606,"tag":3707,"props":3967,"children":3968},{},[3969],{"type":612,"value":3970},"Find files by pattern",{"type":606,"tag":3707,"props":3972,"children":3973},{},[3974],{"type":612,"value":3975},"List of matching paths",{"type":606,"tag":855,"props":3977,"children":3979},{"id":3978},"key-takeaways",[3980],{"type":612,"value":3981},"🎯 Key Takeaways",{"type":606,"tag":867,"props":3983,"children":3987},{"emoji":3984,"title":3985,"type":3986},"📚","Path Handling Essentials","success",[3988,3996,4032,4040,4062,4070,4112],{"type":606,"tag":615,"props":3989,"children":3990},{},[3991],{"type":606,"tag":877,"props":3992,"children":3993},{},[3994],{"type":612,"value":3995},"Basic Operations:",{"type":606,"tag":883,"props":3997,"children":3998},{},[3999,4011,4022,4027],{"type":606,"tag":887,"props":4000,"children":4001},{},[4002,4004,4009],{"type":612,"value":4003},"Use ",{"type":606,"tag":621,"props":4005,"children":4007},{"className":4006},[],[4008],{"type":612,"value":895},{"type":612,"value":4010}," for modern code",{"type":606,"tag":887,"props":4012,"children":4013},{},[4014,4015,4020],{"type":612,"value":4003},{"type":606,"tag":621,"props":4016,"children":4018},{"className":4017},[],[4019],{"type":612,"value":1710},{"type":612,"value":4021}," operator to join paths",{"type":606,"tag":887,"props":4023,"children":4024},{},[4025],{"type":612,"value":4026},"Check existence before operations",{"type":606,"tag":887,"props":4028,"children":4029},{},[4030],{"type":612,"value":4031},"Handle exceptions gracefully",{"type":606,"tag":615,"props":4033,"children":4034},{},[4035],{"type":606,"tag":877,"props":4036,"children":4037},{},[4038],{"type":612,"value":4039},"Advanced Features:",{"type":606,"tag":883,"props":4041,"children":4042},{},[4043,4047,4052,4057],{"type":606,"tag":887,"props":4044,"children":4045},{},[4046],{"type":612,"value":902},{"type":606,"tag":887,"props":4048,"children":4049},{},[4050],{"type":612,"value":4051},"Pattern matching with glob",{"type":606,"tag":887,"props":4053,"children":4054},{},[4055],{"type":612,"value":4056},"Directory tree operations",{"type":606,"tag":887,"props":4058,"children":4059},{},[4060],{"type":612,"value":4061},"Path validation and normalization",{"type":606,"tag":615,"props":4063,"children":4064},{},[4065],{"type":606,"tag":877,"props":4066,"children":4067},{},[4068],{"type":612,"value":4069},"Best Practices:",{"type":606,"tag":883,"props":4071,"children":4072},{},[4073,4089,4102,4107],{"type":606,"tag":887,"props":4074,"children":4075},{},[4076,4077,4082,4084],{"type":612,"value":4003},{"type":606,"tag":621,"props":4078,"children":4080},{"className":4079},[],[4081],{"type":612,"value":626},{"type":612,"value":4083}," over ",{"type":606,"tag":621,"props":4085,"children":4087},{"className":4086},[],[4088],{"type":612,"value":634},{"type":606,"tag":887,"props":4090,"children":4091},{},[4092,4094,4100],{"type":612,"value":4093},"Always use ",{"type":606,"tag":621,"props":4095,"children":4097},{"className":4096},[],[4098],{"type":612,"value":4099},"parents=True, exist_ok=True",{"type":612,"value":4101}," for mkdir",{"type":606,"tag":887,"props":4103,"children":4104},{},[4105],{"type":612,"value":4106},"Validate paths before operations",{"type":606,"tag":887,"props":4108,"children":4109},{},[4110],{"type":612,"value":4111},"Handle platform differences",{"type":606,"tag":615,"props":4113,"children":4114},{},[4115,4120],{"type":606,"tag":877,"props":4116,"children":4117},{},[4118],{"type":612,"value":4119},"Remember:",{"type":612,"value":4121}," Paths are objects in pathlib - use methods and operators for manipulation!",{"type":606,"tag":4123,"props":4124,"children":4125},"style",{},[4126],{"type":612,"value":4127},"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 .app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}html.app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}",{"title":8,"searchDepth":36,"depth":36,"links":4129},[4130,4135,4141,4142],{"id":857,"depth":27,"text":860,"children":4131},[4132,4133,4134],{"id":959,"depth":36,"text":962},{"id":1293,"depth":36,"text":1296},{"id":1642,"depth":36,"text":1645},{"id":1909,"depth":27,"text":1912,"children":4136},[4137,4138,4139,4140],{"id":1920,"depth":36,"text":1923},{"id":2334,"depth":36,"text":2337},{"id":2608,"depth":36,"text":2611},{"id":3244,"depth":36,"text":3247},{"id":3667,"depth":27,"text":3670},{"id":3978,"depth":27,"text":3981},1782373756883]