29 lines
401 B
Python
29 lines
401 B
Python
#!/usr/bin/python3
|
|
import sys
|
|
import time
|
|
from irc import IRC
|
|
|
|
def main():
|
|
main = IRC("#mainchannel", "cp1251")
|
|
main.connect(("irc..ru", 6667), "tester")
|
|
|
|
while True:
|
|
data = main.recv(512)
|
|
if data is None:
|
|
continue
|
|
|
|
main.parser(data)
|
|
print(main.sender)
|
|
print(main.data)
|
|
|
|
if __name__ == "__main__":
|
|
while True:
|
|
try:
|
|
main()
|
|
|
|
except KeyboardInterrupt:
|
|
break
|
|
|
|
except:
|
|
pass
|