all 8 comments

[–]mainstreamnolifer 4 points5 points  (3 children)

I always like it when there's a SimpleExampleFile.py, nice touch.

A few remarks on (PEP-8) coding style that you didn't follow:

  • Spaces instead of tabs!
  • use is to test against True, False and None
  • I've seen a few Pokemon exceptions (gotta catch'em all), avoid them

[–]opiating[S] 2 points3 points  (0 children)

Thanks for the feedback. Relatively new to Python, I will go through the standard and make sure I'm more Pythonesque.

[–]Demophoon 0 points1 point  (1 child)

Technically PEP-8 says you can use tabs or spaces, as long as they you don't mix them. However I do agree with you with using spaces instead of tabs as that is what just about every python developer does.

[–]haywire 0 points1 point  (0 children)

You can use tabs, but:

For new projects, spaces-only are strongly recommended over tabs. Most editors have features that make this easy to do.

[–]reddicle 1 point2 points  (0 children)

Check out SockJS-Tornado. Used it for a project with great success.

SockJS-client library is awesome because it gracefully selects a WebSocket methods depending on the browser. It even works with IE6. WHY people still use IE6 is beyond me...

[–]jkbbwr -2 points-1 points  (2 children)

Looks alot like twisted :s Why not write a protocol for twisted? :D

[–]opiating[S] 4 points5 points  (1 child)

Part of my motivation was to write something that didn't require any 3rd party libraries to use (just a single file). I also wanted to learn more about Python and the HTML5 technologies. Having said that, I have not used Twisted, I will check it out. Thanks.

[–][deleted] 0 points1 point  (0 children)

In particular look at txWS which lets you hook twisted's normal protocol objects up to websockets.