-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
Tanjim Kamal edited this page May 25, 2025
·
6 revisions
This guide will walk you through creating your first PyPositron application.
- Python 3.9 or higher
- pip (Python package manager)
Install PyPositron from PyPI:
pip install py-positronUse the PyPositron CLI to create a new project:
positron createThis will start an interactive wizard that will ask you for:
- Project directory: Where to create your project (default: current directory)
- Project name: Name of your project (default: demo_project)
- Author name: Your name (optional)
- Project description: Brief description of your app (optional)
- Virtual environment: Whether to create a virtual environment (recommended)
After creation, your project will have the following structure:
your_project/
├── config.json # Project configuration
├── LICENSE # MIT License file
├── main/ # Main application directory
│ └── main.py # Main Python application file
├── views/ # HTML views and static files
│ ├── index.html # Main HTML template
│ └── checkmark.png # Example image asset
└── winvenv/ # Virtual environment (Windows, if created)
└── linuxvenv/ # Virtual environment (Linux, if created)
This is your main Python file:
import py_positron as main
# Run this file by typing positron start on the terminal while at the project root directory.
main.openUI("views/index.html", None, 900, 700, "Example app")
# The app automatically starts - no need to call main.start()
# Go to views to see and edit the HTML file.This is your HTML interface file - customize it with your own HTML and CSS.
An example image asset included in the default template.
Contains project configuration including metadata and settings.
Navigate to your project directory and start the application:
cd your_project
positron startThis will launch your desktop application in a native window!
- Customize your HTML interface in
views/index.html - Add Python logic to
main/main.py - Learn about the API Reference
- Explore Examples
- Virtual Environment: Always use a virtual environment for your projects to avoid package conflicts
- Development: Make changes to your HTML/CSS files and refresh the app to see changes
- Python Integration: Use the PyPositron API to integrate Python functionality with your HTML interface
If you encounter any issues, check the Troubleshooting guide or visit our GitHub Issues page.