Yeah, I'm trying to hold out on gui stuff at the moment. I'm trying to get a grasp on classes and threads at the moment because nothing I've made to date in python really calls for anything outside of what a console can offer. Kinda keeping it simple for now I guess... I'll probably rebuild this application with a gui in the not-so-far future though.. would make a great starter for gui's project. (I'm pretty good in C# with gui's so I might just go with IronPython so I can use the windows libs for the interface controls, well see =D )
<br><br>As for the IRC style (as in I know I could just get a library, but I wouldn't really learn anything. I also know fairly well how IRC should act, so its a good model for my learning) project, I dont need to reinvent it, but basically a threaded multiuser experience would be cool... I'm also interested in programming the server (threaded project for more practice). My original trials with the code I posted for this thread where seperate client and server code, and I ran several threads so I could get multiple connections and print content to the server console from the client console, and then return fixed messages back, but I am not sure how I'd go about letting multiple users communicate to each other, or forward messages. Does this involve traversing threads? or sockets? or something else? Thanks. 
<br><br><div><span class="gmail_quote">On 11/9/06, <b class="gmail_sendername">Luke Paireepinart</b> &lt;<a href="mailto:rabidpoobear@gmail.com">rabidpoobear@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Chris Hengge wrote:<br>&gt; I write this little IM style client the other night based on some<br>&gt; sample socket and threading examples I found plus a little of my own<br>&gt; twist just to make it more interesting..<br>
&gt; I'd like some constructive peer review just to help me make sure I'm<br>&gt; doing this correctly / well.<br>&gt;<br>&gt; You can test it by connecting to localhost if you want to run the code<br>&gt; to help with review. One thing I'd like to know how to do is fix the
<br>&gt; output to the screen. Currently it interrupts typing when a message is<br>&gt; recieved which as I understand is because my typing a line is<br>&gt; basically letting the client thread sleep, and recieving a message
<br>&gt; triggers the server thread while I'm typing... Maybe there is some<br>&gt; sort of better thread management for this? Or is this just a limiting<br>&gt; factor since I'm playing in the console world? The other issue I have
<br>&gt; is when the other person types DSC to end their session, I should be<br>&gt; able to put the thread to sleep, or trash it or something so I dont<br>&gt; have to close the app to use it again. It also isn't going through the
<br>&gt; entire<br>&gt;<br>&gt; I was hoping to actually make something more like an IRC server /<br>&gt; client, but I'm not sure I've got this thing down well enough to try<br>&gt; that. Thanks!<br>Sorry, I'm too tired to read your code right now.
<br>A few things I'd like to point out...<br>yeah, it's tough to show output and get input in the same console<br>window.&nbsp;&nbsp;A simple TKInter gui would not be all that hard to put together.<br>Just a textbox and an entry widget.
<br>wouldn't even need a 'send' button if you just bind 'enter' to the send<br>command from the entry widget.<br><br>Also, IRC is not as complicated as you may think.&nbsp;&nbsp;The messages are all<br>in ascii.<br>Basically you just say
<br><br>import socket<br>sock = socket.socket()<br>sock.connect(('<a href="http://irc.freenode.net">irc.freenode.net</a>',6667))<br>sock.send(&quot;NICK Bob\r\n&quot;)<br>sock.send(&quot;USER Bob <a href="http://irc.freenode.net">
irc.freenode.net</a> bla :realname\r\n&quot;)<br>sock.send(&quot;JOIN #test\r\n&quot;)<br>sock.send(&quot;PRIVMSG #test HELLO!\r\n&quot;)<br>sock.send(&quot;LEAVE #test\r\n&quot;)<br></blockquote></div><br>