Skip to content

MarioCodes/python-playground

Repository files navigation

python-playground

Environment

Raw

Navigate to your project's folder

// this creates a virtual environment named venv
py -m venv env

// activate the environment
.\venv\Scripts\activate.bat

// from inside the virtual env
pip install -r requirements.txt

// to exit venv
.\venv\Scripts\deactivate.bat

Poetry

install pip tools

py -m pip install pip-tools

// upgrade pip
pip install --upgrade pip

install pipx

py -m pip install --user pipx

// adds executables to global path so you can call them without py -m ...
py -m pipx ensurepath

install poetry through pipx

py -m pipx install poetry

Poetry usage

Go to your project's folder and set up poetry

// this creates a `.toml` file with configuration
poetry init

// if problems on init
poetry config virtualenvs.use-poetry-python true

add dependencies later on

poetry add {package_name}

create virtual env for the project

// you need to have a README.md on the project's root
poetry install

enter into virtual env

poetry env activate

// activate or create new virtualenv for current project
poetry env use {other_env}

see active env

poetry env info

build project

poetry build

install and run a project through poetry

// this works through pyproject.toml's conf
poetry install

there you need something like this, where this 'hello' is the one you use to run the project

[tool.poetry.scripts]
hello = "PromptEngineering:main"

execute

poetry run hello

Prompt engineering

Ensure you have OPENAI_API_KEY as environment variable and billing enabled for that key. You'll need an account.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published