Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devlights/try-python
This is my TUTORIAL project for Python.
https://github.com/devlights/try-python
jetbrains pycharm pycharm-ide pytest python python3 tutorial
Last synced: 27 days ago
JSON representation
This is my TUTORIAL project for Python.
- Host: GitHub
- URL: https://github.com/devlights/try-python
- Owner: devlights
- License: mit
- Created: 2017-01-13T06:19:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-11-09T02:41:52.000Z (almost 2 years ago)
- Last Synced: 2024-09-27T06:04:30.126Z (about 1 month ago)
- Topics: jetbrains, pycharm, pycharm-ide, pytest, python, python3, tutorial
- Language: Python
- Homepage: https://devlights.hatenablog.com/
- Size: 3.8 MB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 44
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# try-python
This is my TUTORIAL project for python.![try-python - Python Version](https://img.shields.io/badge/python-3.10-blue.svg)
[![CodeFactor](https://www.codefactor.io/repository/github/devlights/try-python/badge)](https://www.codefactor.io/repository/github/devlights/try-python)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/devlights/try-python)# Requirements
- Python 3.10 or higher
- [Poetry](https://python-poetry.org/)
- Dependency management
- [Task](https://taskfile.dev/#/)
- Task runner# Python version
```sh
$ poetry run python -V
Python 3.10.7$ poetry env info
Virtualenv
Python: 3.10.7
Implementation: CPython
Path: /workspace/.pyenv_mirror/poetry/virtualenvs/try-python-M1FUJLyv-py3.10
Executable: /workspace/.pyenv_mirror/poetry/virtualenvs/try-python-M1FUJLyv-py3.10/bin/python
Valid: TrueSystem
Platform: linux
OS: posix
Python: 3.10.7
Path: /home/gitpod/.pyenv/versions/3.10.7
Executable: /home/gitpod/.pyenv/versions/3.10.7/bin/python3.10
```# Make Environment
```sh
$ poetry install
$ poetry lock
```# REPL
```sh
$ task repl
task: [repl] poetry run python
Python 3.10.7 (main, Nov 8 2022, 08:35:33) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system("which python")
/workspace/.pyenv_mirror/poetry/virtualenvs/try-python-M1FUJLyv-py3.10/bin/python
0
```# Launch
```sh
$ task run
```# Unit Test
```sh
$ task test
```# Format
```sh
$ task fmt
```# Lint
```sh
$ task lint
```# Mypy
```sh
$ task mypy
```# VSCode settings (Example)
## settings.json
```json
{
"python.defaultInterpreterPath": "python",
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"python.linting.pydocstyleEnabled": true,
"python.terminal.launchArgs": [
"-B",
"-c",
"\"import IPython; IPython.start_ipython()\""
]
}
```## launch.json
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "try-python",
"type": "python",
"request": "launch",
"module": "trypython",
"pythonArgs": [
"-X", "dev",
"-X", "tracemalloc=10"
],
"env": {
"PYTHONDONTWRITEBYTECODE": "1"
}
}
]
}
```# Misc
- [try-python-extlib](https://github.com/devlights/try-python-extlib)
- 姉妹プロジェクト. 外部ライブラリのサンプルなどがあります。