# Corrected version: Handle articles with alphanumeric strings like "51A", "243ZG" as strings # Updated part info with articles as strings for uniform processing parts_info_fixed = [ ("1", "संघ और उसका राज्यक्षेत्र", "1", "4"), ("2", "नागरिकता", "5", "11"), ("3", "मौलिक अधिकार", "12", "35"), ("4", "राज्य के नीति निर्देशक तत्व", "36", "51"), ("4A", "मौलिक कर्तव्य", "51A", "51A"), ("5", "संघ", "52", "151"), ("6", "राज्य", "152", "237"), ("7", "पूर्ववर्ती राज्यों का उन्मूलन", "238", "238"), ("8", "संघ राज्य क्षेत्र", "239", "242"), ("9", "पंचायतें", "243", "243O"), ("9A", "नगरपालिकाएँ", "243P", "243ZG"), ("10", "अनुसूचित एवं जनजातियाँ", "244", "244A"), ("11", "संघ और राज्यों की विधायिका की शक्तियाँ", "245", "255"), ("12", "संघ और राज्यों के बीच संबंध", "256", "263"), ("13", "समवर्ती सूची", "264", "267"), ("14", "वित्त, संपत्ति, अनुबंध और वाद", "268", "293"), ("15", "राजभाषा", "343", "351"), ("16", "विशेष उपबंध", "352", "360"), ("17", "आपात उपबंध", "361", "367"), ("18", "विविध", "368", "373"), ("19", "संविधान में संशोधन", "368", "368"), ("20", "अस्थायी, संक्रमणकालीन और विशेष उपबंध", "369", "392"), ("21", "संक्षिप्त नाम, प्रारंभ और निरसन", "393", "395"), ("22", "अनुसूचियाँ", "अनुसूची 1", "अनुसूची 12"), ("23", "संघीय क्षेत्र", "239A", "239AA"), ("24", "अनुच्छेद आरक्षित", "240", "241"), ("25", "संशोधन प्रक्रिया", "368", "368") ] # Recreate the HTML files for part_number, part_title, start_article, end_article in parts_info_fixed: articles_html = f"

अनुच्छेद {start_article} से {end_article}

\n" articles_html += f"

🔸 इस भाग में अनुच्छेद {start_article} से {end_article} तक का विस्तृत विवरण होगा...

\n" html_content = html_template.format( part_number=part_number, part_title=part_title, start_article=start_article, end_article=end_article, articles=articles_html ) filename = f"भाग_{part_number}_भारतीय_संविधान.html" with open(os.path.join(output_dir, filename), "w", encoding="utf-8") as f: f.write(html_content) # Create final ZIP with zipfile.ZipFile(zip_path, 'w') as zipf: for filename in os.listdir(output_dir): zipf.write(os.path.join(output_dir, filename), filename) zip_path

July 25, 2025
 # Corrected version: Handle articles with alphanumeric strings like "51A", "243ZG" as strings # Updated part info with ...

Featured Post

# Corrected version: Handle articles with alphanumeric strings like "51A", "243ZG" as strings # Updated part info with articles as strings for uniform processing parts_info_fixed = [ ("1", "संघ और उसका राज्यक्षेत्र", "1", "4"), ("2", "नागरिकता", "5", "11"), ("3", "मौलिक अधिकार", "12", "35"), ("4", "राज्य के नीति निर्देशक तत्व", "36", "51"), ("4A", "मौलिक कर्तव्य", "51A", "51A"), ("5", "संघ", "52", "151"), ("6", "राज्य", "152", "237"), ("7", "पूर्ववर्ती राज्यों का उन्मूलन", "238", "238"), ("8", "संघ राज्य क्षेत्र", "239", "242"), ("9", "पंचायतें", "243", "243O"), ("9A", "नगरपालिकाएँ", "243P", "243ZG"), ("10", "अनुसूचित एवं जनजातियाँ", "244", "244A"), ("11", "संघ और राज्यों की विधायिका की शक्तियाँ", "245", "255"), ("12", "संघ और राज्यों के बीच संबंध", "256", "263"), ("13", "समवर्ती सूची", "264", "267"), ("14", "वित्त, संपत्ति, अनुबंध और वाद", "268", "293"), ("15", "राजभाषा", "343", "351"), ("16", "विशेष उपबंध", "352", "360"), ("17", "आपात उपबंध", "361", "367"), ("18", "विविध", "368", "373"), ("19", "संविधान में संशोधन", "368", "368"), ("20", "अस्थायी, संक्रमणकालीन और विशेष उपबंध", "369", "392"), ("21", "संक्षिप्त नाम, प्रारंभ और निरसन", "393", "395"), ("22", "अनुसूचियाँ", "अनुसूची 1", "अनुसूची 12"), ("23", "संघीय क्षेत्र", "239A", "239AA"), ("24", "अनुच्छेद आरक्षित", "240", "241"), ("25", "संशोधन प्रक्रिया", "368", "368") ] # Recreate the HTML files for part_number, part_title, start_article, end_article in parts_info_fixed: articles_html = f"<h2>अनुच्छेद {start_article} से {end_article}</h2>\n" articles_html += f"<p>🔸 इस भाग में अनुच्छेद {start_article} से {end_article} तक का विस्तृत विवरण होगा...</p>\n" html_content = html_template.format( part_number=part_number, part_title=part_title, start_article=start_article, end_article=end_article, articles=articles_html ) filename = f"भाग_{part_number}_भारतीय_संविधान.html" with open(os.path.join(output_dir, filename), "w", encoding="utf-8") as f: f.write(html_content) # Create final ZIP with zipfile.ZipFile(zip_path, 'w') as zipf: for filename in os.listdir(output_dir): zipf.write(os.path.join(output_dir, filename), filename) zip_path

 # Corrected version: Handle articles with alphanumeric strings like "51A", "243ZG" as strings # Updated part info with ...

Powered by Blogger.