GentBG - why bother to burn STEEM?

Image
by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/gentbg-why-bother-to-burn-steem GentBG - a new experiment to burn STEEM Hello, this is @joviansummer(witness: @jswit). I'd like to briefly explain why I bothered to start @gentbg experiment. Unlike bitcoin, STEEM has no supply limit. As long as STEEM exists, newly minted STEEM will be added to total supply. If we can't maintain corresponding demand or reduce supply, downward pressure on STEEM price can be a big challenge. @gentbg project is an experiment to reduce STEEM supply by burning. @gentbg will burn liquid author reward and delegate SP reward to @jsup to get amplified upvotes. The main purpose is to create a perpetual STEEM burning loop. I added a bit of fun factor via AI-generated images, to incentivize giving upvotes to @gentbg's posts. If you have some spare voting power, you can contribute to burning STEEM by giving upvotes to @gentbg's posts. Initial run of this experiment wil...

파이썬 관련 메모 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포스팅 강박에서 벗어나기