str = "1, 2, 3, 4, 5, 6\n" _str = str.split("\n") __str = _str[0].split(",") print num for i in range(num): print "%d" %int(__str[i]) Python에서는 str.split()를 이용해 token으로 나눌 수 있다. 보통 csv파일을 readline()이나 readlines()로 읽으면 위와 같은데 split()을 사용하면 쉽게 원하는 정..
import threading import time class ExTimer(threading.Thread): def __init__(self): threading.Thread.__init__(self) # default delay set.. self.delay = 1 self.state = True self.handler = None def setDelay(self, delay): self.delay = d..
Panda3D에서 윈도우 속성을 마음대로 조절할 수 있는 클래스는WindowProperties 이다. 참조사이트는 http://www.panda3d.org/apiref.php?page=WindowProperties 사용해보니 기존에 사용하던 from pandac.PandaModules import loadPrcFileData 보다 편리하고 깔끔한 것 같다. from pa..
Panda3D에서는 대부분 프로임단위로 동작하는 task 함수가 있다. 하지만.. 프레임보다 더 빠른 속도로 처리해야할 무엇인가가 있을 때 Thread를 사용하면 유용할 때가 있다.(주로 패킷단위의 프로토콜 전송) Python에는 Thread와 Threading 가 있는데 Threading이 사용하기 편한 것 같다. import threading th = threading.Thread(target=함수이름, args=(변수)) th.start..