background preloader

Django & HTML5

Facebook Twitter

Python. Python - Implementing webbased real time video chat using HTML5 websockets. Eye Spot / Sending Messages to a HTML5 WebSocket from Python. I’ve been spending a lot of time trying to send a message from a Python Socket to a HTML5 WebSocket.

Eye Spot / Sending Messages to a HTML5 WebSocket from Python

Well I found that if I send back the message I get from the WebSocket, the browser receives it without any problem, but if I want to send a custom string, it’s necessary to manipulate it before calling the send function. Let’s see the code: data = s.recv(1024) s.send(data) The code above works perfectly, but it just return the same message. Now, let’s suppose that we want to return something different like a string saying what we’ve received: s.send("received:" + data) This works between Python Sockets, but not between a Python Socket and a HTML5 WebSocket because the last one never gets the message.

Msg = u"\x00received: %s\xff" % data.decode("utf-8", "ignore") s.send(msg) Now, your WebSocket will receive the message sent by the Python Socket. Hope this will be useful for someone else. Cheers. Développement Web, HTML5, CSS3, PHP, Python, Ruby, JQuery, Javascript... Python Html5 Web Framework. Python. How to Use Html5lib in Python. Programming Python, Android, HTML5 Applications 05/12. HTML5 - What is the Python angle (Kevin Gill) Tech Thursday – Python evolution, HTML5 image editor and the iPhone as a disk drive. YDN Blog Tech Thursday – Python evolution, HTML5 image editor and the iPhone as a disk drive By Chris Heilmann – Thu, Feb 4, 2010 3:04 PM EST Recommend0Tweet0 Every Thursday is Tech Thursday where we share a random assortment of technical links we found and liked.

Tech Thursday – Python evolution, HTML5 image editor and the iPhone as a disk drive

You can propose links to us on Twitter (@YDN) or try bookmarking them on delicious with the tag "forydntt". There are no comments yet Leave a comment... Post As Top contributor with high quality and engaging posts in the last 14 days. Learn more about this badge Recent Posts Latest Videos 1 - 2 of 2 prevnext More Upcoming Events More Follow Yahoo! HTML5 - What is the Python angle. Django - Mixing HTML5 Canvas and Python. Python Webkit DOM Bindings. The Python Webkit DOM Project makes python a full peer of javascript when it comes to accessing and manipulating the full features available to Webkit, such as HTML5.

Python Webkit DOM Bindings

Everything that can be done with javascript, such as getElementsbyTagName and appendChild, event callbacks through onclick, timeout callbacks through window.setTimeout, and even AJAX using XMLHttpRequest, can also be done from python. Why is this important - why is it a "big deal"? Browser engines are amongst the most powerful GUI engines available, with the world's top software organisations and corporations focussing a lot of effort into competing to be "the best". This competition results in some incredibly exciting developments... that are then restricted to being exclusively used from one of the world's most awkward and obtuse programming languages: javascript.

So the real question is: why should this state of affairs be tolerated? Van der Meer's new website done in Python and HTML5! Just redone my entire website, in Python and HTML5!

van der Meer's new website done in Python and HTML5!

I have been planning to do the rebuild quite some time. But then again, It has to come out of my free time, which basically means for me that simple stuff like this can take a year. A year it didn't take, but long enough though. I wrote my own python framework in the mean time, to get up running quickly (not). I focussed on porting my php framework (which is mostly Zend) to python. I decided I wanted to work with good ORM software, and chose SQLAlchemy for the job, great software! The use of those projects basically prevented me from using Python 3.1, which I would have loved instead of 2.6. And then html5! And the last few days I'm busy with getting ffmpeg to convert webm, h264 and ogg after eachother, without me having to recompile ffmpeg for another format first. Seeking Articles About HTML5 and Python. Because I wrote a book and am somewhat visible in the community, I often get requests to write articles, and many of those requests are not completely appropriate for me.

Seeking Articles About HTML5 and Python

For example, today I got an e-mail from Lukas Rakowski of Software Press, who makes PHP Solutions Magazine. Basically, they’re looking for articles about HTML5 and Python – neither of which are subjects I could author an article on (other than “I know HTML5 is all sorts of awesome” and “I’ve been meaning to script in Python more”). However, I know that there are many Mozillians that can write and can write about HTML5 and/or Python. To that end, here is the message I received: We are creating a new version of popular magazine PHP Solutions, which is available online.

If you are interested, please contact Lukas at lukasz dot rakowski at software.com.pl – I have no further information about this; I don’t know what benefits/compensation are involved, how frequently the new magazine will come out, etc. Offline HTML5 canvas app in Python with django-mediagenerator, Part 1: pyjs - Web development blog. This is the first part in a short series (see also part 2 and part 3) on building a simple client-side offline-capable HTML5 canvas drawing app in Python via Pyjamas/pyjs, using django-mediagenerator.

Offline HTML5 canvas app in Python with django-mediagenerator, Part 1: pyjs - Web development blog

Canvas drawing apps are the "Hello world" of the web apps world, so why not make it more interesting and throw in a few neat buzz word technologies? ;) In this part we'll take a look at running Python in the browser via pyjs, the Pyjamas framework's Python-to-JavaScript compiler. Note that we won't describe the Pyjamas framework, here. Instead, we only use the compiler itself and jQuery. Son propre TinyURL en Python et HTML5 avec webpy — Biologeek. Avec Twitter, la concision est de mise.

Son propre TinyURL en Python et HTML5 avec webpy — Biologeek

Tout le monde utilise des "raccourcisseurs" d'URL comme TinyURL ou Bit.ly mais ça pose plusieurs problèmes : vous n'avez aucune idée de la pérennité du service (et en ce moment on voit bien le problème des services gratuits et non rentables qui ferment) et aucune garantie que les liens seront toujours redirigés vers les bonnes destinations sans passer par une pub/un outil de traçabilité/insérez votre délire parano ici. J'ai enregistré hier bgk.me pour remédier à ça et avoir mon propre service de redirections courtes.

Ça prend une centaine de lignes en Python et c'est sous WTFPL, comme ce blog.