목록공부/Python (2)
변명은 만개 결과는 한개

에러로그 전문 ↓ 더보기 Ignoring exception in command "커맨드명": Traceback (most recent call last): File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped ret = await coro(*args, **kwargs) File "c:\bot\EPPN\Inven-bot\invenBot.py", line 120, in "커맨드명" cur.execute( sqlite3.OperationalError: near "테스트": syntax error The above exception was t..

파이썬 코드들을 보는 와중에 member = member or ctx.author 라는 처음보는 `or` 사용이 눈에 띄어 테스트해보았다. >>> num = 1 or 3 >>> print(num) 1 위 연산 및 할당의 정확한 명칭은 잘 모르겠지만, `=` 할당자 사용 이후에 순차적인 연산에서 True 인 경우 바로 그 값으로 변수에 할당해주는것으로 보인다 :) >>> num = None or 4 >>> print(num) 4 >>> num = 3 and None >>> num >>> num = 3 and 2 >>> num 2 >>> num = True and 44 and True >>> num True `and` 또한 비슷하나, `=` 할당자 이후인 우측 항에서 모든 값이 True 인 경우 마지막 비교..