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...

파이썬에서 실행 명령에 인자(argument) 지정

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


파이썬 스크립트를 실행할 때 실행 명령에 인자(argument)를 지정할 수 있습니다. 예를 들어 인자를 확인해서 이를 그대로 출력하는 스크립트 test.py를 만든다고 생각해 보겠습니다.

아래와 같은 실행 결과를 주는 스크립트입니다.

python3 test.py hello

test.py hello

python3 test.py hello world

test.py hello world

위의 스크립트는 아래와 같은 내용으로 작성되었습니다.

import sys

for arg in sys.argv:
  print(arg)

실행 명령의 인자는 sys.argv에 저장되며, 리스트(list) 형식입니다. 위의 예시에서는 for 반복문으로 sys.argv[0]부터 차례로 출력하였습니다.

2번째 예시의 경우(실행 명령: python3 test.py hello world) sys.argv에는 아래와 같이 값이 할당될 것입니다.

sys.argv[0]: 'test.py'(스크립트의 이름) sys.argv[1]: 'hello' (첫번째 인자) sys.argv[2]: 'world' (2번째 인자)

Comments

Popular posts from this blog

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

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

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