전체 글

📒 서클 리스트(Circle List) 💻 기본 구조 💻 노드 넣기 노드를 넣는데에는 5가지 경우가 있다. 첫 노드일 때 1-1. 노드가 있는 상태에서 헤드 다음으로 넣을 때 중간에 넣을때 마지막에 넣을때 3-1. 마지막 직전에 넣을 때 def add_node(data): global head node = Node() node.data = data temp = head # 노드가 없을때 if not head: head = node node.link = head return # head 앞에 삽입할 때, 오름차순 정렬이기 때문에 # head의 데이터 즉 처음 데이터보다 작다는 것은 # 가장 앞에 들어간다는 의미 elif temp.data > node.data: node.link = temp # 가장 뒤에 ..
📒 Linked-list (연결 리스트) 💻 Linked-list란? 링크드 리스트는 배열의 단점을 보완하기 위해 만들어진 자료구조다. Linked-list 구조 head: 첫(시작지점) 노드를 가리키고 있다. node: 데이터와 다음 데이터를 가리키는 link를 가지고 있다. Link-list는 다음 노드를 가리키는 link에 NULL을 넣음으로서 끝을 지정할 수 있다. 💻 노드 생성 # 노드를 만들 수 있는 클래스 생성 class Node: def __init__(self): self.datat = None self.link = None # head 변수 생성 head = None # 노드 생성 node = Node() node.data = 10 # head가 시작지점인 node를 가리킴 head =..
pip3 install webrtcvad을 하는데 오류가 발생했다. ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fz08njwh/webrtcvad/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fz08njwh/webrtcvad/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close(..
wsl 우분투에서 vscode를 사용하는데 이런식의 창이 뜨면서 저장이 안된다. 밑에 명령어 한 번이면 끝 sudo chown -R $my-computer: sudo chown -R my-computer . 출저
@bot.command() async def play(ctx): channel = ctx.author.voice.channel await channel.connect() 이런식으로 음성채널로 입장하는 코드를 썼는데 입장이 안된다. 딱히 오류가 뜨지도 않고 다른 명령어는 된다. 그럴때는 PyNaCl 모듈을 설치하면 된다. pip install PyNaCl 그럼 이렇게 잘 들어와지는 것을 확인할 수 있다.
채널 만들기 대충 만드는 순서는 봇이 들어있는 서버 정보 가져오기 서버에 채널 만들기 가 끝이라고 볼 수 있다. 채널 만드는 코드 명령어와 동시에 채널 이름을 입력받는다. @bot.comand() asyncdef create_channel(ctx, channelName): guild = ctx.guild await guild.create_text_channel(channelName) 이렇게 하면 카테고리 안에 없이 가장 최상단에 채널이 만들어진다. 만들고 싶은 채널 명령어 비고 텍스트 채널 create_text_channel(채널명) 최상단 음성 채널 create_voice_channel(채널명) 최상단 포럼 채널 create_forum(채널명) 최상단 카테고리 create_category(카테고리명) ..
# 채널 목록에서 원하는 채널 명의 채널 정보를 가져옴 channel_name = discord.utils.get(ctx.guild.channels, name = '원하는 채널 명') # 해당 채널에 메시지 보냄 await channel_name.send('123123')
# 채널 정보 가져오기 channel_name = discord.utils.get(ctx.guild.channels, name = '1234') # name: 글 제목, content: 글 내용 await channel_name.create_thread(name='asdf', content='123123123') 결과
샐프
무엇이든