jsup 2.1 - investor's relief (experiment on separation of investment and SNS)

by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/jsup-2-1-investor-s-relief-experiment-on-separation-of-investment-and-sns Hello, this is @joviansummer(witness: @jswit). I'm starting a new experiment regarding my @jsup vote service. The purpose of this experiment is to separate STEEM investment and social interaction(posting/commenting). For many people, writing a post daily(literally 365 posts per year) is not easy. It's not fun, and mandatory daily post only written for self-voting delegation service tends to result in useless low-quality content. I hope this new function of @jsup will reduce those posts, and also make it a bit more easy to invest in STEEM without worrying about daily posting. I think pressure of daily posting significantly undermines Steem as SNS. It's not fun. This is how it works: From 11:45 PM to 11:50 PM every night(reference time zone is GMT+9), @jsup checks if eligible delegators wrote something and received daily v...

파이썬에서 텍스트 파일 쓰기

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


파이썬에서 텍스트 파일을 쓰는 방법입니다. 지난번에 썼던 텍스트 파일 읽기에서 이어지는 내용입니다.

파이썬에서 텍스트 파일 읽기 https://steemit.com/hive-141029/@joviansummer/2v14rm

파일에 쓰려면 open() 함수로 파일을 열때 쓰기(w) 또는 이미 저장된 내용 뒤에 추가하기(a) 모드로 설정하면 됩니다.

# test.txt 파일을 쓰기 모드로 열고 파일 객체를 f에 할당
f = open('test.txt', 'w')

파일을 쓰기(w) 모드로 열어서 작업하면 이전에 저장되어 있던 내용이 있을 경우에는 삭제가 됩니다. 내용이 있는 파일 뒤에 새로운 내용을 덧붙이려면 추가하기(a) 모드로 열면 됩니다.

이제 문자열을 파일에 쓸 수 있습니다. 여러 줄로 내용을 쓸 경우 줄바꿈('\n')을 추가해 줍니다.

# 문자열 쓰기
f.write('hello world.\n')
f.write('testing file operation.\n')

작업이 끝나면 잊지 말고 파일 객체를 닫아줍니다.

f.close()

Comments

Popular posts from this blog

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

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

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