Skip to content

Instantly share code, notes, and snippets.

@iamn3
iamn3 / developing_machine.py
Created November 1, 2017 13:51
developing raw data RW2 format.
#!/usr/bin/env python
#codeing:utf-8
#
# Useage:
# $ mkdir -p /path/to/workspace
# $ mkdir -p /path/to/workspace/negative_film
# $ mkdir -p /path/to/workspace/jpeg
# $ cp *.RW2 /path/to/workspace/negative_filem/
# $ ./developing_machine.py /path/to/workspace
#
import sys
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Useage: %s [word] filename" % sys.argv[0])
quit()
word = sys.argv[1] # 検索対象の文字列
fp = open(sys.argv[2],'r')
data = fp.read().split("\n") #ファイル内のデータ
@iamn3
iamn3 / janken.py
Created September 13, 2017 14:44
#
# じゃんけんゲーム
import random
# 入力値が0 or 1 or 2か判定
def validate_hands(hand):
try:
#数値で0,1,2なら正しい入力値とする(Trueを返す)
hand_num = int(hand)
return hand_num == 0 or hand_num == 1 or hand_num == 2
.article h2 {
border-left: 10px solid #000;
border-bottom: 1px solid #000;
margin: 40px -10px 20px;
padding:0px 20px;
}
<html>
<head>
<link href="/sample.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h1>赤い見出し</h1>
</body>
</html>
<html>
<head>
<style>
h1 {
color: red;
}
</style>
</head>
<body>
<h1>赤い見出し</h1>
<h1 style="color:red">赤い見出し</h1>
h1 {
color: red;
}
@iamn3
iamn3 / todo.py
Last active June 19, 2018 13:37
CLI todo list. Python3 tutorial
# ToDoリストを登録する変数
todo_list = []
# エントリーポイント
def start_repl():
print("簡単なToDoプログラム")
while True:
print("todo>> ",end='') # endオプションにから文字を入れると改行せずに出力
commands = input().split(' ')