A Diffrent Approach at Socket in Python 3.x - Printable Version +- Forums - Open Redstone Engineers (https://forum.openredstone.org) +-- Forum: Off-Topic (https://forum.openredstone.org/forum-4.html) +--- Forum: Programming (https://forum.openredstone.org/forum-8.html) +--- Thread: A Diffrent Approach at Socket in Python 3.x (/thread-2120.html) |
A Diffrent Approach at Socket in Python 3.x - WrytXander - 01-22-2014 Since it is so damn popular atm, I went ahead and made myself an IRC Bot too. It had nothing spectacular or new, but it was a bot and it was working. One thing I realized was how hard and frustrating socket connections was in python 3.x. To put it out simply, what happened over 2.x to 3.x was now, with 3.x you have to explicitly define the encoding of the data you are sending. So, this requires something like: irc.send(bytes("PRIVMSG"+CHN+" : Hello\r\n","utf-8")) when you have lots of these, It can get very obnoxious. So what ı basically did, was I created a little "framework" that anyone can use for their own personalized IRC Bots. It basically consists of very basic useful classes and functions that helps you out with the development process. It is the version one, I was testing for a while, now ı know it works, so here is the link to the post in my pastebin page. As I said, nothing new/fancy going on, anyone who has 3 months of beginner knowledge on python could do it, but yeah. Coding is coding, and I coded. :D RE: A Diffrent Approach at Socket in Python 3.x - Iceglade - 01-22-2014 I actually wrote a send method, however the functionality of priv msging is nice to have. Not very useful on ORE of course, but... (This post is only talking theoretically, I don't endorse the bots ) RE: A Diffrent Approach at Socket in Python 3.x - AFtExploision - 01-22-2014 imma aft. I made one of the first bots way back in le day. In the first wave of le bots. (IDK if there were any before me) what am I sayn idk RE: A Diffrent Approach at Socket in Python 3.x - xdot - 01-23-2014 (01-22-2014, 11:39 PM)AFtExploision Wrote: (IDK if there were any before me) >The actual ORE Bot |