43 lines
1005 B
Markdown
43 lines
1005 B
Markdown
|
|
|
|
```shell
|
|
» uvx --from 'git+https://git.hatter.ink/hatter/py-scripts.git#subdirectory=projects/hello-world' run
|
|
Updated https://git.hatter.ink/hatter/py-scripts.git (1cde9d325ec45b6e18aaa68b9af92600b1ded781)
|
|
Built hello-world @ git+https://git.hatter.ink/hatter/py-scripts.git@1cde9d325ec45b6e18aaa68b9af92600b1ded781#subdirectory=projects/hello-world
|
|
Installed 6 packages in 9ms
|
|
Hello World!
|
|
```
|
|
|
|
|
|
<br>
|
|
|
|
```shell
|
|
uv run https://script.hatter.ink/@0/httpstat.py https://hatter.ink/
|
|
```
|
|
> https://github.com/reorx/httpstat
|
|
|
|
|
|
<br>
|
|
|
|
Auto activate Python `.venv` in zsh, edit `~/.zshrc`:
|
|
|
|
```shell
|
|
_venv_auto_activate() {
|
|
if [ -d ".venv" ] && [ -f ".venv/bin/activate" ]; then
|
|
if [ -z "$VIRTUAL_ENV" ]; then
|
|
source .venv/bin/activate
|
|
elif [[ "$VIRTUAL_ENV" != *".venv" ]]; then
|
|
deactivate
|
|
source .venv/bin/activate
|
|
fi
|
|
elif [ -n "$VIRTUAL_ENV" ]; then
|
|
deactivate
|
|
fi
|
|
}
|
|
|
|
autoload -U add-zsh-hook
|
|
add-zsh-hook chpwd _venv_auto_activate
|
|
|
|
_venv_auto_activate
|
|
```
|