Ricardo Garcia Gonzalez has published another tool for downloading videos from YouTube. youtube-dl is written in Python and a commandline script (day of the commandline tools today, ey?) (Thanks William Pramana for that link). Besides actually downloading the video, it also has an option for only printing the video's real URL on YouTube, so that you can start the download process with whatever download manager you like. The only disadvantage here is, that the script also prints some text alongside the actual URL, so it's not you usable for some piping action. Not all that hard to patch that.
Read more about "youtube-dl: Downloading with Python magic" ...Archive for [<Tag: python>]
-
youtube-dl: Downloading with Python magic
-
Explicitly splitting long lines in TextMate
Sometimes, when you're just in the flow of typing text (like for a paper) you might forget about some of the personal rules you set up on how you want your textfiles formated. I, for example, prefer it, when the length of each line isn't above 78 characters. I don't really want this an automatic method for formating source code files, but at least for some LaTeX/reST/Markdown texts this would be nice. But while TextMate offers a small command in the "Text" menu to unwrap paragraphs, I didn't find anything for actually splitting (and not just softwrapping) long lines.
Read more about "Explicitly splitting long lines in TextMate" ... -
Python 2.3.5
Yesterday Python 2.3.5 was released including a security fix for an issue with the SimpleXMLRPCServer. For details about this new release please check out python.org
Read more about "Python 2.3.5" ... -
Getting to know Twisted
Lately I've been in need for some simple client-server solutions that do specific jobs like transcoding a video using mencoder or simply adding an AVI container to a FLV videostream and MP3 audiostream. So I started taking a close look at the Twisted framework for Python ...
Read more about "Getting to know Twisted" ... -
Getting to VIM's Python interface
Scripting is usually one of the selling points for those types of text editors that are specifically targeted at power-users. But most of the time you have to learn a whole new scripting language to really be able to use it. Imagine my surprise when I noticed that VIM besides having it's own scripting language also let's you also write plugin in Perl, Python, Ruby and TCL. This way you don't really have to learn a new language for scripting VIM, although you might still want to look into it because there are a few problems.
Since I like Python quite a bit, the rest of this post will be mostly focused on the Python interface.
Read more about "Getting to VIM's Python interface" ... -
for-loop with index in Python
Everyday something new to learn :-) For quite some time now I'm coding mostly small scripts but also bigger stuff in Python (and now I'm also trying to get really into Django) and from time to time Python's for-each preference to the C-style for loops sometimes got a little bit in my way.
For example: I have a list and I want to iterate over it but also know where I am during this loop. So until today I would have gone this road:
data = ('a','b','c') i = 0 for f in data: print "%d => %s"%(i,f) i+=1
Read more about "for-loop with index in Python" ... -
CDDB access in Python
Today I played around with some modules and libraries and Python, so I want to use this as a starting point to fill the "Development" category here a little bit :-)
In the first ... let's call it a "Mini-Intro" I want to give a small introduction into Py-CDDB and how you can use it to get to know the CDDA in your CD-ROM driver better.
Read more about "CDDB access in Python" ... -
Accessing a MySQL DB in Python
And another small intro into a MySQL API. This time we want to fetch the phpbb_config table within a small Python script.
Read more about "Accessing a MySQL DB in Python" ... -
distutils and prefixes
I've tried to get around the whole distutils vs. setuptools issue ever since I started working with Python, but setuptools might have a big advantage on its list when it comes to distributing "complete" applications where I faced some problems with distutils recently.
Read more about "distutils and prefixes" ... -
Dynamically loading modules in Python
For a small fetch script I wanted to be able to simply put new modules into a certain directory and let the script use it at the text start. Python offers with the import(...) function a really nice tool for something like that. Here a small example:
Read more about "Dynamically loading modules in Python" ...