분류 전체보기(854)
-
Flask-apispec에서 파일 업로드 처리
내가 원한건 파일 업로드를 위한 POST API를 Swagger UI에서 테스트할 수 있도록 하는것인데 정말 쓸만한 레퍼런스가 없다. 이 간단한 코드를 만들기 위해 여기 저기서 짜깁기를 해야하다니.. 헐 from flask_apispec import marshal_with, use_kwargs from flask_apispec.views import MethodResource from marshmallow import Schema, fields from werkzeug.datastructures import FileStorage @use_kwargs({"file": fields.Raw(type="file")}, location="files") @marshal_with(ResponseSchema) def ..
2023.06.21 -
갑자기 WSL2 오류 발생 문제 해결 방법
멀쩡히 잘 동작하던 Windows용 Docker Desktop 실행이 안되서 보니 WSL에 문제가 생긴 것이었다. WSL은 물론 Docker까지 uninstall하고 다시 설치 했음에도 불구하고 같은 문제가 계속 발생한다. WSL이나 Virtual Machine Platform까지 uninstall/install을 해도 차이가 없었다. https://gist.github.com/4wk-/889b26043f519259ab60386ca13ba91b Clean uninstall then reinstall of WSL on Windows 10, with systemD support Clean uninstall then reinstall of WSL on Windows 10, with systemD support..
2023.06.19 -
Windows의 WSL2 사용 레퍼런스
https://learn.microsoft.com/en-gb/windows/wsl/compare-versions Comparing WSL Versions WSL 2 provides the benefits of WSL 1, but uses an actual Linux kernel, rather than a translation layer like WSL 1, resulting in faster performance. learn.microsoft.com https://docs.docker.com/desktop/windows/wsl/ Docker Desktop WSL 2 backend on Windows docs.docker.com https://hoodiejun.tistory.com/11 윈도우에서 리눅스를..
2023.06.13 -
Python Mock Cookbook
클래스 메소드의 Mock을 처리하는 방법을 찾다가 괜찮은 레퍼런스를 발견했다. https://chase-seibert.github.io/blog/2015/06/25/python-mocking-cookbook.html Python Mock Cookbook The python mock library is one of the awesome things about working in Python. No matter what code you’re unit testing, it’s possible to mock out various pieces with very little test code. That being said, it’s sometimes difficult to figure out the ex chase..
2023.05.17 -
Sublime Text + Pylint
https://www.sublimelinter.com/en/stable/index.html Welcome to SublimeLinter — SublimeLinter 4.0.0 documentation © Copyright 2018, The SublimeLinter Community Revision 72c03227. www.sublimelinter.com https://packagecontrol.io/packages/SublimeLinter-pylint SublimeLinter-pylint - Packages - Package Control Browse SublimeLinter-pylint SublimeLinter plugin for python, using pylint. Details Installs ..
2023.05.09 -
Python용 TensorFlow 코드를 Swift용으로 컨버팅
Swift용 TensorFlow 라이브러리에서는 tf.gather나 tf.broadcast_to 등과 같은 간단한 함수들조차 제공하지 않아서, Python에서는 쉽게 구현한 코드를 Swift용으로 컨버팅을 하려면 같은 결과를 만드는 사용자 정의 함수를 만들어서 사용해야 한다. Swift에서 이미 배열 연산을 제공하기 때문에 크게 어렵지 않게 직접 구현 가능하다. https://www.tensorflow.org/api_docs/python/tf/gather tf.gather | TensorFlow v2.12.0 Gather slices from params axis axis according to indices. (deprecated arguments) www.tensorflow.org https://ww..
2023.04.21