From b35098a2039e432efc5f4b22e4f9e6dcd08aa66b Mon Sep 17 00:00:00 2001 From: Daniel Washburn Date: Sat, 27 Jun 2015 14:10:34 -0400 Subject: Add README with license info and example usage --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ff3a957 --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +# PyRC # + +An IRC library written in Python + +## License ## + +[BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause). See LICENSE. + +## Usage ## + +``` +#!/usr/bin/python + +import PyRC +import sys +import time + +Irc = PyRC.Client() + +Irc.connect(host='irc.example.com') + +# Give the server a moment to respond +time.sleep(2.0) + +print Irc.main_loop() + +Irc.join("#example) + +print Irc.main_loop() + +Irc.message('#example', 'PyRC Bot is listening') + +print Irc.main_loop() + +while True: + try: + msgs = Irc.main_loop() + if msgs: + for line in msgs: + print line + time.sleep(1.0) + msgs = [] + except KeyboardInterrupt: + Irc.quit('Powered by PyRC Bot') +``` + +
+Copyright (c) 2009-2015, Daniel Washburn. All rights reserved. -- cgit v1.2.2