Retranslate the complete English edition from Simplified Chinese (#2010)

* Retranslate the complete English edition from Simplified Chinese

* Polish three English explanations after reader-focused review
This commit is contained in:
Yudong Jin
2026-10-31 03:35:51 +08:00
committed by GitHub
parent ef46e2ed95
commit 14c314c08c
1502 changed files with 29459 additions and 23517 deletions

View File

@@ -6,11 +6,11 @@ env = os.environ.copy()
env["PYTHONIOENCODING"] = "utf-8"
if __name__ == "__main__":
# find source code files
# Find source code files
src_paths = sorted(glob.glob("chapter_*/*.py"))
errors = []
# run python code
# Run Python code
for src_path in src_paths:
process = subprocess.Popen(
["python", src_path],
@@ -20,7 +20,7 @@ if __name__ == "__main__":
env=env,
encoding='utf-8'
)
# Wait for the process to complete, and get the output and error messages
# Wait for the process to finish and collect its output and error messages
stdout, stderr = process.communicate()
# Check the exit status
exit_status = process.returncode
@@ -28,6 +28,6 @@ if __name__ == "__main__":
errors.append(stderr)
print(f"Tested {len(src_paths)} files")
print(f"Found exception in {len(errors)} files")
print(f"Found exceptions in {len(errors)} files")
if len(errors) > 0:
raise RuntimeError("\n\n".join(errors))