Ptop.py Documentation

website·Indexed 29 days ago

https://ptop-py.github.io/ptop-docs/

A tool designed to view system processes. Ptop allows users to create custom commands and modify ASCII art via the ptopa.py file.

Tokens
579
Snippets
4
Records
9
Agent score
25%

What's inside Ptop

  1. Overview of Ptop system process viewer

    Ptop is a tool designed for easy installation and use to view system processes. It is optimized for speed, allowing users to view processes within the C:\ drive typically within 6 to 8 seconds.
  2. Overview of Ptop system process viewer

    Ptop is a utility designed for quick installation and use to view system processes. It is optimized for speed, allowing users to view processes (specifically those within the C:\ drive) within approximately 6 to 8 seconds of startup.
  3. Customize ASCII art for the ptop -a command

    To change the ASCII art displayed when running the ptop -a command, you must manually edit the ptopa.py file. Locate the multi-line string (triple quotes) containing the ASCII art (which defaults to an 'among us' character) and replace it with your own custom art.

    Constraints: This customization method does not work for the standalone version of ptop or version 1.0.5.

    # In ptopa.py, locate the print statement and replace the ASCII string:
    print(Fore.BLUE + """
        Your Custom ASCII Art Here
    """)
  4. Launch a Ptop.py REPL session

    You can start a Ptop.py session by executing ptop or ptop.exe within a Windows Terminal Emulator, Command Prompt, PowerShell, or any other terminal emulator.
    cd path\to\ptop
    ptop
  5. Create a custom command in ptop-py

    To add a custom command to ptop-py, define a function in a separate Python file (e.g., ptopz.py) that calls default() and contains your custom logic. Then, import this module into main.py and add a conditional check within the command loop to trigger your function when a specific command string is entered.
    # 1. Create ptopz.py
    from ptop import *
    
    def modez():
      default()
      print("Hello From Ptop")
    
    # 2. In main.py (at the top)
    from ptopz import *
    
    # 3. In main.py (inside the command loop)
    if command == "ptop -a .exit":
      modea()
      break
    elif command == "ptop -z":
      modez()
  6. Install and setup requirements for Ptop.py

    To run Ptop.py, ensure the following dependencies are installed on your system:

    • Python version 3.6 or above
    • Psutil version 5.9.0 or below
    • Colorama version 0.4.4 or below
  7. Extend Ptop functionality with Custom Commands

    Ptop allows users to extend or customize its functionality by reusing the tool's built-in commands to create custom command sequences.
  8. Extend Ptop functionality with custom commands

    Ptop allows users to extend or customize its functionality by reusing the tool's built-in commands to create custom commands.