sync notes(auto)

This commit is contained in:
Kaz Saita(raspi4) 2024-03-30 12:00:11 +09:00
parent cb144cdb7e
commit 2fb4658e25
3 changed files with 52 additions and 2 deletions

View file

@ -9,6 +9,7 @@ if __name__ == "__main__":
# ここにやりたいことを書く
```
cf.
[6.1.1. モジュールをスクリプトとして実行する](https://docs.python.org/ja/3/tutorial/modules.html#executing-modules-as-scripts)
## Refs.
- [6.1.1. モジュールをスクリプトとして実行する](https://docs.python.org/ja/3/tutorial/modules.html#executing-modules-as-scripts)

View file

@ -11,3 +11,4 @@ $ poetry config virtualenvs.in-project true
## Refs.
- [Poetryをサクッと使い始めてみる #Python - Qiita](https://qiita.com/ksato9700/items/b893cf1db83605898d8a)
- [pyenv+PoetryでのPython環境構築方法を覚えられない人のための手順書 #Python - Qiita](https://qiita.com/Ryku/items/512a6744bfa9903bf2dd)

View file

@ -70,6 +70,28 @@ $ poetry install [インストールしたいライブラリ]
```
でインストールされていく。 pyporoject.tomlに自動で追記される(はず)
### 結果できる poetry.toml
```toml
[tool.poetry]
name = "python-project-template" # ここ毎回換える
version = "0.1.0"
description = "template project for pyenv+poetry"
authors = ["Kaz Saita(raspi4) <saita@kinoshita-lab.org>"]
license = "MIT"
readme = "README.md"
package-mode = false
[tool.poetry.dependencies]
python = "^3.11"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
```
```
### 実行
[[#20240329134609 pythonプロジェクトの実行方法 作り方#実行方法]] を参照。
@ -80,3 +102,29 @@ $ poetry install [インストールしたいライブラリ]
poetry.lock
__pycache__/
```
### vscode使いたい場合の設定
#### settings.json
```
{
    "terminal.integrated.enablePersistentSessions": true,
    "python.terminal.activateEnvInCurrentTerminal": true,
    "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
}
```
#### launch.json
```
{
    "version": "0.2.0",
    "configurations": [
        {
            "type" : "debugpy",
            "request": "launch",
            "name": "Launch project",
            "cwd": "${workspaceFolder}",
            "module": "python-project-template",           // ここ毎回かえる 
            //"args": [(あれば)],
        }
]
}
```