コード例 #1
0
ファイル: main_action.py プロジェクト: LK-LAB/SARS2-Stat-KR
def region_data():
    global count_try
    try:

        return regions
    except:
        if count_try < 10:
            count_try += 1
            print("Retry %d" % count_try)
            region_data()
        else:
            print("Failed : some regions occur error ")


if __name__ == "__main__":
    table = table()
    try:
        data = collector(regions)
    except:
        data = collector(regions)

    readme = open('README.md', mode='wt', encoding='utf-8')
    readme.write('''
## 중공 바이러스[CCP Virus]()(SARS-CoV-2) 대한민국 확진자 통계
### Confirmed cases of CCP-Virus in Korea
{0} KST

각 **시/도/구/군청** 사이트에 공개되어 있는 **공식 자료**를 수합하여 만든 통계입니다.
질병관리본부에서 발표되는 공식 수치와는 다를 수 있습니다.

{1}
コード例 #2
0
import json
import socket
sys.path.append("../")
from util.table import table
from util.proxy import proxy

configFile = open("config.json")
config = json.load(configFile)
data_path = "../../database/database.txt"
new_file = config["file"]
l_addr = config["local_ip"]
l_port = config["local_port"]

# Database modification
add_list = []
database = table()
database.get_ctx_fromfile(data_path)
print("original database: ")
database.export()
source = table()
source.get_ctx_fromfile(new_file)
print("new data: ")
source.export()
d_uuid_list = database.get_uuid_list()
s_uuid_list = source.get_uuid_list()
ld = len(d_uuid_list)
ls = len(s_uuid_list)
for i in range(ls):
    if s_uuid_list[i] in d_uuid_list:
        continue
    else:
コード例 #3
0
ファイル: remove.py プロジェクト: Lifan-9527/PDE_solver_demo
configFile = open("config.json")
config = json.load(configFile)
data_path = "../../database/database.txt"
rm_file = config["file"]
l_addr = config["local_ip"]
l_port = config["local_port"]


# get rm_list
rm_list = []
with open(rm_file, "r+") as f:
	for line in f:
		rm_list.append(int(line.strip('\n')))

# Database modification
database = table()
database.get_ctx_fromfile(data_path)
print("original database: ")
database.export()
print("remove list: ", rm_list)
d_uuid_list = database.get_uuid_list()

rm_ctxs = database.lookup(rm_list)

# database management
for x in rm_list:
	database.remove(x)
print("new database:")
database.export()
print("---------------")