Memoru

System Engineering and Programming and IT

Entries from 2018-06-01 to 1 month

confirm nginx processing

On WSL NGINX installation sakai@eX:~$ pwd /home/sakai sakai@eX:~$ wget -q http://nginx.org/keys/nginx_signing.key sakai@eX:~$ ls nginx_signing.key sakai@eX:~$ sudo apt-key add nginx_signing.key OK sakai@eX:~$ sudo apt-get update : : Fetche…

Explorer -> Powershell

Procedure Explorer ctrl+L powershell

watchdog

tree /f PS G:\workspace\py\sandbox\watchdog_sample> tree /f Folder PATH listing for volume Users Volume serial number is 04A1-7D2F G:. │ app.py │ apps.log │ configbase.py │ logging_debug.conf │ watchdog_sample.py │ ├─configs │ │ config.py …

json.dump

json_sample.py #! /usr/bin/env python """{fname} # sample code for csv Usage: """ __author__ = 'Memoru' __version__ = '0.0.1' __date__ = '2018-06-26' import sys import os __doc__ = __doc__.format(fname=os.path.basename(__file__)) import js…

csv

csv_sample.py #! /usr/bin/env python """{fname} # sample code for csv Usage: """ __author__ = 'Memoru' __version__ = '0.0.1' __date__ = '2018-06-26' import sys import os __doc__ = __doc__.format(fname=os.path.basename(__file__)) import csv…

unittest

unittest unittest.main()は、unittest.TestCaseを継承した全てのクラスのメソッドのうちtestで始まるテストをテストケースとして実行する。 import unittest import calc from add_sample import add class TestCalc(unittest.TestCase): def test_add2(sel…

shuitl

(sandbox) PS G:\workspace\py\sandbox\standards> python Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import shutil >>…

method on dict

(sandbox) PS G:\workspace\py\sandbox\standards> python Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> dir({}) ['__clas…

method for array

(sandbox) PS G:\workspace\py\sandbox\standards> python Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> dir([]) ['__add_…

method of string

(sandbox) PS G:\workspace\py\sandbox\standards> python Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> dir('') >>> for …

workon

Before coding , first check the environment on PC. PS G: > $Env:PROJECT_HOME G:\workspace\py PS G: > $Env:WORKON_HOME G:\env\py PS G: >cd $Env:PROJECT_HOME PS G:\workspace\py> workon Pass a name to activate one of the following virtualenvs:…

django-admin startapp

procedure (djanbox) PS G:\workspace\py\djanbox> django-admin --version 2.0.6 (djanbox) PS G:\workspace\py\djanbox> explorer . (djanbox) PS G:\workspace\py\djanbox> (djanbox) PS G:\workspace\py\djanbox> django-admin startapp upload (djanbox…

start working on virtualenvwrapper

procedure PS G:\Users\sakai> cd $Env:PROJECT_HOME PS G:\workspace\py> workon Pass a name to activate one of the following virtualenvs: ============================================================================== djanbox djfirst djfourth …

inspect.stack()

inspect.stack() # ----------------------------------------- # def _get_funcname(): return inspect.stack()[1][3] def sample(): logger = logging.getLogger(__name__) logger.debug('begin ------> {}()'.format(sys._getframe().f_code.co_name)) lo…

os.path

os.path def _sample(): logger = logging.getLogger(__name__) logger.debug('__file__ name : {}'.format(__file__)) logger.debug('basename : {basename}'.format(basename=os.path.basename(__file__))) logger.debug('dirname : {dirname}'.format(dir…

PROJECT_HOMEを開く

G:> explorer $Env:PROJECT_HOME

workon

sourcetreeで、project_homeを、Explorerで開き、activateして、projectフォルダに戻る。 $p= $PWD.Path.split("\")[-1] cd $Env:workon_home\$p .\Scripts\activate cd $Env:project_home\$p // --- end of blog

docopt and docstring

docopt overview This tool parses help statement in doc. preference GitHub site github.com Show Usage in Japanese bicycle1885.hatenablog.com installation G:\ > pip install docopt usage How to use docopt形式で、パッケージのdocに記述する。 以…

gibo

.gitignore boilerplates Overview gibo is a shell script to help easily access .gitignore boilerplates. download gibo github.com installation GitHubサイトをclone pathを通す。 Environment PS G:\Users\sakai> $env:path.split(";") | Out-String …

python組み込み変数

組み込み変数 variable content note __file__ 実行script full path __name__ 実行script module sample logging_sample.py #! /usr/bin/env python """sample code for __file__ """ import logging import logging.config import os import sys ### -----…