Useful video tutorials, because it doesn't use a simple XML document.
Showing posts with label python. Show all posts
XML attributes and node array using python minidom
Interesting tutorial.
Bleach: a new Python library
James Socol has released Bleach, a new Python library. As he says:
We’ve released another Python library: Bleach, for sanitizing HTML and automatically linking URLs in text, that we’re using on addons.mozilla.org and support.mozilla.com. It’s based on html5lib, which we chose because of its foundation in web standards and its active development community. Bleach is available on Github and PyPI.
Bleach uses a tree-walking approach to automatically link URLs that I think is pretty interesting. I wrote a short post outlining the method.
You can find more info at http://blog.mozilla.com/webdev/2010/02/25/new-python-library-bleach/.
Python Programming Tutorial - 32 - Object Oriented Program
Nice tutorial.
Socket Programming In Python
Check out this SlideShare Presentation:
Python Development (MongoSF)
Check out this SlideShare Presentation:
Django book
Just finished to download the online version of Django book, the most famous book on this great Python web framework. Django makes some common tasks trivial. For example, here's how this framework handles browser detection:
# GOOD (VERSION 1) def ua_display_good1(request): try: ua = request.META['HTTP_USER_AGENT'] except KeyError: ua = 'unknown' return HttpResponse("Your browser is %s" % ua) # GOOD (VERSION 2) def ua_display_good2(request): ua = request.META.get('HTTP_USER_AGENT', 'unknown') return HttpResponse("Your browser is %s" % ua)
Since Python is an object-oriented language, you can use this feature to access methods and properties, while in other languages you have to deal with superglobal arrays (just as PHP does). Using objects, on the other hand, is a more secure approach. For example, to sanitize user input, you need only one line of code in Python and Django! That's why I love Python and Django.
Python & Django: Fast and easy web application development
Check out this SlideShare Presentation:
Thinking Hybrid - Python/C++ Integration
The author says:
That’s exactly the thing that makes C/C++ so different from most other languages. It distinguishes between reference and value calls. Python does not know about these things. People have tried to resolve this problem by trying to guess which calling method is correct in a place. But as in the Zen of Python is already stated 'Explicit is better than implicit.' So we don’t want the system to guess as things can go terribly wrong. Therefore, so called 'calling policies' (mentioned on slide 32 in the flash animation here) have to be used to disambiguate in a way that the programmer wants.
Google Python Class
Interesting course.
Python design patterns
A great video from Alex Martelli, one of the authors of Python Cookbook.
Parse and print an XML file in Python
Useful video. By the way, I think that Python is even better than PHP when parsing XML files (don't blame me for that!).
Python tutorials
The only language where you have to write nicely indented code by default!