[{"data":1,"prerenderedAt":2921},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/read-text-files":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",[222],{"_path":223,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":224,"description":225,"slug":226,"parentId":213,"order":227,"body":602,"_type":15,"_id":228,"_source":17,"_file":229,"_stem":230,"_extension":20},{"type":603,"children":604,"toc":2907},"root",[605,614,620,739,746,751,836,843,1213,1219,1445,1451,1654,1660,1665,1671,1893,1899,2140,2146,2620,2626,2767,2773,2901],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"reading-text-files",[611],{"type":612,"value":613},"text","📖 Reading Text Files",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618],{"type":612,"value":619},"Python provides multiple ways to read text files. Understanding these methods is essential for data processing, configuration loading, and content analysis.",{"type":606,"tag":621,"props":622,"children":623},"code-try",{},[624],{"type":606,"tag":625,"props":626,"children":630},"pre",{"className":627,"code":628,"language":629,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","# Basic file reading\nwith open('example.txt', 'r') as file:\n    content = file.read()\n    print(content)\n","python",[631],{"type":606,"tag":632,"props":633,"children":634},"code",{"__ignoreMap":8},[635,646,704,726],{"type":606,"tag":636,"props":637,"children":639},"span",{"class":638,"line":12},"line",[640],{"type":606,"tag":636,"props":641,"children":643},{"style":642},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[644],{"type":612,"value":645},"# Basic file reading\n",{"type":606,"tag":636,"props":647,"children":648},{"class":638,"line":27},[649,655,661,667,673,678,683,688,693,699],{"type":606,"tag":636,"props":650,"children":652},{"style":651},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[653],{"type":612,"value":654},"with",{"type":606,"tag":636,"props":656,"children":658},{"style":657},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[659],{"type":612,"value":660}," open",{"type":606,"tag":636,"props":662,"children":664},{"style":663},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[665],{"type":612,"value":666},"(",{"type":606,"tag":636,"props":668,"children":670},{"style":669},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[671],{"type":612,"value":672},"'example.txt'",{"type":606,"tag":636,"props":674,"children":675},{"style":663},[676],{"type":612,"value":677},", ",{"type":606,"tag":636,"props":679,"children":680},{"style":669},[681],{"type":612,"value":682},"'r'",{"type":606,"tag":636,"props":684,"children":685},{"style":663},[686],{"type":612,"value":687},") ",{"type":606,"tag":636,"props":689,"children":690},{"style":651},[691],{"type":612,"value":692},"as",{"type":606,"tag":636,"props":694,"children":696},{"style":695},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[697],{"type":612,"value":698}," file",{"type":606,"tag":636,"props":700,"children":701},{"style":663},[702],{"type":612,"value":703},":\n",{"type":606,"tag":636,"props":705,"children":706},{"class":638,"line":36},[707,712,717,721],{"type":606,"tag":636,"props":708,"children":709},{"style":663},[710],{"type":612,"value":711},"    content ",{"type":606,"tag":636,"props":713,"children":714},{"style":651},[715],{"type":612,"value":716},"=",{"type":606,"tag":636,"props":718,"children":719},{"style":695},[720],{"type":612,"value":698},{"type":606,"tag":636,"props":722,"children":723},{"style":663},[724],{"type":612,"value":725},".read()\n",{"type":606,"tag":636,"props":727,"children":728},{"class":638,"line":45},[729,734],{"type":606,"tag":636,"props":730,"children":731},{"style":657},[732],{"type":612,"value":733},"    print",{"type":606,"tag":636,"props":735,"children":736},{"style":663},[737],{"type":612,"value":738},"(content)\n",{"type":606,"tag":740,"props":741,"children":743},"h2",{"id":742},"reading-methods",[744],{"type":612,"value":745},"🎯 Reading Methods",{"type":606,"tag":615,"props":747,"children":748},{},[749],{"type":612,"value":750},"Python offers several approaches to read text files.",{"type":606,"tag":752,"props":753,"children":757},"info-box",{"emoji":754,"title":755,"type":756},"📝","File Reading Methods","info",[758,767,810,818],{"type":606,"tag":615,"props":759,"children":760},{},[761],{"type":606,"tag":762,"props":763,"children":764},"strong",{},[765],{"type":612,"value":766},"Basic Methods:",{"type":606,"tag":768,"props":769,"children":770},"ul",{},[771,783,794,805],{"type":606,"tag":772,"props":773,"children":774},"li",{},[775,781],{"type":606,"tag":632,"props":776,"children":778},{"className":777},[],[779],{"type":612,"value":780},".read()",{"type":612,"value":782},": Read entire file as string",{"type":606,"tag":772,"props":784,"children":785},{},[786,792],{"type":606,"tag":632,"props":787,"children":789},{"className":788},[],[790],{"type":612,"value":791},".readline()",{"type":612,"value":793},": Read one line at a time",{"type":606,"tag":772,"props":795,"children":796},{},[797,803],{"type":606,"tag":632,"props":798,"children":800},{"className":799},[],[801],{"type":612,"value":802},".readlines()",{"type":612,"value":804},": Read all lines as list",{"type":606,"tag":772,"props":806,"children":807},{},[808],{"type":612,"value":809},"Iteration: Read line by line efficiently",{"type":606,"tag":615,"props":811,"children":812},{},[813],{"type":606,"tag":762,"props":814,"children":815},{},[816],{"type":612,"value":817},"Key Differences:",{"type":606,"tag":768,"props":819,"children":820},{},[821,826,831],{"type":606,"tag":772,"props":822,"children":823},{},[824],{"type":612,"value":825},"Memory usage varies by method",{"type":606,"tag":772,"props":827,"children":828},{},[829],{"type":612,"value":830},"Performance considerations",{"type":606,"tag":772,"props":832,"children":833},{},[834],{"type":612,"value":835},"Use case scenarios",{"type":606,"tag":837,"props":838,"children":840},"h3",{"id":839},"reading-entire-files",[841],{"type":612,"value":842},"Reading Entire Files",{"type":606,"tag":621,"props":844,"children":845},{},[846],{"type":606,"tag":625,"props":847,"children":849},{"className":627,"code":848,"language":629,"meta":8,"style":8},"# Read entire file at once\nfilename = 'sample.txt'\n\n# Read method - gets all content as string\nwith open(filename, 'r') as file:\n    content = file.read()\n    print(f\"Entire file: {content[:50]}...\")\n\n# Readlines method - gets all lines as list\nwith open(filename, 'r') as file:\n    lines = file.readlines()\n    print(f\"Number of lines: {len(lines)}\")\n    if lines:\n        print(f\"First line: {lines[0].strip()}\")\n\nprint(\"File reading completed\")\n",[850],{"type":606,"tag":632,"props":851,"children":852},{"__ignoreMap":8},[853,861,878,886,894,930,949,1005,1012,1021,1056,1077,1120,1133,1185,1192],{"type":606,"tag":636,"props":854,"children":855},{"class":638,"line":12},[856],{"type":606,"tag":636,"props":857,"children":858},{"style":642},[859],{"type":612,"value":860},"# Read entire file at once\n",{"type":606,"tag":636,"props":862,"children":863},{"class":638,"line":27},[864,869,873],{"type":606,"tag":636,"props":865,"children":866},{"style":663},[867],{"type":612,"value":868},"filename ",{"type":606,"tag":636,"props":870,"children":871},{"style":651},[872],{"type":612,"value":716},{"type":606,"tag":636,"props":874,"children":875},{"style":669},[876],{"type":612,"value":877}," 'sample.txt'\n",{"type":606,"tag":636,"props":879,"children":880},{"class":638,"line":36},[881],{"type":606,"tag":636,"props":882,"children":883},{"emptyLinePlaceholder":13},[884],{"type":612,"value":885},"\n",{"type":606,"tag":636,"props":887,"children":888},{"class":638,"line":45},[889],{"type":606,"tag":636,"props":890,"children":891},{"style":642},[892],{"type":612,"value":893},"# Read method - gets all content as string\n",{"type":606,"tag":636,"props":895,"children":896},{"class":638,"line":54},[897,901,905,910,914,918,922,926],{"type":606,"tag":636,"props":898,"children":899},{"style":651},[900],{"type":612,"value":654},{"type":606,"tag":636,"props":902,"children":903},{"style":657},[904],{"type":612,"value":660},{"type":606,"tag":636,"props":906,"children":907},{"style":663},[908],{"type":612,"value":909},"(filename, ",{"type":606,"tag":636,"props":911,"children":912},{"style":669},[913],{"type":612,"value":682},{"type":606,"tag":636,"props":915,"children":916},{"style":663},[917],{"type":612,"value":687},{"type":606,"tag":636,"props":919,"children":920},{"style":651},[921],{"type":612,"value":692},{"type":606,"tag":636,"props":923,"children":924},{"style":695},[925],{"type":612,"value":698},{"type":606,"tag":636,"props":927,"children":928},{"style":663},[929],{"type":612,"value":703},{"type":606,"tag":636,"props":931,"children":932},{"class":638,"line":63},[933,937,941,945],{"type":606,"tag":636,"props":934,"children":935},{"style":663},[936],{"type":612,"value":711},{"type":606,"tag":636,"props":938,"children":939},{"style":651},[940],{"type":612,"value":716},{"type":606,"tag":636,"props":942,"children":943},{"style":695},[944],{"type":612,"value":698},{"type":606,"tag":636,"props":946,"children":947},{"style":663},[948],{"type":612,"value":725},{"type":606,"tag":636,"props":950,"children":951},{"class":638,"line":72},[952,956,960,965,970,975,980,985,990,995,1000],{"type":606,"tag":636,"props":953,"children":954},{"style":657},[955],{"type":612,"value":733},{"type":606,"tag":636,"props":957,"children":958},{"style":663},[959],{"type":612,"value":666},{"type":606,"tag":636,"props":961,"children":962},{"style":651},[963],{"type":612,"value":964},"f",{"type":606,"tag":636,"props":966,"children":967},{"style":669},[968],{"type":612,"value":969},"\"Entire file: ",{"type":606,"tag":636,"props":971,"children":972},{"style":657},[973],{"type":612,"value":974},"{",{"type":606,"tag":636,"props":976,"children":977},{"style":663},[978],{"type":612,"value":979},"content[:",{"type":606,"tag":636,"props":981,"children":982},{"style":657},[983],{"type":612,"value":984},"50",{"type":606,"tag":636,"props":986,"children":987},{"style":663},[988],{"type":612,"value":989},"]",{"type":606,"tag":636,"props":991,"children":992},{"style":657},[993],{"type":612,"value":994},"}",{"type":606,"tag":636,"props":996,"children":997},{"style":669},[998],{"type":612,"value":999},"...\"",{"type":606,"tag":636,"props":1001,"children":1002},{"style":663},[1003],{"type":612,"value":1004},")\n",{"type":606,"tag":636,"props":1006,"children":1007},{"class":638,"line":81},[1008],{"type":606,"tag":636,"props":1009,"children":1010},{"emptyLinePlaceholder":13},[1011],{"type":612,"value":885},{"type":606,"tag":636,"props":1013,"children":1015},{"class":638,"line":1014},9,[1016],{"type":606,"tag":636,"props":1017,"children":1018},{"style":642},[1019],{"type":612,"value":1020},"# Readlines method - gets all lines as list\n",{"type":606,"tag":636,"props":1022,"children":1023},{"class":638,"line":99},[1024,1028,1032,1036,1040,1044,1048,1052],{"type":606,"tag":636,"props":1025,"children":1026},{"style":651},[1027],{"type":612,"value":654},{"type":606,"tag":636,"props":1029,"children":1030},{"style":657},[1031],{"type":612,"value":660},{"type":606,"tag":636,"props":1033,"children":1034},{"style":663},[1035],{"type":612,"value":909},{"type":606,"tag":636,"props":1037,"children":1038},{"style":669},[1039],{"type":612,"value":682},{"type":606,"tag":636,"props":1041,"children":1042},{"style":663},[1043],{"type":612,"value":687},{"type":606,"tag":636,"props":1045,"children":1046},{"style":651},[1047],{"type":612,"value":692},{"type":606,"tag":636,"props":1049,"children":1050},{"style":695},[1051],{"type":612,"value":698},{"type":606,"tag":636,"props":1053,"children":1054},{"style":663},[1055],{"type":612,"value":703},{"type":606,"tag":636,"props":1057,"children":1058},{"class":638,"line":108},[1059,1064,1068,1072],{"type":606,"tag":636,"props":1060,"children":1061},{"style":663},[1062],{"type":612,"value":1063},"    lines ",{"type":606,"tag":636,"props":1065,"children":1066},{"style":651},[1067],{"type":612,"value":716},{"type":606,"tag":636,"props":1069,"children":1070},{"style":695},[1071],{"type":612,"value":698},{"type":606,"tag":636,"props":1073,"children":1074},{"style":663},[1075],{"type":612,"value":1076},".readlines()\n",{"type":606,"tag":636,"props":1078,"children":1079},{"class":638,"line":117},[1080,1084,1088,1092,1097,1102,1107,1111,1116],{"type":606,"tag":636,"props":1081,"children":1082},{"style":657},[1083],{"type":612,"value":733},{"type":606,"tag":636,"props":1085,"children":1086},{"style":663},[1087],{"type":612,"value":666},{"type":606,"tag":636,"props":1089,"children":1090},{"style":651},[1091],{"type":612,"value":964},{"type":606,"tag":636,"props":1093,"children":1094},{"style":669},[1095],{"type":612,"value":1096},"\"Number of lines: ",{"type":606,"tag":636,"props":1098,"children":1099},{"style":657},[1100],{"type":612,"value":1101},"{len",{"type":606,"tag":636,"props":1103,"children":1104},{"style":663},[1105],{"type":612,"value":1106},"(lines)",{"type":606,"tag":636,"props":1108,"children":1109},{"style":657},[1110],{"type":612,"value":994},{"type":606,"tag":636,"props":1112,"children":1113},{"style":669},[1114],{"type":612,"value":1115},"\"",{"type":606,"tag":636,"props":1117,"children":1118},{"style":663},[1119],{"type":612,"value":1004},{"type":606,"tag":636,"props":1121,"children":1122},{"class":638,"line":126},[1123,1128],{"type":606,"tag":636,"props":1124,"children":1125},{"style":651},[1126],{"type":612,"value":1127},"    if",{"type":606,"tag":636,"props":1129,"children":1130},{"style":663},[1131],{"type":612,"value":1132}," lines:\n",{"type":606,"tag":636,"props":1134,"children":1135},{"class":638,"line":135},[1136,1141,1145,1149,1154,1158,1163,1168,1173,1177,1181],{"type":606,"tag":636,"props":1137,"children":1138},{"style":657},[1139],{"type":612,"value":1140},"        print",{"type":606,"tag":636,"props":1142,"children":1143},{"style":663},[1144],{"type":612,"value":666},{"type":606,"tag":636,"props":1146,"children":1147},{"style":651},[1148],{"type":612,"value":964},{"type":606,"tag":636,"props":1150,"children":1151},{"style":669},[1152],{"type":612,"value":1153},"\"First line: ",{"type":606,"tag":636,"props":1155,"children":1156},{"style":657},[1157],{"type":612,"value":974},{"type":606,"tag":636,"props":1159,"children":1160},{"style":663},[1161],{"type":612,"value":1162},"lines[",{"type":606,"tag":636,"props":1164,"children":1165},{"style":657},[1166],{"type":612,"value":1167},"0",{"type":606,"tag":636,"props":1169,"children":1170},{"style":663},[1171],{"type":612,"value":1172},"].strip()",{"type":606,"tag":636,"props":1174,"children":1175},{"style":657},[1176],{"type":612,"value":994},{"type":606,"tag":636,"props":1178,"children":1179},{"style":669},[1180],{"type":612,"value":1115},{"type":606,"tag":636,"props":1182,"children":1183},{"style":663},[1184],{"type":612,"value":1004},{"type":606,"tag":636,"props":1186,"children":1187},{"class":638,"line":144},[1188],{"type":606,"tag":636,"props":1189,"children":1190},{"emptyLinePlaceholder":13},[1191],{"type":612,"value":885},{"type":606,"tag":636,"props":1193,"children":1194},{"class":638,"line":153},[1195,1200,1204,1209],{"type":606,"tag":636,"props":1196,"children":1197},{"style":657},[1198],{"type":612,"value":1199},"print",{"type":606,"tag":636,"props":1201,"children":1202},{"style":663},[1203],{"type":612,"value":666},{"type":606,"tag":636,"props":1205,"children":1206},{"style":669},[1207],{"type":612,"value":1208},"\"File reading completed\"",{"type":606,"tag":636,"props":1210,"children":1211},{"style":663},[1212],{"type":612,"value":1004},{"type":606,"tag":837,"props":1214,"children":1216},{"id":1215},"line-by-line-reading",[1217],{"type":612,"value":1218},"Line-by-Line Reading",{"type":606,"tag":621,"props":1220,"children":1221},{},[1222],{"type":606,"tag":625,"props":1223,"children":1225},{"className":627,"code":1224,"language":629,"meta":8,"style":8},"# Memory efficient line-by-line reading\nwith open(filename, 'r') as file:\n    for line_num, line in enumerate(file, 1):\n        print(f\"Line {line_num}: {line.strip()}\")\n        if line_num >= 3:  # Show first 3 lines only\n            break\n\nprint(\"Line-by-line reading completed\")\n",[1226],{"type":606,"tag":632,"props":1227,"children":1228},{"__ignoreMap":8},[1229,1237,1272,1318,1377,1410,1418,1425],{"type":606,"tag":636,"props":1230,"children":1231},{"class":638,"line":12},[1232],{"type":606,"tag":636,"props":1233,"children":1234},{"style":642},[1235],{"type":612,"value":1236},"# Memory efficient line-by-line reading\n",{"type":606,"tag":636,"props":1238,"children":1239},{"class":638,"line":27},[1240,1244,1248,1252,1256,1260,1264,1268],{"type":606,"tag":636,"props":1241,"children":1242},{"style":651},[1243],{"type":612,"value":654},{"type":606,"tag":636,"props":1245,"children":1246},{"style":657},[1247],{"type":612,"value":660},{"type":606,"tag":636,"props":1249,"children":1250},{"style":663},[1251],{"type":612,"value":909},{"type":606,"tag":636,"props":1253,"children":1254},{"style":669},[1255],{"type":612,"value":682},{"type":606,"tag":636,"props":1257,"children":1258},{"style":663},[1259],{"type":612,"value":687},{"type":606,"tag":636,"props":1261,"children":1262},{"style":651},[1263],{"type":612,"value":692},{"type":606,"tag":636,"props":1265,"children":1266},{"style":695},[1267],{"type":612,"value":698},{"type":606,"tag":636,"props":1269,"children":1270},{"style":663},[1271],{"type":612,"value":703},{"type":606,"tag":636,"props":1273,"children":1274},{"class":638,"line":36},[1275,1280,1285,1290,1295,1299,1304,1308,1313],{"type":606,"tag":636,"props":1276,"children":1277},{"style":651},[1278],{"type":612,"value":1279},"    for",{"type":606,"tag":636,"props":1281,"children":1282},{"style":663},[1283],{"type":612,"value":1284}," line_num, line ",{"type":606,"tag":636,"props":1286,"children":1287},{"style":651},[1288],{"type":612,"value":1289},"in",{"type":606,"tag":636,"props":1291,"children":1292},{"style":657},[1293],{"type":612,"value":1294}," enumerate",{"type":606,"tag":636,"props":1296,"children":1297},{"style":663},[1298],{"type":612,"value":666},{"type":606,"tag":636,"props":1300,"children":1301},{"style":695},[1302],{"type":612,"value":1303},"file",{"type":606,"tag":636,"props":1305,"children":1306},{"style":663},[1307],{"type":612,"value":677},{"type":606,"tag":636,"props":1309,"children":1310},{"style":657},[1311],{"type":612,"value":1312},"1",{"type":606,"tag":636,"props":1314,"children":1315},{"style":663},[1316],{"type":612,"value":1317},"):\n",{"type":606,"tag":636,"props":1319,"children":1320},{"class":638,"line":45},[1321,1325,1329,1333,1338,1342,1347,1351,1356,1360,1365,1369,1373],{"type":606,"tag":636,"props":1322,"children":1323},{"style":657},[1324],{"type":612,"value":1140},{"type":606,"tag":636,"props":1326,"children":1327},{"style":663},[1328],{"type":612,"value":666},{"type":606,"tag":636,"props":1330,"children":1331},{"style":651},[1332],{"type":612,"value":964},{"type":606,"tag":636,"props":1334,"children":1335},{"style":669},[1336],{"type":612,"value":1337},"\"Line ",{"type":606,"tag":636,"props":1339,"children":1340},{"style":657},[1341],{"type":612,"value":974},{"type":606,"tag":636,"props":1343,"children":1344},{"style":663},[1345],{"type":612,"value":1346},"line_num",{"type":606,"tag":636,"props":1348,"children":1349},{"style":657},[1350],{"type":612,"value":994},{"type":606,"tag":636,"props":1352,"children":1353},{"style":669},[1354],{"type":612,"value":1355},": ",{"type":606,"tag":636,"props":1357,"children":1358},{"style":657},[1359],{"type":612,"value":974},{"type":606,"tag":636,"props":1361,"children":1362},{"style":663},[1363],{"type":612,"value":1364},"line.strip()",{"type":606,"tag":636,"props":1366,"children":1367},{"style":657},[1368],{"type":612,"value":994},{"type":606,"tag":636,"props":1370,"children":1371},{"style":669},[1372],{"type":612,"value":1115},{"type":606,"tag":636,"props":1374,"children":1375},{"style":663},[1376],{"type":612,"value":1004},{"type":606,"tag":636,"props":1378,"children":1379},{"class":638,"line":54},[1380,1385,1390,1395,1400,1405],{"type":606,"tag":636,"props":1381,"children":1382},{"style":651},[1383],{"type":612,"value":1384},"        if",{"type":606,"tag":636,"props":1386,"children":1387},{"style":663},[1388],{"type":612,"value":1389}," line_num ",{"type":606,"tag":636,"props":1391,"children":1392},{"style":651},[1393],{"type":612,"value":1394},">=",{"type":606,"tag":636,"props":1396,"children":1397},{"style":657},[1398],{"type":612,"value":1399}," 3",{"type":606,"tag":636,"props":1401,"children":1402},{"style":663},[1403],{"type":612,"value":1404},":  ",{"type":606,"tag":636,"props":1406,"children":1407},{"style":642},[1408],{"type":612,"value":1409},"# Show first 3 lines only\n",{"type":606,"tag":636,"props":1411,"children":1412},{"class":638,"line":63},[1413],{"type":606,"tag":636,"props":1414,"children":1415},{"style":651},[1416],{"type":612,"value":1417},"            break\n",{"type":606,"tag":636,"props":1419,"children":1420},{"class":638,"line":72},[1421],{"type":606,"tag":636,"props":1422,"children":1423},{"emptyLinePlaceholder":13},[1424],{"type":612,"value":885},{"type":606,"tag":636,"props":1426,"children":1427},{"class":638,"line":81},[1428,1432,1436,1441],{"type":606,"tag":636,"props":1429,"children":1430},{"style":657},[1431],{"type":612,"value":1199},{"type":606,"tag":636,"props":1433,"children":1434},{"style":663},[1435],{"type":612,"value":666},{"type":606,"tag":636,"props":1437,"children":1438},{"style":669},[1439],{"type":612,"value":1440},"\"Line-by-line reading completed\"",{"type":606,"tag":636,"props":1442,"children":1443},{"style":663},[1444],{"type":612,"value":1004},{"type":606,"tag":837,"props":1446,"children":1448},{"id":1447},"single-line-reading",[1449],{"type":612,"value":1450},"Single Line Reading",{"type":606,"tag":621,"props":1452,"children":1453},{},[1454],{"type":606,"tag":625,"props":1455,"children":1457},{"className":627,"code":1456,"language":629,"meta":8,"style":8},"# Read one line at a time\nwith open(filename, 'r') as file:\n    first_line = file.readline()\n    second_line = file.readline()\n    print(f\"First: {first_line.strip()}\")\n    print(f\"Second: {second_line.strip()}\")\n\nprint(\"Single line reading completed\")\n",[1458],{"type":606,"tag":632,"props":1459,"children":1460},{"__ignoreMap":8},[1461,1469,1504,1525,1545,1586,1627,1634],{"type":606,"tag":636,"props":1462,"children":1463},{"class":638,"line":12},[1464],{"type":606,"tag":636,"props":1465,"children":1466},{"style":642},[1467],{"type":612,"value":1468},"# Read one line at a time\n",{"type":606,"tag":636,"props":1470,"children":1471},{"class":638,"line":27},[1472,1476,1480,1484,1488,1492,1496,1500],{"type":606,"tag":636,"props":1473,"children":1474},{"style":651},[1475],{"type":612,"value":654},{"type":606,"tag":636,"props":1477,"children":1478},{"style":657},[1479],{"type":612,"value":660},{"type":606,"tag":636,"props":1481,"children":1482},{"style":663},[1483],{"type":612,"value":909},{"type":606,"tag":636,"props":1485,"children":1486},{"style":669},[1487],{"type":612,"value":682},{"type":606,"tag":636,"props":1489,"children":1490},{"style":663},[1491],{"type":612,"value":687},{"type":606,"tag":636,"props":1493,"children":1494},{"style":651},[1495],{"type":612,"value":692},{"type":606,"tag":636,"props":1497,"children":1498},{"style":695},[1499],{"type":612,"value":698},{"type":606,"tag":636,"props":1501,"children":1502},{"style":663},[1503],{"type":612,"value":703},{"type":606,"tag":636,"props":1505,"children":1506},{"class":638,"line":36},[1507,1512,1516,1520],{"type":606,"tag":636,"props":1508,"children":1509},{"style":663},[1510],{"type":612,"value":1511},"    first_line ",{"type":606,"tag":636,"props":1513,"children":1514},{"style":651},[1515],{"type":612,"value":716},{"type":606,"tag":636,"props":1517,"children":1518},{"style":695},[1519],{"type":612,"value":698},{"type":606,"tag":636,"props":1521,"children":1522},{"style":663},[1523],{"type":612,"value":1524},".readline()\n",{"type":606,"tag":636,"props":1526,"children":1527},{"class":638,"line":45},[1528,1533,1537,1541],{"type":606,"tag":636,"props":1529,"children":1530},{"style":663},[1531],{"type":612,"value":1532},"    second_line ",{"type":606,"tag":636,"props":1534,"children":1535},{"style":651},[1536],{"type":612,"value":716},{"type":606,"tag":636,"props":1538,"children":1539},{"style":695},[1540],{"type":612,"value":698},{"type":606,"tag":636,"props":1542,"children":1543},{"style":663},[1544],{"type":612,"value":1524},{"type":606,"tag":636,"props":1546,"children":1547},{"class":638,"line":54},[1548,1552,1556,1560,1565,1569,1574,1578,1582],{"type":606,"tag":636,"props":1549,"children":1550},{"style":657},[1551],{"type":612,"value":733},{"type":606,"tag":636,"props":1553,"children":1554},{"style":663},[1555],{"type":612,"value":666},{"type":606,"tag":636,"props":1557,"children":1558},{"style":651},[1559],{"type":612,"value":964},{"type":606,"tag":636,"props":1561,"children":1562},{"style":669},[1563],{"type":612,"value":1564},"\"First: ",{"type":606,"tag":636,"props":1566,"children":1567},{"style":657},[1568],{"type":612,"value":974},{"type":606,"tag":636,"props":1570,"children":1571},{"style":663},[1572],{"type":612,"value":1573},"first_line.strip()",{"type":606,"tag":636,"props":1575,"children":1576},{"style":657},[1577],{"type":612,"value":994},{"type":606,"tag":636,"props":1579,"children":1580},{"style":669},[1581],{"type":612,"value":1115},{"type":606,"tag":636,"props":1583,"children":1584},{"style":663},[1585],{"type":612,"value":1004},{"type":606,"tag":636,"props":1587,"children":1588},{"class":638,"line":63},[1589,1593,1597,1601,1606,1610,1615,1619,1623],{"type":606,"tag":636,"props":1590,"children":1591},{"style":657},[1592],{"type":612,"value":733},{"type":606,"tag":636,"props":1594,"children":1595},{"style":663},[1596],{"type":612,"value":666},{"type":606,"tag":636,"props":1598,"children":1599},{"style":651},[1600],{"type":612,"value":964},{"type":606,"tag":636,"props":1602,"children":1603},{"style":669},[1604],{"type":612,"value":1605},"\"Second: ",{"type":606,"tag":636,"props":1607,"children":1608},{"style":657},[1609],{"type":612,"value":974},{"type":606,"tag":636,"props":1611,"children":1612},{"style":663},[1613],{"type":612,"value":1614},"second_line.strip()",{"type":606,"tag":636,"props":1616,"children":1617},{"style":657},[1618],{"type":612,"value":994},{"type":606,"tag":636,"props":1620,"children":1621},{"style":669},[1622],{"type":612,"value":1115},{"type":606,"tag":636,"props":1624,"children":1625},{"style":663},[1626],{"type":612,"value":1004},{"type":606,"tag":636,"props":1628,"children":1629},{"class":638,"line":72},[1630],{"type":606,"tag":636,"props":1631,"children":1632},{"emptyLinePlaceholder":13},[1633],{"type":612,"value":885},{"type":606,"tag":636,"props":1635,"children":1636},{"class":638,"line":81},[1637,1641,1645,1650],{"type":606,"tag":636,"props":1638,"children":1639},{"style":657},[1640],{"type":612,"value":1199},{"type":606,"tag":636,"props":1642,"children":1643},{"style":663},[1644],{"type":612,"value":666},{"type":606,"tag":636,"props":1646,"children":1647},{"style":669},[1648],{"type":612,"value":1649},"\"Single line reading completed\"",{"type":606,"tag":636,"props":1651,"children":1652},{"style":663},[1653],{"type":612,"value":1004},{"type":606,"tag":740,"props":1655,"children":1657},{"id":1656},"advanced-reading-techniques",[1658],{"type":612,"value":1659},"🔍 Advanced Reading Techniques",{"type":606,"tag":615,"props":1661,"children":1662},{},[1663],{"type":612,"value":1664},"Python allows more sophisticated file reading operations.",{"type":606,"tag":837,"props":1666,"children":1668},{"id":1667},"file-existence-and-encoding",[1669],{"type":612,"value":1670},"File Existence and Encoding",{"type":606,"tag":621,"props":1672,"children":1673},{},[1674],{"type":606,"tag":625,"props":1675,"children":1677},{"className":627,"code":1676,"language":629,"meta":8,"style":8},"import os\n\n# Check if file exists before reading\nfilename = 'config.txt'\nif os.path.exists(filename):\n    with open(filename, 'r') as file:\n        content = file.read()\n        print(f\"File content: {content}\")\nelse:\n    print(\"File not found\")\n\nprint(\"File existence check completed\")\n",[1678],{"type":606,"tag":632,"props":1679,"children":1680},{"__ignoreMap":8},[1681,1694,1701,1709,1725,1738,1774,1794,1834,1846,1866,1873],{"type":606,"tag":636,"props":1682,"children":1683},{"class":638,"line":12},[1684,1689],{"type":606,"tag":636,"props":1685,"children":1686},{"style":651},[1687],{"type":612,"value":1688},"import",{"type":606,"tag":636,"props":1690,"children":1691},{"style":663},[1692],{"type":612,"value":1693}," os\n",{"type":606,"tag":636,"props":1695,"children":1696},{"class":638,"line":27},[1697],{"type":606,"tag":636,"props":1698,"children":1699},{"emptyLinePlaceholder":13},[1700],{"type":612,"value":885},{"type":606,"tag":636,"props":1702,"children":1703},{"class":638,"line":36},[1704],{"type":606,"tag":636,"props":1705,"children":1706},{"style":642},[1707],{"type":612,"value":1708},"# Check if file exists before reading\n",{"type":606,"tag":636,"props":1710,"children":1711},{"class":638,"line":45},[1712,1716,1720],{"type":606,"tag":636,"props":1713,"children":1714},{"style":663},[1715],{"type":612,"value":868},{"type":606,"tag":636,"props":1717,"children":1718},{"style":651},[1719],{"type":612,"value":716},{"type":606,"tag":636,"props":1721,"children":1722},{"style":669},[1723],{"type":612,"value":1724}," 'config.txt'\n",{"type":606,"tag":636,"props":1726,"children":1727},{"class":638,"line":54},[1728,1733],{"type":606,"tag":636,"props":1729,"children":1730},{"style":651},[1731],{"type":612,"value":1732},"if",{"type":606,"tag":636,"props":1734,"children":1735},{"style":663},[1736],{"type":612,"value":1737}," os.path.exists(filename):\n",{"type":606,"tag":636,"props":1739,"children":1740},{"class":638,"line":63},[1741,1746,1750,1754,1758,1762,1766,1770],{"type":606,"tag":636,"props":1742,"children":1743},{"style":651},[1744],{"type":612,"value":1745},"    with",{"type":606,"tag":636,"props":1747,"children":1748},{"style":657},[1749],{"type":612,"value":660},{"type":606,"tag":636,"props":1751,"children":1752},{"style":663},[1753],{"type":612,"value":909},{"type":606,"tag":636,"props":1755,"children":1756},{"style":669},[1757],{"type":612,"value":682},{"type":606,"tag":636,"props":1759,"children":1760},{"style":663},[1761],{"type":612,"value":687},{"type":606,"tag":636,"props":1763,"children":1764},{"style":651},[1765],{"type":612,"value":692},{"type":606,"tag":636,"props":1767,"children":1768},{"style":695},[1769],{"type":612,"value":698},{"type":606,"tag":636,"props":1771,"children":1772},{"style":663},[1773],{"type":612,"value":703},{"type":606,"tag":636,"props":1775,"children":1776},{"class":638,"line":72},[1777,1782,1786,1790],{"type":606,"tag":636,"props":1778,"children":1779},{"style":663},[1780],{"type":612,"value":1781},"        content ",{"type":606,"tag":636,"props":1783,"children":1784},{"style":651},[1785],{"type":612,"value":716},{"type":606,"tag":636,"props":1787,"children":1788},{"style":695},[1789],{"type":612,"value":698},{"type":606,"tag":636,"props":1791,"children":1792},{"style":663},[1793],{"type":612,"value":725},{"type":606,"tag":636,"props":1795,"children":1796},{"class":638,"line":81},[1797,1801,1805,1809,1814,1818,1822,1826,1830],{"type":606,"tag":636,"props":1798,"children":1799},{"style":657},[1800],{"type":612,"value":1140},{"type":606,"tag":636,"props":1802,"children":1803},{"style":663},[1804],{"type":612,"value":666},{"type":606,"tag":636,"props":1806,"children":1807},{"style":651},[1808],{"type":612,"value":964},{"type":606,"tag":636,"props":1810,"children":1811},{"style":669},[1812],{"type":612,"value":1813},"\"File content: ",{"type":606,"tag":636,"props":1815,"children":1816},{"style":657},[1817],{"type":612,"value":974},{"type":606,"tag":636,"props":1819,"children":1820},{"style":663},[1821],{"type":612,"value":17},{"type":606,"tag":636,"props":1823,"children":1824},{"style":657},[1825],{"type":612,"value":994},{"type":606,"tag":636,"props":1827,"children":1828},{"style":669},[1829],{"type":612,"value":1115},{"type":606,"tag":636,"props":1831,"children":1832},{"style":663},[1833],{"type":612,"value":1004},{"type":606,"tag":636,"props":1835,"children":1836},{"class":638,"line":1014},[1837,1842],{"type":606,"tag":636,"props":1838,"children":1839},{"style":651},[1840],{"type":612,"value":1841},"else",{"type":606,"tag":636,"props":1843,"children":1844},{"style":663},[1845],{"type":612,"value":703},{"type":606,"tag":636,"props":1847,"children":1848},{"class":638,"line":99},[1849,1853,1857,1862],{"type":606,"tag":636,"props":1850,"children":1851},{"style":657},[1852],{"type":612,"value":733},{"type":606,"tag":636,"props":1854,"children":1855},{"style":663},[1856],{"type":612,"value":666},{"type":606,"tag":636,"props":1858,"children":1859},{"style":669},[1860],{"type":612,"value":1861},"\"File not found\"",{"type":606,"tag":636,"props":1863,"children":1864},{"style":663},[1865],{"type":612,"value":1004},{"type":606,"tag":636,"props":1867,"children":1868},{"class":638,"line":108},[1869],{"type":606,"tag":636,"props":1870,"children":1871},{"emptyLinePlaceholder":13},[1872],{"type":612,"value":885},{"type":606,"tag":636,"props":1874,"children":1875},{"class":638,"line":117},[1876,1880,1884,1889],{"type":606,"tag":636,"props":1877,"children":1878},{"style":657},[1879],{"type":612,"value":1199},{"type":606,"tag":636,"props":1881,"children":1882},{"style":663},[1883],{"type":612,"value":666},{"type":606,"tag":636,"props":1885,"children":1886},{"style":669},[1887],{"type":612,"value":1888},"\"File existence check completed\"",{"type":606,"tag":636,"props":1890,"children":1891},{"style":663},[1892],{"type":612,"value":1004},{"type":606,"tag":837,"props":1894,"children":1896},{"id":1895},"error-handling-and-encoding",[1897],{"type":612,"value":1898},"Error Handling and Encoding",{"type":606,"tag":621,"props":1900,"children":1901},{},[1902],{"type":606,"tag":625,"props":1903,"children":1905},{"className":627,"code":1904,"language":629,"meta":8,"style":8},"# Reading with encoding specification and error handling\ntry:\n    with open(filename, 'r', encoding='utf-8') as file:\n        content = file.read()\n        print(f\"UTF-8 content: {content}\")\nexcept FileNotFoundError:\n    print(\"File not found\")\nexcept UnicodeDecodeError:\n    print(\"Encoding error\")\n\nprint(\"Encoding-specific reading completed\")\n",[1906],{"type":606,"tag":632,"props":1907,"children":1908},{"__ignoreMap":8},[1909,1917,1929,1982,2001,2041,2058,2077,2093,2113,2120],{"type":606,"tag":636,"props":1910,"children":1911},{"class":638,"line":12},[1912],{"type":606,"tag":636,"props":1913,"children":1914},{"style":642},[1915],{"type":612,"value":1916},"# Reading with encoding specification and error handling\n",{"type":606,"tag":636,"props":1918,"children":1919},{"class":638,"line":27},[1920,1925],{"type":606,"tag":636,"props":1921,"children":1922},{"style":651},[1923],{"type":612,"value":1924},"try",{"type":606,"tag":636,"props":1926,"children":1927},{"style":663},[1928],{"type":612,"value":703},{"type":606,"tag":636,"props":1930,"children":1931},{"class":638,"line":36},[1932,1936,1940,1944,1948,1952,1957,1961,1966,1970,1974,1978],{"type":606,"tag":636,"props":1933,"children":1934},{"style":651},[1935],{"type":612,"value":1745},{"type":606,"tag":636,"props":1937,"children":1938},{"style":657},[1939],{"type":612,"value":660},{"type":606,"tag":636,"props":1941,"children":1942},{"style":663},[1943],{"type":612,"value":909},{"type":606,"tag":636,"props":1945,"children":1946},{"style":669},[1947],{"type":612,"value":682},{"type":606,"tag":636,"props":1949,"children":1950},{"style":663},[1951],{"type":612,"value":677},{"type":606,"tag":636,"props":1953,"children":1954},{"style":695},[1955],{"type":612,"value":1956},"encoding",{"type":606,"tag":636,"props":1958,"children":1959},{"style":651},[1960],{"type":612,"value":716},{"type":606,"tag":636,"props":1962,"children":1963},{"style":669},[1964],{"type":612,"value":1965},"'utf-8'",{"type":606,"tag":636,"props":1967,"children":1968},{"style":663},[1969],{"type":612,"value":687},{"type":606,"tag":636,"props":1971,"children":1972},{"style":651},[1973],{"type":612,"value":692},{"type":606,"tag":636,"props":1975,"children":1976},{"style":695},[1977],{"type":612,"value":698},{"type":606,"tag":636,"props":1979,"children":1980},{"style":663},[1981],{"type":612,"value":703},{"type":606,"tag":636,"props":1983,"children":1984},{"class":638,"line":45},[1985,1989,1993,1997],{"type":606,"tag":636,"props":1986,"children":1987},{"style":663},[1988],{"type":612,"value":1781},{"type":606,"tag":636,"props":1990,"children":1991},{"style":651},[1992],{"type":612,"value":716},{"type":606,"tag":636,"props":1994,"children":1995},{"style":695},[1996],{"type":612,"value":698},{"type":606,"tag":636,"props":1998,"children":1999},{"style":663},[2000],{"type":612,"value":725},{"type":606,"tag":636,"props":2002,"children":2003},{"class":638,"line":54},[2004,2008,2012,2016,2021,2025,2029,2033,2037],{"type":606,"tag":636,"props":2005,"children":2006},{"style":657},[2007],{"type":612,"value":1140},{"type":606,"tag":636,"props":2009,"children":2010},{"style":663},[2011],{"type":612,"value":666},{"type":606,"tag":636,"props":2013,"children":2014},{"style":651},[2015],{"type":612,"value":964},{"type":606,"tag":636,"props":2017,"children":2018},{"style":669},[2019],{"type":612,"value":2020},"\"UTF-8 content: ",{"type":606,"tag":636,"props":2022,"children":2023},{"style":657},[2024],{"type":612,"value":974},{"type":606,"tag":636,"props":2026,"children":2027},{"style":663},[2028],{"type":612,"value":17},{"type":606,"tag":636,"props":2030,"children":2031},{"style":657},[2032],{"type":612,"value":994},{"type":606,"tag":636,"props":2034,"children":2035},{"style":669},[2036],{"type":612,"value":1115},{"type":606,"tag":636,"props":2038,"children":2039},{"style":663},[2040],{"type":612,"value":1004},{"type":606,"tag":636,"props":2042,"children":2043},{"class":638,"line":63},[2044,2049,2054],{"type":606,"tag":636,"props":2045,"children":2046},{"style":651},[2047],{"type":612,"value":2048},"except",{"type":606,"tag":636,"props":2050,"children":2051},{"style":657},[2052],{"type":612,"value":2053}," FileNotFoundError",{"type":606,"tag":636,"props":2055,"children":2056},{"style":663},[2057],{"type":612,"value":703},{"type":606,"tag":636,"props":2059,"children":2060},{"class":638,"line":72},[2061,2065,2069,2073],{"type":606,"tag":636,"props":2062,"children":2063},{"style":657},[2064],{"type":612,"value":733},{"type":606,"tag":636,"props":2066,"children":2067},{"style":663},[2068],{"type":612,"value":666},{"type":606,"tag":636,"props":2070,"children":2071},{"style":669},[2072],{"type":612,"value":1861},{"type":606,"tag":636,"props":2074,"children":2075},{"style":663},[2076],{"type":612,"value":1004},{"type":606,"tag":636,"props":2078,"children":2079},{"class":638,"line":81},[2080,2084,2089],{"type":606,"tag":636,"props":2081,"children":2082},{"style":651},[2083],{"type":612,"value":2048},{"type":606,"tag":636,"props":2085,"children":2086},{"style":657},[2087],{"type":612,"value":2088}," UnicodeDecodeError",{"type":606,"tag":636,"props":2090,"children":2091},{"style":663},[2092],{"type":612,"value":703},{"type":606,"tag":636,"props":2094,"children":2095},{"class":638,"line":1014},[2096,2100,2104,2109],{"type":606,"tag":636,"props":2097,"children":2098},{"style":657},[2099],{"type":612,"value":733},{"type":606,"tag":636,"props":2101,"children":2102},{"style":663},[2103],{"type":612,"value":666},{"type":606,"tag":636,"props":2105,"children":2106},{"style":669},[2107],{"type":612,"value":2108},"\"Encoding error\"",{"type":606,"tag":636,"props":2110,"children":2111},{"style":663},[2112],{"type":612,"value":1004},{"type":606,"tag":636,"props":2114,"children":2115},{"class":638,"line":99},[2116],{"type":606,"tag":636,"props":2117,"children":2118},{"emptyLinePlaceholder":13},[2119],{"type":612,"value":885},{"type":606,"tag":636,"props":2121,"children":2122},{"class":638,"line":108},[2123,2127,2131,2136],{"type":606,"tag":636,"props":2124,"children":2125},{"style":657},[2126],{"type":612,"value":1199},{"type":606,"tag":636,"props":2128,"children":2129},{"style":663},[2130],{"type":612,"value":666},{"type":606,"tag":636,"props":2132,"children":2133},{"style":669},[2134],{"type":612,"value":2135},"\"Encoding-specific reading completed\"",{"type":606,"tag":636,"props":2137,"children":2138},{"style":663},[2139],{"type":612,"value":1004},{"type":606,"tag":837,"props":2141,"children":2143},{"id":2142},"partial-reading-and-processing",[2144],{"type":612,"value":2145},"Partial Reading and Processing",{"type":606,"tag":621,"props":2147,"children":2148},{},[2149],{"type":606,"tag":625,"props":2150,"children":2152},{"className":627,"code":2151,"language":629,"meta":8,"style":8},"# Reading specific number of characters\ntry:\n    with open(filename, 'r') as file:\n        chunk = file.read(100)  # Read first 100 characters\n        print(f\"First 100 chars: {chunk}\")\nexcept FileNotFoundError:\n    print(\"File not found\")\n\n# Skip empty lines and comments\ndef read_config_file(filename):\n    config_lines = []\n    try:\n        with open(filename, 'r') as file:\n            for line in file:\n                line = line.strip()\n                if line and not line.startswith('#'):\n                    config_lines.append(line)\n        return config_lines\n    except FileNotFoundError:\n        return []\n\nconfig = read_config_file('config.txt')\nprint(f\"Config lines: {config}\")\n",[2153],{"type":606,"tag":632,"props":2154,"children":2155},{"__ignoreMap":8},[2156,2164,2175,2210,2246,2287,2302,2321,2328,2336,2355,2372,2384,2420,2445,2462,2498,2506,2519,2535,2546,2553,2579],{"type":606,"tag":636,"props":2157,"children":2158},{"class":638,"line":12},[2159],{"type":606,"tag":636,"props":2160,"children":2161},{"style":642},[2162],{"type":612,"value":2163},"# Reading specific number of characters\n",{"type":606,"tag":636,"props":2165,"children":2166},{"class":638,"line":27},[2167,2171],{"type":606,"tag":636,"props":2168,"children":2169},{"style":651},[2170],{"type":612,"value":1924},{"type":606,"tag":636,"props":2172,"children":2173},{"style":663},[2174],{"type":612,"value":703},{"type":606,"tag":636,"props":2176,"children":2177},{"class":638,"line":36},[2178,2182,2186,2190,2194,2198,2202,2206],{"type":606,"tag":636,"props":2179,"children":2180},{"style":651},[2181],{"type":612,"value":1745},{"type":606,"tag":636,"props":2183,"children":2184},{"style":657},[2185],{"type":612,"value":660},{"type":606,"tag":636,"props":2187,"children":2188},{"style":663},[2189],{"type":612,"value":909},{"type":606,"tag":636,"props":2191,"children":2192},{"style":669},[2193],{"type":612,"value":682},{"type":606,"tag":636,"props":2195,"children":2196},{"style":663},[2197],{"type":612,"value":687},{"type":606,"tag":636,"props":2199,"children":2200},{"style":651},[2201],{"type":612,"value":692},{"type":606,"tag":636,"props":2203,"children":2204},{"style":695},[2205],{"type":612,"value":698},{"type":606,"tag":636,"props":2207,"children":2208},{"style":663},[2209],{"type":612,"value":703},{"type":606,"tag":636,"props":2211,"children":2212},{"class":638,"line":45},[2213,2218,2222,2226,2231,2236,2241],{"type":606,"tag":636,"props":2214,"children":2215},{"style":663},[2216],{"type":612,"value":2217},"        chunk ",{"type":606,"tag":636,"props":2219,"children":2220},{"style":651},[2221],{"type":612,"value":716},{"type":606,"tag":636,"props":2223,"children":2224},{"style":695},[2225],{"type":612,"value":698},{"type":606,"tag":636,"props":2227,"children":2228},{"style":663},[2229],{"type":612,"value":2230},".read(",{"type":606,"tag":636,"props":2232,"children":2233},{"style":657},[2234],{"type":612,"value":2235},"100",{"type":606,"tag":636,"props":2237,"children":2238},{"style":663},[2239],{"type":612,"value":2240},")  ",{"type":606,"tag":636,"props":2242,"children":2243},{"style":642},[2244],{"type":612,"value":2245},"# Read first 100 characters\n",{"type":606,"tag":636,"props":2247,"children":2248},{"class":638,"line":54},[2249,2253,2257,2261,2266,2270,2275,2279,2283],{"type":606,"tag":636,"props":2250,"children":2251},{"style":657},[2252],{"type":612,"value":1140},{"type":606,"tag":636,"props":2254,"children":2255},{"style":663},[2256],{"type":612,"value":666},{"type":606,"tag":636,"props":2258,"children":2259},{"style":651},[2260],{"type":612,"value":964},{"type":606,"tag":636,"props":2262,"children":2263},{"style":669},[2264],{"type":612,"value":2265},"\"First 100 chars: ",{"type":606,"tag":636,"props":2267,"children":2268},{"style":657},[2269],{"type":612,"value":974},{"type":606,"tag":636,"props":2271,"children":2272},{"style":663},[2273],{"type":612,"value":2274},"chunk",{"type":606,"tag":636,"props":2276,"children":2277},{"style":657},[2278],{"type":612,"value":994},{"type":606,"tag":636,"props":2280,"children":2281},{"style":669},[2282],{"type":612,"value":1115},{"type":606,"tag":636,"props":2284,"children":2285},{"style":663},[2286],{"type":612,"value":1004},{"type":606,"tag":636,"props":2288,"children":2289},{"class":638,"line":63},[2290,2294,2298],{"type":606,"tag":636,"props":2291,"children":2292},{"style":651},[2293],{"type":612,"value":2048},{"type":606,"tag":636,"props":2295,"children":2296},{"style":657},[2297],{"type":612,"value":2053},{"type":606,"tag":636,"props":2299,"children":2300},{"style":663},[2301],{"type":612,"value":703},{"type":606,"tag":636,"props":2303,"children":2304},{"class":638,"line":72},[2305,2309,2313,2317],{"type":606,"tag":636,"props":2306,"children":2307},{"style":657},[2308],{"type":612,"value":733},{"type":606,"tag":636,"props":2310,"children":2311},{"style":663},[2312],{"type":612,"value":666},{"type":606,"tag":636,"props":2314,"children":2315},{"style":669},[2316],{"type":612,"value":1861},{"type":606,"tag":636,"props":2318,"children":2319},{"style":663},[2320],{"type":612,"value":1004},{"type":606,"tag":636,"props":2322,"children":2323},{"class":638,"line":81},[2324],{"type":606,"tag":636,"props":2325,"children":2326},{"emptyLinePlaceholder":13},[2327],{"type":612,"value":885},{"type":606,"tag":636,"props":2329,"children":2330},{"class":638,"line":1014},[2331],{"type":606,"tag":636,"props":2332,"children":2333},{"style":642},[2334],{"type":612,"value":2335},"# Skip empty lines and comments\n",{"type":606,"tag":636,"props":2337,"children":2338},{"class":638,"line":99},[2339,2344,2350],{"type":606,"tag":636,"props":2340,"children":2341},{"style":651},[2342],{"type":612,"value":2343},"def",{"type":606,"tag":636,"props":2345,"children":2347},{"style":2346},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[2348],{"type":612,"value":2349}," read_config_file",{"type":606,"tag":636,"props":2351,"children":2352},{"style":663},[2353],{"type":612,"value":2354},"(filename):\n",{"type":606,"tag":636,"props":2356,"children":2357},{"class":638,"line":108},[2358,2363,2367],{"type":606,"tag":636,"props":2359,"children":2360},{"style":663},[2361],{"type":612,"value":2362},"    config_lines ",{"type":606,"tag":636,"props":2364,"children":2365},{"style":651},[2366],{"type":612,"value":716},{"type":606,"tag":636,"props":2368,"children":2369},{"style":663},[2370],{"type":612,"value":2371}," []\n",{"type":606,"tag":636,"props":2373,"children":2374},{"class":638,"line":117},[2375,2380],{"type":606,"tag":636,"props":2376,"children":2377},{"style":651},[2378],{"type":612,"value":2379},"    try",{"type":606,"tag":636,"props":2381,"children":2382},{"style":663},[2383],{"type":612,"value":703},{"type":606,"tag":636,"props":2385,"children":2386},{"class":638,"line":126},[2387,2392,2396,2400,2404,2408,2412,2416],{"type":606,"tag":636,"props":2388,"children":2389},{"style":651},[2390],{"type":612,"value":2391},"        with",{"type":606,"tag":636,"props":2393,"children":2394},{"style":657},[2395],{"type":612,"value":660},{"type":606,"tag":636,"props":2397,"children":2398},{"style":663},[2399],{"type":612,"value":909},{"type":606,"tag":636,"props":2401,"children":2402},{"style":669},[2403],{"type":612,"value":682},{"type":606,"tag":636,"props":2405,"children":2406},{"style":663},[2407],{"type":612,"value":687},{"type":606,"tag":636,"props":2409,"children":2410},{"style":651},[2411],{"type":612,"value":692},{"type":606,"tag":636,"props":2413,"children":2414},{"style":695},[2415],{"type":612,"value":698},{"type":606,"tag":636,"props":2417,"children":2418},{"style":663},[2419],{"type":612,"value":703},{"type":606,"tag":636,"props":2421,"children":2422},{"class":638,"line":135},[2423,2428,2433,2437,2441],{"type":606,"tag":636,"props":2424,"children":2425},{"style":651},[2426],{"type":612,"value":2427},"            for",{"type":606,"tag":636,"props":2429,"children":2430},{"style":663},[2431],{"type":612,"value":2432}," line ",{"type":606,"tag":636,"props":2434,"children":2435},{"style":651},[2436],{"type":612,"value":1289},{"type":606,"tag":636,"props":2438,"children":2439},{"style":695},[2440],{"type":612,"value":698},{"type":606,"tag":636,"props":2442,"children":2443},{"style":663},[2444],{"type":612,"value":703},{"type":606,"tag":636,"props":2446,"children":2447},{"class":638,"line":144},[2448,2453,2457],{"type":606,"tag":636,"props":2449,"children":2450},{"style":663},[2451],{"type":612,"value":2452},"                line ",{"type":606,"tag":636,"props":2454,"children":2455},{"style":651},[2456],{"type":612,"value":716},{"type":606,"tag":636,"props":2458,"children":2459},{"style":663},[2460],{"type":612,"value":2461}," line.strip()\n",{"type":606,"tag":636,"props":2463,"children":2464},{"class":638,"line":153},[2465,2470,2474,2479,2484,2489,2494],{"type":606,"tag":636,"props":2466,"children":2467},{"style":651},[2468],{"type":612,"value":2469},"                if",{"type":606,"tag":636,"props":2471,"children":2472},{"style":663},[2473],{"type":612,"value":2432},{"type":606,"tag":636,"props":2475,"children":2476},{"style":651},[2477],{"type":612,"value":2478},"and",{"type":606,"tag":636,"props":2480,"children":2481},{"style":651},[2482],{"type":612,"value":2483}," not",{"type":606,"tag":636,"props":2485,"children":2486},{"style":663},[2487],{"type":612,"value":2488}," line.startswith(",{"type":606,"tag":636,"props":2490,"children":2491},{"style":669},[2492],{"type":612,"value":2493},"'#'",{"type":606,"tag":636,"props":2495,"children":2496},{"style":663},[2497],{"type":612,"value":1317},{"type":606,"tag":636,"props":2499,"children":2500},{"class":638,"line":163},[2501],{"type":606,"tag":636,"props":2502,"children":2503},{"style":663},[2504],{"type":612,"value":2505},"                    config_lines.append(line)\n",{"type":606,"tag":636,"props":2507,"children":2508},{"class":638,"line":172},[2509,2514],{"type":606,"tag":636,"props":2510,"children":2511},{"style":651},[2512],{"type":612,"value":2513},"        return",{"type":606,"tag":636,"props":2515,"children":2516},{"style":663},[2517],{"type":612,"value":2518}," config_lines\n",{"type":606,"tag":636,"props":2520,"children":2521},{"class":638,"line":181},[2522,2527,2531],{"type":606,"tag":636,"props":2523,"children":2524},{"style":651},[2525],{"type":612,"value":2526},"    except",{"type":606,"tag":636,"props":2528,"children":2529},{"style":657},[2530],{"type":612,"value":2053},{"type":606,"tag":636,"props":2532,"children":2533},{"style":663},[2534],{"type":612,"value":703},{"type":606,"tag":636,"props":2536,"children":2537},{"class":638,"line":190},[2538,2542],{"type":606,"tag":636,"props":2539,"children":2540},{"style":651},[2541],{"type":612,"value":2513},{"type":606,"tag":636,"props":2543,"children":2544},{"style":663},[2545],{"type":612,"value":2371},{"type":606,"tag":636,"props":2547,"children":2548},{"class":638,"line":199},[2549],{"type":606,"tag":636,"props":2550,"children":2551},{"emptyLinePlaceholder":13},[2552],{"type":612,"value":885},{"type":606,"tag":636,"props":2554,"children":2555},{"class":638,"line":208},[2556,2561,2565,2570,2575],{"type":606,"tag":636,"props":2557,"children":2558},{"style":663},[2559],{"type":612,"value":2560},"config ",{"type":606,"tag":636,"props":2562,"children":2563},{"style":651},[2564],{"type":612,"value":716},{"type":606,"tag":636,"props":2566,"children":2567},{"style":663},[2568],{"type":612,"value":2569}," read_config_file(",{"type":606,"tag":636,"props":2571,"children":2572},{"style":669},[2573],{"type":612,"value":2574},"'config.txt'",{"type":606,"tag":636,"props":2576,"children":2577},{"style":663},[2578],{"type":612,"value":1004},{"type":606,"tag":636,"props":2580,"children":2581},{"class":638,"line":217},[2582,2586,2590,2594,2599,2603,2608,2612,2616],{"type":606,"tag":636,"props":2583,"children":2584},{"style":657},[2585],{"type":612,"value":1199},{"type":606,"tag":636,"props":2587,"children":2588},{"style":663},[2589],{"type":612,"value":666},{"type":606,"tag":636,"props":2591,"children":2592},{"style":651},[2593],{"type":612,"value":964},{"type":606,"tag":636,"props":2595,"children":2596},{"style":669},[2597],{"type":612,"value":2598},"\"Config lines: ",{"type":606,"tag":636,"props":2600,"children":2601},{"style":657},[2602],{"type":612,"value":974},{"type":606,"tag":636,"props":2604,"children":2605},{"style":663},[2606],{"type":612,"value":2607},"config",{"type":606,"tag":636,"props":2609,"children":2610},{"style":657},[2611],{"type":612,"value":994},{"type":606,"tag":636,"props":2613,"children":2614},{"style":669},[2615],{"type":612,"value":1115},{"type":606,"tag":636,"props":2617,"children":2618},{"style":663},[2619],{"type":612,"value":1004},{"type":606,"tag":740,"props":2621,"children":2623},{"id":2622},"file-reading-reference-table",[2624],{"type":612,"value":2625},"📋 File Reading Reference Table",{"type":606,"tag":2627,"props":2628,"children":2629},"table",{},[2630,2659],{"type":606,"tag":2631,"props":2632,"children":2633},"thead",{},[2634],{"type":606,"tag":2635,"props":2636,"children":2637},"tr",{},[2638,2644,2649,2654],{"type":606,"tag":2639,"props":2640,"children":2641},"th",{},[2642],{"type":612,"value":2643},"Method",{"type":606,"tag":2639,"props":2645,"children":2646},{},[2647],{"type":612,"value":2648},"Memory Usage",{"type":606,"tag":2639,"props":2650,"children":2651},{},[2652],{"type":612,"value":2653},"Best For",{"type":606,"tag":2639,"props":2655,"children":2656},{},[2657],{"type":612,"value":2658},"Returns",{"type":606,"tag":2660,"props":2661,"children":2662},"tbody",{},[2663,2690,2715,2741],{"type":606,"tag":2635,"props":2664,"children":2665},{},[2666,2675,2680,2685],{"type":606,"tag":2667,"props":2668,"children":2669},"td",{},[2670],{"type":606,"tag":632,"props":2671,"children":2673},{"className":2672},[],[2674],{"type":612,"value":780},{"type":606,"tag":2667,"props":2676,"children":2677},{},[2678],{"type":612,"value":2679},"High",{"type":606,"tag":2667,"props":2681,"children":2682},{},[2683],{"type":612,"value":2684},"Small files",{"type":606,"tag":2667,"props":2686,"children":2687},{},[2688],{"type":612,"value":2689},"String",{"type":606,"tag":2635,"props":2691,"children":2692},{},[2693,2701,2706,2711],{"type":606,"tag":2667,"props":2694,"children":2695},{},[2696],{"type":606,"tag":632,"props":2697,"children":2699},{"className":2698},[],[2700],{"type":612,"value":791},{"type":606,"tag":2667,"props":2702,"children":2703},{},[2704],{"type":612,"value":2705},"Low",{"type":606,"tag":2667,"props":2707,"children":2708},{},[2709],{"type":612,"value":2710},"Line-by-line processing",{"type":606,"tag":2667,"props":2712,"children":2713},{},[2714],{"type":612,"value":2689},{"type":606,"tag":2635,"props":2716,"children":2717},{},[2718,2726,2731,2736],{"type":606,"tag":2667,"props":2719,"children":2720},{},[2721],{"type":606,"tag":632,"props":2722,"children":2724},{"className":2723},[],[2725],{"type":612,"value":802},{"type":606,"tag":2667,"props":2727,"children":2728},{},[2729],{"type":612,"value":2730},"Medium",{"type":606,"tag":2667,"props":2732,"children":2733},{},[2734],{"type":612,"value":2735},"All lines needed",{"type":606,"tag":2667,"props":2737,"children":2738},{},[2739],{"type":612,"value":2740},"List",{"type":606,"tag":2635,"props":2742,"children":2743},{},[2744,2753,2757,2762],{"type":606,"tag":2667,"props":2745,"children":2746},{},[2747],{"type":606,"tag":632,"props":2748,"children":2750},{"className":2749},[],[2751],{"type":612,"value":2752},"for line in file:",{"type":606,"tag":2667,"props":2754,"children":2755},{},[2756],{"type":612,"value":2705},{"type":606,"tag":2667,"props":2758,"children":2759},{},[2760],{"type":612,"value":2761},"Large files",{"type":606,"tag":2667,"props":2763,"children":2764},{},[2765],{"type":612,"value":2766},"Iterator",{"type":606,"tag":740,"props":2768,"children":2770},{"id":2769},"key-takeaways",[2771],{"type":612,"value":2772},"🎯 Key Takeaways",{"type":606,"tag":752,"props":2774,"children":2778},{"emoji":2775,"title":2776,"type":2777},"📚","File Reading Essentials","success",[2779,2786,2829,2837,2860,2868,2891],{"type":606,"tag":615,"props":2780,"children":2781},{},[2782],{"type":606,"tag":762,"props":2783,"children":2784},{},[2785],{"type":612,"value":766},{"type":606,"tag":768,"props":2787,"children":2788},{},[2789,2801,2806,2817],{"type":606,"tag":772,"props":2790,"children":2791},{},[2792,2794,2799],{"type":612,"value":2793},"Use ",{"type":606,"tag":632,"props":2795,"children":2797},{"className":2796},[],[2798],{"type":612,"value":780},{"type":612,"value":2800}," for small files",{"type":606,"tag":772,"props":2802,"children":2803},{},[2804],{"type":612,"value":2805},"Use iteration for large files",{"type":606,"tag":772,"props":2807,"children":2808},{},[2809,2810,2815],{"type":612,"value":2793},{"type":606,"tag":632,"props":2811,"children":2813},{"className":2812},[],[2814],{"type":612,"value":802},{"type":612,"value":2816}," when you need all lines",{"type":606,"tag":772,"props":2818,"children":2819},{},[2820,2822,2827],{"type":612,"value":2821},"Always use ",{"type":606,"tag":632,"props":2823,"children":2825},{"className":2824},[],[2826],{"type":612,"value":654},{"type":612,"value":2828}," statement",{"type":606,"tag":615,"props":2830,"children":2831},{},[2832],{"type":606,"tag":762,"props":2833,"children":2834},{},[2835],{"type":612,"value":2836},"Advanced Features:",{"type":606,"tag":768,"props":2838,"children":2839},{},[2840,2845,2850,2855],{"type":606,"tag":772,"props":2841,"children":2842},{},[2843],{"type":612,"value":2844},"Encoding specification",{"type":606,"tag":772,"props":2846,"children":2847},{},[2848],{"type":612,"value":2849},"Error handling",{"type":606,"tag":772,"props":2851,"children":2852},{},[2853],{"type":612,"value":2854},"File existence checks",{"type":606,"tag":772,"props":2856,"children":2857},{},[2858],{"type":612,"value":2859},"Line processing",{"type":606,"tag":615,"props":2861,"children":2862},{},[2863],{"type":606,"tag":762,"props":2864,"children":2865},{},[2866],{"type":612,"value":2867},"Best Practices:",{"type":606,"tag":768,"props":2869,"children":2870},{},[2871,2876,2881,2886],{"type":606,"tag":772,"props":2872,"children":2873},{},[2874],{"type":612,"value":2875},"Handle exceptions gracefully",{"type":606,"tag":772,"props":2877,"children":2878},{},[2879],{"type":612,"value":2880},"Specify encoding explicitly",{"type":606,"tag":772,"props":2882,"children":2883},{},[2884],{"type":612,"value":2885},"Use memory-efficient methods",{"type":606,"tag":772,"props":2887,"children":2888},{},[2889],{"type":612,"value":2890},"Strip whitespace from lines",{"type":606,"tag":615,"props":2892,"children":2893},{},[2894,2899],{"type":606,"tag":762,"props":2895,"children":2896},{},[2897],{"type":612,"value":2898},"Remember:",{"type":612,"value":2900}," Choose reading method based on file size and memory constraints!",{"type":606,"tag":2902,"props":2903,"children":2904},"style",{},[2905],{"type":612,"value":2906},"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":2908},[2909,2914,2919,2920],{"id":742,"depth":27,"text":745,"children":2910},[2911,2912,2913],{"id":839,"depth":36,"text":842},{"id":1215,"depth":36,"text":1218},{"id":1447,"depth":36,"text":1450},{"id":1656,"depth":27,"text":1659,"children":2915},[2916,2917,2918],{"id":1667,"depth":36,"text":1670},{"id":1895,"depth":36,"text":1898},{"id":2142,"depth":36,"text":2145},{"id":2622,"depth":27,"text":2625},{"id":2769,"depth":27,"text":2772},1782373756446]