Skip to main content

A sample package with wxPython message box

Project description

TwinPycs

a package to show the way PyPI and Windows executable is generated. The package is a sample Python package that demonstrates a wxPython message box with a modular structure.

the TwinPycs project structure

Here's how to build a simple Python project using the src/ layout, and use setuptools with a setup.py file to create a command-line executable.

TwinPycs_project/
├── src/
│   └── TwinPycs/
│       ├── A/
│       │   ├── __init__.py
│       │   └── main.py
│       ├── B/
│       │   ├── __init__.py
│       │   └── helper.py
│       └── __init__.py
├── pyproject.toml
├── setup_TwinPycs.py
├── README.md
└── LICENSE
└── requirements.txt

Before installing

Before installing the TwinPycs project you may run this to install the required packages. Usually pip install the required packages mentionned in the pyproject.toml

pip install -r requirements.txt

testing the code without installing

you need to give the path of the uninstalled package to be used by Python

#method 1) without changing PYTHONPATH
cd D:\ttx\TwinPycs\src
python -m  TwinPycs.A.main  arg1 arg2 # not good: because main.py is expected to be imported not executed 
python -m  TwinPycs         arg1 arg2 # good:     __main__.py is called and executed
#method 2) WITH  changing PYTHONPATH
set PYTHONPATH=%PYTHONPATH%;D:\ttx\TwinPycs\src
python D:\ttx\TwinPycs\src\TwinPycs\A\main.py    arg1 arg2 #main.py has been called
python D:\ttx\TwinPycs\src\TwinPycs\__main__.py  arg1 arg2 # __main__.py has been called.

Installation

  1. Install the package:
    pip install .
    pip show TwinPycs
    

test the installtion

pip show TwinPycs
python -c "import TwinPycs;TwinPycs.show_message_box()"

python -m  TwinPycs  arg1 arg2 # good:     __main__.py is called and executed

Once installed with PIP, if you have defined a function [project.scripts], an executable will be created in Script folder of you Python. python -c "import sys; print(sys.executable)" If you want to access to the executables of Python mackages, add the Scrips path to PATH. YOUR-PYTHON-EXECUTABLE-FOLDER\LocalCache\local-packages\Python312\Scripts\TwinPycs_cli.exe

  TwinPycs_cli.exe

uninstalling the project on the machine

pip show TwinPycs
pip uninstall TwinPycs
  1. Run the application:
    TwinPycs
    

Building Executable

To create a Windows executable using CX_Freeze:

python setup_TwinPycs.py build   
python setup_TwinPycs.py bdist_msi

The executable will be created in the build directory.

Project details


Download files

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

Source Distribution

twinpycs-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

twinpycs-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: twinpycs-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for twinpycs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 87757153a6627a162da54200b2fc01dc1b53db08f297717cadf7e88e0865657d
MD5 e1bee7995bc06fbad02b4541071f38c8
BLAKE2b-256 9e067c110e83335b940e7cd133b79e9dbc13158f0fa272b56db9fed40b2bb57e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: twinpycs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for twinpycs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6aea48c0e2bd8498232546952d86d09cf1d88b87dbcf41344f2637d338007261
MD5 a5beaae7392f1fb7c599b8be21be909f
BLAKE2b-256 8b25f88b9cb1abb303a34374415fb4a4c6796ae03ccce99ce1b3f6db836457e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page