This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python -B | |
# -*- mode: python; coding: utf-8 -*- | |
from PIL import Image, ImageDraw | |
# 参考 http://qiita.com/suto3/items/87af35517f2a8c3bc22e | |
''' | |
pip install pillow | |
''' | |
img = Image.new('RGBA', (256, 256), (0, 0, 0, 0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openpyxl | |
book = openpyxl.load_workbook(filename='a.xlsx', | |
read_only=True, | |
use_iterators=True, | |
data_only=True) | |
sheet = book.get_sheet_by_name('Sheet1') | |
datas = [t for t in sheet.iter_rows()] | |
for rows in datas: | |
print([type(cell.value) for cell in rows]) | |
print([cell.value for cell in rows]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import csv | |
import codecs | |
sheet = csv.reader(open('foo.csv', 'r')) | |
all = [x for x in sheet] | |
for x in all: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import csv | |
import codecs | |
sheet = csv.reader(codecs.open('foo.csv', 'r', 'utf-8')) | |
all = [x for x in sheet] | |
for x in all: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install xlsx2csv | |
python -m xlsx2csv エクセルファイル CSVファイル | |
python -m xlsx2csv -s シート名 エクセルファイル CSVファイル |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# コピペで実行 | |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser | |
Install-PackageProvider NuGet -Force -ForceBootstrap -Scope CurrentUser | |
Install-Module PowerShellGet -Force -AllowClobber -Scope CurrentUser | |
Install-Module ChocolateyGet -Force -AllowClobber -Scope CurrentUser | |
# 管理者起動 | |
Install-Package NuGet.CommandLine -Provider ChocolateyGet | |
Install-Package ChocolateyGUI -Provider ChocolateyGet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
env = Environment(ENV = { | |
'PATH' : os.environ['PATH'] | |
}, | |
MSVC_USE_SCRIPT = os.path.join( | |
os.environ['VCFORPYTHON'], | |
'vcvarsall.bat') | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: python; coding: utf-8 -*- | |
# env にパッケージツールを含ませます | |
env = Environment(tools=['packaging']) | |
# または env.Tool('packaging') | |
# 含めるファイルを定義します | |
env.Install('foo/include/foo', 'workspace/include/foo.h') | |
env.Install('foo/bin', 'workspace/bin/foo.exe') | |
env.Install('foo/bin', 'workspace/bin/bar.exe') | |
env.InstallAs('foo/bin/zie.exe', 'workspace/bin/sue.exe') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
posix | |
echo "1:`date +%s`:送信者:送信機器:32:メッセージ" | iconv -f utf-8 -t cp932 | nc -w 1 -u 127.0.0.1 2425 | |
win | |
set T=%time::=0% | |
set T=%T:.=0% | |
echo 1:%T%:送信者:送信機器:32:メッセージ | ncat -w 1 -u 127.0.0.1 2425 | |
ipmsg /msg 127.0.0.1 メッセージ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import yaml, collections | |
def represent_odict(dumper, instance): | |
return dumper.represent_mapping('tag:unity3d.com,2011:129', instance.items()) | |
def construct_odict(loader, node): | |
return collections.OrderedDict(loader.construct_pairs(node)) |
OlderNewer