This Python script creates a clean graphical user interface (GUI) using Tkinter, specifically designed to run inside Pydroid 3 on Android devices. Its main purpose is to automatically locate, open, and display the content of the Acode.log file generated by the popular Acode code editor app.
The program checks several common storage paths used by both the free and paid versions of Acode. Once the log file is found, the full content is loaded into a scrollable text area with horizontal and vertical scrollbars for easy reading of long log files. The complete file path, file size in KB, and total number of lines are shown clearly in the status bar at the bottom of the window.
Users can interact with the application through a simple File menu that includes three essential options: Reload (to refresh the log content), Copy All (to copy the entire log text to the system clipboard with one click), and Exit. Keyboard shortcuts (Ctrl+R, Ctrl+C, Ctrl+Q) are also supported for faster operation.
The script handles missing files and read errors gracefully, displaying clear status messages and helpful guidance when the log cannot be located or accessed. It uses UTF-8 encoding with error replacement to ensure special characters do not break the display.
Ideal for Android developers and Acode users who need a fast, lightweight way to inspect application logs directly on their device without leaving the Pydroid 3 environment. The pure Tkinter interface requires no external libraries, making it fully compatible with Pydroid 3 out of the box.

Let's see the source code:
import tkinter as tk
from tkinter import scrolledtext, messagebox, ttk
import os
# Possible paths for Acode.log (paid + free version)
POSSIBLE_PATHS = [
"/storage/emulated/0/Android/data/com.foxdebug.acode/files/Acode.log",
"/storage/emulated/0/Android/data/com.foxdebug.acode.free/files/Acode.log",
"/storage/emulated/0/Android/data/com.foxdebug.acode/files/logs/Acode.log",
"/storage/emulated/0/Android/data/com.foxdebug.acode.free/files/logs/Acode.log",
"/sdcard/Android/data/com.foxdebug.acode/files/Acode.log",
"/sdcard/Android/data/com.foxdebug.acode.free/files/Acode.log",
]
class AcodeLogViewer:
def __init__(self, root):
self.root = root
self.root.title("Acode.log Viewer - Pydroid 3")
self.root.geometry("900x650")
self.root.minsize(600, 400)
self.found_path = None
self.file_content = ""
self.create_menu()
self.create_widgets()
self.search_and_load()
def create_menu(self):
"""Create the main application menu."""
menubar = tk.Menu(self.root)
self.root.config(menu=menubar)
# File menu
file_menu = tk.Menu(menubar, tearoff=0)
menubar.add_cascade(label="File", menu=file_menu)
file_menu.add_command(label="Reload", command=self.search_and_load, accelerator="Ctrl+R")
file_menu.add_command(label="Copy All", command=self.copy_to_clipboard, accelerator="Ctrl+C")
file_menu.add_separator()
file_menu.add_command(label="Exit", command=self.root.quit, accelerator="Ctrl+Q")
# Keyboard shortcuts
self.root.bind("", lambda e: self.search_and_load())
self.root.bind("", lambda e: self.copy_to_clipboard())
self.root.bind("", lambda e: self.root.quit())
def create_widgets(self):
# Text area with scrollbars
text_frame = ttk.Frame(self.root, padding=8)
text_frame.pack(fill=tk.BOTH, expand=True)
self.text_area = scrolledtext.ScrolledText(
text_frame,
wrap=tk.NONE,
font=("Courier New", 10),
state=tk.DISABLED
)
self.text_area.pack(fill=tk.BOTH, expand=True)
# Horizontal scrollbar
h_scroll = ttk.Scrollbar(text_frame, orient=tk.HORIZONTAL, command=self.text_area.xview)
h_scroll.pack(fill=tk.X)
self.text_area.configure(xscrollcommand=h_scroll.set)
# Status bar – displays the found file path
self.status_var = tk.StringVar(value="Ready.")
status_bar = ttk.Label(
self.root,
textvariable=self.status_var,
relief=tk.SUNKEN,
anchor=tk.W,
padding=(6, 3)
)
status_bar.pack(fill=tk.X, side=tk.BOTTOM)
def search_and_load(self):
self.found_path = None
self.file_content = ""
for path in POSSIBLE_PATHS:
if os.path.isfile(path):
self.found_path = path
break
if self.found_path is None:
self.status_var.set("Acode.log file not found in the known locations.")
self.display_text(
"The Acode.log file could not be located.\n\n"
"Please verify that the Acode application has already generated the log "
"and that Pydroid 3 has storage access permissions."
)
return
try:
with open(self.found_path, "r", encoding="utf-8", errors="replace") as f:
self.file_content = f.read()
size_kb = len(self.file_content.encode("utf-8")) / 1024
lines = len(self.file_content.splitlines())
# Full path + additional information in the status bar
self.status_var.set(
f"{self.found_path} • {size_kb:.1f} KB • {lines} lines"
)
self.display_text(self.file_content)
except Exception as e:
self.status_var.set(f"Error reading file: {self.found_path}")
self.display_text(f"Unable to read the file:\n{str(e)}")
def display_text(self, content):
self.text_area.config(state=tk.NORMAL)
self.text_area.delete("1.0", tk.END)
self.text_area.insert(tk.END, content)
self.text_area.config(state=tk.DISABLED)
self.text_area.see("1.0")
def copy_to_clipboard(self):
if not self.file_content:
messagebox.showwarning("Clipboard", "There is no content to copy.")
return
try:
self.root.clipboard_clear()
self.root.clipboard_append(self.file_content)
self.root.update()
self.status_var.set(f"Content copied • {self.found_path or 'N/A'}")
messagebox.showinfo("Clipboard", "The entire log content has been copied to the clipboard.")
except Exception as e:
messagebox.showerror("Clipboard Error", f"Unable to copy to clipboard:\n{str(e)}")
if __name__ == "__main__":
root = tk.Tk()
app = AcodeLogViewer(root)
root.mainloop()