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

파이썬에서 파일 확장자 분리

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


파이썬에서 간단하게 파일명에서 확장자만 따로 떼어내서 확인할 수 있습니다. os 모듈을 import하고 os.path.splitext() 함수를 사용하면 됩니다.

import os

filename = "/test/my_data.tmp.txt"
result = os.path.splitext(filename)
print(result)

('/test/my_data.tmp', '.txt')

확장자와 나머지 부분을 분리해서 위와 같이 투플(tuple)을 만들어 줍니다. 투플은 리스트(list)와 비슷하지만 값을 변경할 수 없다는 점이 다릅니다. 리스트와 마찬가지로 인덱스로 필요한 부분을 가져와서 쓰면 됩니다.

print(result[0])

/test/my_data.tmp

print(result[1])

.txt

파일의 확장자에 따라 뭔가 다른 작업을 해야 할 때 편리합니다.

``` ext_str = os.plath.splitext(filename)[1] if ext_str == ".txt": print("확장자가 .txt입니다.")

Comments

Popular posts from this blog

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

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

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