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

파이썬에서 텍스트 파일의 특정 행에 있는 내용 출력 - enumerate

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


파이선에서 텍스트 파일의 특정 행에 있는 내용을 출력하려면 enumerate() 함수를 이용해서 행번호와 그 행의 문자열을 가져온 후 조건을 적용하여 출력할 수 있습니다. 여기서 행번호는 0번부터 시작한다는 점에 유의해야 합니다. 즉, 0번행이 첫번째 행입니다.

예를 들어 my_data.txt 파일에서 3번째부터 10번째행을 출력하고 싶다면, 행번호는 0부터 시작하므로 2번부터 9번까지 출력하면 될 것입니다. 아래의 코드와 같이 할 수 있습니다.

f = open('my_data.txt', 'r')

for i, line in enumerate(f):
  if i >= 2 and i <= 9:
    print(line.rstrip())
  if i == 10:
    break

f.close()

위의 코드를 보면 파일에서 읽은 문자열을 line 변수에 할당하는데, 출력하는 print() 함수에서 줄바꿈을 추가해 주기 때문에 파일에서 읽은 내용에서 줄바꿈 기호(\n)는 rstrip() 함수를 이용해서 제거했습니다.

행번호 9번까지 출력하고자 했기 때문에 10번부터는 굳이 파일을 더 읽을 필요가 없습니다. 따라서 행번호가 10이면 break로 루프를 빠져나오고 파일을 닫습니다.


@joviansummer의 스팀 프로젝트

스팀 증인노드를 운영중입니다. @jswit에 증인투표해 주시면 감사하겠습니다.
(https://steemitwallet.com/~witnesses)

jswit 증인 노드 프로젝트를 시작합니다.

jsup 업보팅(upvoting) 서비스 소개

jsup 수혜자 지정 기능 추가

jSTEEM 프로젝트 - 텔레그램 챗봇으로 구현하는 스팀 블럭체인 탐색기

STEEM.NFT - 디지털 아트 보존 프로젝트

Posted through the AVLE Dapp (https://avle.io)

Comments

Popular posts from this blog

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

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

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