Python:Exception

Python: Exception Python Exceptions: An Introduction 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 try: # 処理 linux_interaction() except AssertionError as error: # 例外 print(error) else: ## 例外がない場合 try: with open('file.log') as file: read_data = file.read() except FileNotFoundError as fnf_error: print(fnf_error) finally: # 最後に必ず実行 print('Cleaning up, irrespective of any exceptions.') Python Exception Base Classes 組み込み例外 8.6. ユーザー定義例外

2021年5月14日 · 1 分

Radio

Radio 曜日 Ch 時間 番組 月 J-Wave 22:00 - 24:00 SONAR MUSIC 月 NHK 24:00 - 24:50 夜のプレイリスト 火 J-Wave 22:00 - 24:00 SONAR MUSIC 火 NHK 24:00 - 24:50 夜のプレイリスト 水 J-Wave 22:00 - 24:00 SONAR MUSIC 水 NHK 24:00 - 24:50 夜のプレイリスト 木 J-Wave 22:00 - 24:00 SONAR MUSIC 木 NHK 24:00 - 24:50 夜のプレイリスト 金 InterFM 897 20:00 - 22:00 TOKYO SCENE 金 NHK 24:00 - 24:50 夜のプレイリスト 金 InterFM 897 24:00 - 25:00 beatDAYZ 土 Fm yokohama84.7 24:00 - 25:00 Bayside Reggae Lounge 日 J-Wave 20:00 - 21:00 Travelling without Moving Station Apple Music Radio BBC Sound nts worldwidefm soundcloud mixcloud

2021年5月10日 · 1 分

Django: Request.encodingについて

HttpRequest.encoding django.http.request.HttpRequest cgi.parse_header で、Content-Typeヘッダーから content_type と content_params(dict) を取得。 conent_paramsに charset が入っている可能性がある codecs.lookup を使って、charset の存在を確認。 存在したらHttpRequest.encodingプロパティに設定する 実態は, HttpRequest._encoding

2021年4月24日 · 1 分

DRF: CSVを送信するするときに WindowsだとBOMをつけないとExcelで文字化けする問題

BOM(byte order mark) ファイルの先頭3バイトが ‘EF BB BF’ の UTF-8 rest_framework_csv rendererで、 コンテキストの encoding を判定している encodingに utf-8-sig を 指定する viewset: get_renderer_context をオーバーライドする 1 2 3 4 5 6 7 8 9 10 11 def get_renderer_context(self): """(override)""" context = super().get_renderer_context() # ここで、以下の条件の時に utf-8-sigにセット # 1) text/csv を求めている # 2) utf-8 でエンコードが指定されている(デフォルト) if self.request.META.get('HTTP_ACCEPT', '').startswith('text/csv'): context['encoding'] = 'utf-8-sig' return context 記事 bom付きutf-8に変換するnkfコマンド PythonでUTF-8 with BOMを開く Declaring character encodings in HTML The byte-order mark (BOM) in HTML Accept-Encoding HttpRequest.META

2021年4月24日 · 1 分

XCode: A valid provisioning profile for this executable was not found

原因 時間がおかしい(有効期限切れ) Legacy Build System にする (File >Project Settings...>Build System) (今回はこれ) テスト実機端末のスキーマがおかしい(Products > Schema > Edit Schema で Run, Profile の Build Configuration を DEBUG にする) ~/Library/MobileDevice/Provisioning Profiles 1 2 3 4 % ls -l ~/Library/MobileDevice/Provisioning\ Profiles total 456 -rw-r--r-- 1 hdknr staff 10352 4 17 13:52 0179a51b-7303-4fef-b1a0-4a3cf541b737.mobileprovision ..... 記事 【Xcode】ビルドは成功するが、実機にインストールできない問題 エラー:A valid provisioning prof… の対処法 Unable to install iOS app on device. Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402653179 Easy fix! “A valid provisioning profile for this executable was not found” A valid provisioning profile for this executable was not found

2021年4月24日 · 1 分

gistpad-scratch

‎‎​

2021年4月22日 · 1 分

Windows Termnal

https://docs.microsoft.com/ja-jp/windows/terminal/customize-settings/color-schemes https://qiita.com/y-tsutsu/items/833020344aa03539856e

2021年2月26日 · 1 分

Django Simple Docker File

% tree . -I '__*|db*' . ├── Dockerfile ├── poetry.lock ├── pyproject.toml └── web ├── blogsite │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── manage.py └── pages ├── admin.py ├── apps.py ├── migrations ├── models.py ├── tests.py ├── urls.py └── views.py 4 directories, 14 files

2021年2月19日 · 1 分

2020-11-30

1 2 3 const logger = require('electron-log'); logger.log(`${logger.transports.file.getFile()}`) C:\Users\hdknr\AppData\Roaming\electron-osc-js\logs\main.log

2020年11月30日 · 1 分

Windows 関連

Setting up WSL 2 for Web Development https://qiita.com/v2okimochi/items/f53edcf79a4b71f519b1 https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack

2020年11月21日 · 1 分