From 90c91576aab310f7de159efaed95e79e70d4ce00 Mon Sep 17 00:00:00 2001 From: Shanzia Shabnom Mithun <155734848+shabnomm@users.noreply.github.com> Date: Sun, 16 Aug 2026 11:54:36 +0600 Subject: [PATCH 1/8] Add sample code for Nuitka standalone executable tutorial --- nuitka-standalone-executable/wordcount.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 nuitka-standalone-executable/wordcount.py diff --git a/nuitka-standalone-executable/wordcount.py b/nuitka-standalone-executable/wordcount.py new file mode 100644 index 0000000000..04547108f1 --- /dev/null +++ b/nuitka-standalone-executable/wordcount.py @@ -0,0 +1,12 @@ +from argparse import ArgumentParser +from collections import Counter +from pathlib import Path + +parser = ArgumentParser(description="Show the most common words in a text file.") +parser.add_argument("file", type=Path) +parser.add_argument("-n", "--top", type=int, default=5) +args = parser.parse_args() + +words = args.file.read_text(encoding="utf-8").lower().split() +for word, count in Counter(words).most_common(args.top): + print(f"{word}: {count}") From 4f88fd94e11dc717f8d1f3bedb01336ca7cde529 Mon Sep 17 00:00:00 2001 From: Shanzia Shabnom Mithun <155734848+shabnomm@users.noreply.github.com> Date: Sun, 16 Aug 2026 11:58:32 +0600 Subject: [PATCH 2/8] Add CPU benchmark script to measure performance --- nuitka-standalone-executable/cpu_benchmark.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 nuitka-standalone-executable/cpu_benchmark.py diff --git a/nuitka-standalone-executable/cpu_benchmark.py b/nuitka-standalone-executable/cpu_benchmark.py new file mode 100644 index 0000000000..170d2b844f --- /dev/null +++ b/nuitka-standalone-executable/cpu_benchmark.py @@ -0,0 +1,11 @@ +import math +import time + +start = time.perf_counter() +total = 0.0 +for i in range(20_000_000): + total += math.sqrt(i) +elapsed = time.perf_counter() - start + +print(f"Result: {total}") +print(f"Time: {elapsed:.3f}s") From 1f66d8eb9e3a14c5d2148bf478ce76b59acefa4e Mon Sep 17 00:00:00 2001 From: Shanzia Shabnom Mithun <155734848+shabnomm@users.noreply.github.com> Date: Sun, 16 Aug 2026 11:58:58 +0600 Subject: [PATCH 3/8] Add sample.txt with introductory Python text --- nuitka-standalone-executable/sample.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 nuitka-standalone-executable/sample.txt diff --git a/nuitka-standalone-executable/sample.txt b/nuitka-standalone-executable/sample.txt new file mode 100644 index 0000000000..37db2cd82c --- /dev/null +++ b/nuitka-standalone-executable/sample.txt @@ -0,0 +1,5 @@ +Python is a popular programming language. Python is easy to learn, and Python +is also powerful enough for real projects. Many developers choose Python for +web development, data science, and automation. Python code is often easy to +read, which is one reason Python remains popular among beginners and +experienced developers alike. From 98a8af356c3cfdd4e8d8bd4d6597016f41ebd714 Mon Sep 17 00:00:00 2001 From: Shanzia Shabnom Mithun <155734848+shabnomm@users.noreply.github.com> Date: Sun, 16 Aug 2026 12:07:12 +0600 Subject: [PATCH 4/8] Fix print statement formatting in wordcount.py From 84afcd194afdbf0b391942f81653afd9e46d755d Mon Sep 17 00:00:00 2001 From: Shanzia Shabnom Mithun <155734848+shabnomm@users.noreply.github.com> Date: Sun, 16 Aug 2026 12:10:28 +0600 Subject: [PATCH 5/8] Fix print statement formatting in wordcount.py From 6135941e75aad8b3e616059b8cea78b50433a77a Mon Sep 17 00:00:00 2001 From: Shanzia Shabnom Mithun <155734848+shabnomm@users.noreply.github.com> Date: Sun, 16 Aug 2026 12:15:43 +0600 Subject: [PATCH 6/8] Fix print statement formatting in wordcount.py From 41d04cb67300ae91e98cb592881da3fd3d7b6568 Mon Sep 17 00:00:00 2001 From: Shanzia Shabnom Mithun <155734848+shabnomm@users.noreply.github.com> Date: Sun, 16 Aug 2026 12:18:06 +0600 Subject: [PATCH 7/8] Add newline at end of wordcount.py Added a newline at the end of the file for consistency. --- nuitka-standalone-executable/wordcount.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nuitka-standalone-executable/wordcount.py b/nuitka-standalone-executable/wordcount.py index 04547108f1..f351470b0e 100644 --- a/nuitka-standalone-executable/wordcount.py +++ b/nuitka-standalone-executable/wordcount.py @@ -10,3 +10,4 @@ words = args.file.read_text(encoding="utf-8").lower().split() for word, count in Counter(words).most_common(args.top): print(f"{word}: {count}") + From af39784af1de7ff63503ff3f638624523745344a Mon Sep 17 00:00:00 2001 From: Shanzia Shabnom Mithun <155734848+shabnomm@users.noreply.github.com> Date: Sun, 16 Aug 2026 13:21:22 +0600 Subject: [PATCH 8/8] Fix line endings in wordcount.py --- nuitka-standalone-executable/wordcount.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nuitka-standalone-executable/wordcount.py b/nuitka-standalone-executable/wordcount.py index f351470b0e..04547108f1 100644 --- a/nuitka-standalone-executable/wordcount.py +++ b/nuitka-standalone-executable/wordcount.py @@ -10,4 +10,3 @@ words = args.file.read_text(encoding="utf-8").lower().split() for word, count in Counter(words).most_common(args.top): print(f"{word}: {count}") -