STEEM POWER retention ratio of top 50 witnesses

by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/steem-power-retention-ratio-of-top-50-witnesses Hello, this is @joviansummer(witness: @jswit). Some time ago there was a bit of discussion on discord witness chanel about witnesses' power-down/cashing-out. So out of curiosity I just checked current ratio of witnesses' own STEEM POWER(VESTS) and all-time producer reward(VESTS). The ratio is calculated by the following simple formula: ratio(%) = account's own SP(MV) / all-time producer reward SP(MV) * 100% Ratio value less than 100% indicates power-down. If witness does additional power-up or gets other types of reward(e.g., curation reward), the ratio may exceed 100%. This does not take witness' other accounts into consideration. All-time producer reward data is from @steemchiller's SDS API. Here is the result: rank account own_sp prod_sp ratio 1 justyy 2188.411MV 1284.2MV 170.41% 2 steemchiller 982.134MV 124...

파이썬 관련 메모 2가지(일시정지, 하위 디렉토리 검색)

by joviansummer
original STEEMIT post: https://steemit.com/blog/@joviansummer/2


개발 작업 참고용으로 2가지 사항을 메모해 둡니다.

파이썬에서 코드 실행을 일정 시간 동안 정지하고 싶을 경우 time.sleep()을 사용합니다. 얼마 동안 정지할 것인지라 초로 지정할 수 있습니다.

import time

# 30초간 정지
time.sleep(30)

현재 디렉토리 하위에 있는 디렉토리와 파일을 검색하려면 os.walk()를 사용합니다. 경로(path), 해당 경로에 있는 디렉토리들, 해당 경로에 있는 파일들을 생성해줍니다. 디렉토리들과 파일들이 리스트(list) 형식으로 생성됩니다.

import os

# 현재 디렉토리를 파악하여 CUR_DIR에 할당
CUR_DIR = os.getcwd()

# 현재 디렉토리 하위에 있는 디렉토리와 파일 출력
for (path, dirs, files) in os.walk(CUR_DIR):
  print("경로: ", path)
  print("디렉토리: ", dirs)
  print("파일: ", files)
  print(" ")

만약 파일명만 골라서 하나씩 출력하려면 아래와 같이 할 수 있겠습니다.

for (path, dirs, files) in os.walk(CUR_DIR):
  for file in files:
    print("파일: ", file)

Comments

Popular posts from this blog

스티미언의 영향력 지수 계산

jsup/avle code update - you don't have to write post everyday

jsup/avle 보팅 코드 갱신 - 1일1포스팅 강박에서 벗어나기