Using VSCode with pipenv

I found out how to use pipenv environment with VS Code from the article “Visual Studio Code, Python and pipenv”. Thanks, Benjamin Pack! I saved the text for myself. First, find out where pipenv has created your virtualenv setup and stashed the python executable you are using. From the command line in your project folder (where your Pipfile is), execute the following: pipenv --py This will give you the full path to your virtualenv python install. For my sample project it was /Users/pack/.local/share/virtualenvs/astra-AQkAm5fD/bin/python ...

<span title='2021-03-15 00:00:00 +0000 UTC'>March 15, 2021</span>

Django REST API with React App step-by-step

I use PyCharm for python projects and pipenv for package management. Start new PyCharm project named django-rest-react-blog Optionally git init clone gist .gitignore for Django and React projects Main course pipenv install django pipenv install djangorestframework pipenv install ipython --dev django-admin.py startproject bookcase cd bookcase python manage.py startapp mainapp Edit bookcase/settings.py: ... INSTALLED_APPS = [ ... 'rest_framework' ] ... TEMPLATES = [ { ... 'DIRS': [BASE_DIR / 'mainapp-ui/build'], ... }, ] ... STATIC_ROOT = BASE_DIR / 'static' STATICFILES_DIRS = ( (BASE_DIR / 'mainapp-ui/build/static'), ) Edit mainapp/views.py: from django.shortcuts import render def index(request): return render(request, 'index.html', {}) Edit bookcase/urls.py: ... from mainapp.views import index urlpatterns = [ ... path('', index) ] make dir mainapp/api with files there: ...

<span title='2021-02-27 00:00:00 +0000 UTC'>February 27, 2021</span>

Facial recognition with Python

I tried the facial recognition library for Python ageitgey/face_recognition. This library uses dlib, a toolkit written in C++ that contains machine learning algorithms. For example, I’m trying to check if an actor is playing in the TV series “The Big Bang Theory”. A test image with an actor is compared to real actors filmed in a TV show. I wrote a web service that uses python face_recognition library for face recognition from image and compares the recognized face with the data stored in the database. ...

<span title='2021-01-18 00:00:00 +0000 UTC'>January 18, 2021</span>

Watchdog for folder changes with golang

I recently wrote a Python script to log changes in the selected folder. The script has a GUI based on Tkinter, the native Python library. I decide to rewrite this script in the Golang. I only need one executable file that doesn’t require Python installation. Before that, I made an executable file using pyinstaller. But why not try Golang? Apart from Tkinter, I only know a little about the GTK. I used it for a new version of the program written in Golang with a GUI. ...

<span title='2020-09-05 00:00:00 +0000 UTC'>September 5, 2020</span>

Management of multiple versions of Python with pyenv

Pyenv pyenv lets you easily install and switch between multiple versions of Python. Install and customization zsh The main issues are described in wiki curl https://pyenv.run | bash echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.zshrc exec $SHELL sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev Update pyenv ...

<span title='2020-08-30 00:00:00 +0000 UTC'>August 30, 2020</span>

Сохранение паролей в Windows Credentials Locker из Python

Ставим keyring pip install keyring Выполняем import keyring keyring.set_password("system", "username", "password") Результат Доступ к данным keyring.get_password("system", "username") 'password'

<span title='2020-04-08 00:00:00 +0000 UTC'>April 8, 2020</span>