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 = {true}PCT.enable
print("pycodetools")

That first line is what PCT looks for. It's still valid, harmless Python (just a variable assignment) if someone runs the file normally with python file.py — but when you run it through PCT, PCT detects it, prints a confirmation, and unlocks extra helpers for your script.

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:

{true}PCT.enable
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 = {true}PCT.enable
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.1.0.tar.gz (7.5 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.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pycodetools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 885dc6abf432ec2ada85d7b24d2b7b21eacab311c2b33dc7c08669e78b234d60
MD5 4dd18747d28a42d1fd8ed1d4189107b5
BLAKE2b-256 194840f7b887fbf13220070472c36cdd5c8605c8146e3102b238aef858a33e12

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycodetools-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce9d4706f5437bfb8689247c7a7e70dc5f152d04959c95e4eaf5403652966625
MD5 ef019b19a412dbcf9b01a7ac5a8da08d
BLAKE2b-256 d4d786ff700a362e0927ef56047292d75fb8d4db61ebf9b815d4a7b554bc5de5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.0 This release

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