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

by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/jsup-avle-code-update-you-don-t-have-to-write-post-everyday Hello, this is @joviansummer, developer of @jsup and@avle voting service. Voting service code for @jsup and @avle has been updated. I had been considering this update for a while, and recently I could come up with detailed implementation plan which resulted in a relatively swift code revision. The new added feature is capability to give daily upvote to the first thing you write for the day(timezone GMT+9) regardless of post or comment/reply. Writing a post everyday can be challenging. In that case, you can write a reply to receive daily upvote because writing a reply everyday is much easier and also a good way to engage in your community. Writing a post everyday just to get an upvote can be very tedious and exhausting, and post itself could easily become low-quality. There may be people who enjoy writing a post everyday, but we can't ignore th...

파이썬에서 예외(exception) 처리

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


파이썬에서의 예외(exception) 처리 예시입니다. try와 except 구문을 사용합니다.

예를 들어 어떤 수를 0으로 나누려 할 경우 예외가 발생할 것입니다.

try:
  x = 100/0
except:
  print("예외가 발생했습니다.")

위의 코드를 실행하면 "예외가 발생했습니다."라는 문자열이 출력될 것입니다.

어떤 예외가 발생했는지 출력하고 싶다면 아래와 같이 할 수 있습니다.

try:
  x = 100/0
except Exception as e:
  exc_str = str(e)
  print(exc_str)

위의 코드를 실행하면 예외 발생 메시지 "division by zero"가 출력될 것입니다.

Comments

Popular posts from this blog

Nuitka - 파이썬 스크립트를 바이너리 실행 파일로 변환

[ENG] jsup 2.0 - make your upvote great again

[EN] STEEM-services: dapps/services webpage with sort and search functions