Skip to main content

PyCodeTools (PCT)

Run Python scripts with a few extra scripting helpers, and package them into standalone .exe files from a simple Tkinter GUI — all from the command line.

Install

pip install PyCodeTools

This gives you two equivalent commands: pycodetools and pct.

Enabling PCT in a script

Add this as the first line of your .py file:

pycodetools = enabled
print("pycodetools")

That first line is what PCT looks for. Run the file through pct and it detects the line, prints a confirmation, and unlocks the extra helpers below. Run it with plain python file.py instead and it will raise NameError: name 'enabled' is not defined — always launch PCT-enabled scripts with pct, not python.

Running a script

pct myscript.py
# or explicitly:
pct run myscript.py
# or the long form:
pycodetools myscript.py

If the enable line is found, you'll see:

pycodetools = enabled
PyCodeTools is now enabled for this run.
Running: py myscript.py
----------------------------------------
pycodetools

Extra helpers in your script

Once enabled, your script can use the extra helper functions by importing the package:

pycodetools = enabled
import pycodetools as pct

if pct.enabled:
    pct.title("My App")
    pct.banner("Welcome!")
    print(pct.color("This is red text", "red"))
    pct.timer(3)
    if pct.confirm("Keep going?"):
        print("Continuing...")
    pct.pause()

Available helpers:

Function What it does
pct.title(text) Sets the terminal window title
pct.clear() Clears the terminal
pct.pause(msg=...) "Press Enter to continue..." prompt
pct.banner(text) Prints a boxed banner
pct.color(text, name) Returns ANSI-colored text
pct.timer(seconds) Countdown timer
pct.confirm(prompt) Yes/No prompt, returns bool
pct.enabled True if the enable line was detected

Config / Build GUI

pct config myscript.py

Opens a Tkinter window with two tabs:

  • Dependencies — pick from a preset list of common packages (or type a custom one) and install them with pip.
  • Build .exe — compile the script into a standalone executable using PyInstaller, with options for one-file builds, hiding the console window, and naming the output.

Building .exe files requires PyInstaller:

pip install PyCodeTools[build]

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycodetools-0.2.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycodetools-0.2.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file pycodetools-0.2.0.tar.gz.

File metadata

  • Download URL: pycodetools-0.2.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.7

File hashes

Hashes for pycodetools-0.2.0.tar.gz
Algorithm Hash digest
SHA256 97cacedd6dfd0d12fe04955fb5b1ebfa9332204b44d3ec2fa24bfb02999c10e0
MD5 eabfb211a0e85cbdb2ea9b1412c8d953
BLAKE2b-256 f98ef6a8c188eb62599104ca246b467e61899600653f1b49e7ad48970ed50269

See more details on using hashes here.

File details

Details for the file pycodetools-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pycodetools-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.7

File hashes

Hashes for pycodetools-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5b6a11c77fb15d8bad0d44d997fceb7fd9912d6c8a13702cf5ca79f49ca4eff
MD5 25b7e07d8e8117ead0436402f16b0577
BLAKE2b-256 e6c1f15a4bcd073295fcd81ea4c569dc073b3fd6bab4aa0bf9cbf1541e1634ed

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page