GentBG x PUSSTEEM - burning both STEEM and PUSS

Image
by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/gentbg-x-pussteem-burning-both-steem-and-puss Hello, this is @joviansummer(witness: @jswit), developer of GentBG project. I registered @gentbg account to PUSSTEEM about a week ago and donated some of my own PUSS token to @gentbg's EPUSS account. Now, @gentbg will burn STEEM and EPUSS at the same time. PUSSTEEM's boosting upvotes will help increasing baseline burning significantly. @gentbg's SP reward is delegate to @jsup to get automated upvotes, forming a baseline burning of liquid reward independent of other people's upvotes. Some may argue 100%(both liquid and SP reward) burning is much better, but I chose this approach to prevent @gentbg from becoming a spamming account. Constantly asking for upvotes via mentioning and commenting every week may eventually become a big annoyance to curators. That being said, anyone is welcome to participate in countering STEEM inflation by giving upvotes ...

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

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포스팅 강박에서 벗어나기