どんな風に表示されるのかな
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
listA = ["d","a","b","c"] | |
listB = ["e","b","c"] | |
def extract_not_exist(list_a, list_b): | |
""" | |
# forでなんとか抽出する方法 | |
not_exist_items = [] | |
for item in list_a: | |
if not (item in list_b): | |
not_exist_items.append(item) |
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
with open("test.txt","w"):pass |
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
[main] | |
aaaa = hogehoge | |
bbbb = fugafuga | |
cccc = mogumogu |
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
from time import sleep | |
from tqdm import tqdm | |
for i in tqdm(range(100)): | |
sleep(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
import ConfigParser | |
inifile = ConfigParser.SafeConfigParser() | |
inifile.read("xxxxxx/config.ini") | |
param = inifile.get("common", "hogehoge_param") | |
aws_key_id = inifile.get("aws","aws_key") |
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 argparse | |
if __name__ == "__main__": | |
### define config | |
parser = argparse.ArgumentParser(description='This script is ...') | |
parser.add_argument("-c", "--configpath", required=True, help='config file path') | |
parser.add_argument("-l", "--logtype", required=True, help='logtype ex. hogefuga') | |
args = parser.parse_args() | |
hg = Hogehoge(args.configpath, args.logtype) |
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
[loggers] | |
keys=root,hogehogetool | |
[handlers] | |
keys=defaultHandler,hogehogetoolHandler | |
[formatters] | |
keys=simpleFormatter | |
[logger_root] |
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
echo -e "\e[30m黒色" | |
echo -e "\e[31m赤色" | |
echo -e "\e[32m緑色" | |
echo -e "\e[33m黄色" | |
echo -e "\e[34m青色" | |
echo -e "\e[35m赤紫色(マゼンタ)" | |
echo -e "\e[36m水色(シアン)" | |
echo -e "\e[37m白色" |
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
class CreateUsers < ActiveRecord::Migration | |
def self.up | |
create_table :users do |t| | |
t.string :uid, :null => false | |
t.string :name, :null => false | |
t.timestamps | |
end | |
add_index :users, [:uid] | |
end |