Type in the url of the icon file and load the image.
From this PeP: Adding a line that looks like: # This Python file uses the following encoding: utf-8 Is sufficient to avoid the no encoding declared; see http://www.python.org/peps/pep-0263.html for details error
Problem:Writing xml with unicode characters does not work, even with the encoding set to ‘utf-8’. Always results in something like UnicodeEncodeError(‘ascii’, u’kr\xf6se1989′, 2, 3, ‘ordinal not in range(128)’) Solution (from here):Use the codecs module and manually open the file in utf-8 mode for writing import codecsdoc.writexml(codecs.open(fname,’wb’,’utf-8′), encoding=’utf-8′)
From here: l=[1,2,3,4] placeholder= ‘?’ # Works For SQLite. placeholders= ‘, ‘.join(placeholder for dummy in l) #puts in len(l) ‘?’ marks, separated by ‘, ‘ query= ‘SELECT name FROM students WHERE id IN (%s)’ % placeholders cursor.execute(query, l)
Please see this bugzilla issue.In short: Test any bangla font you install using Mac OS X’s fontbook. Do not install any font that shows warnings or errors The only Bangla font that I found to work with Firefox and not crash it on Mac OS X is at onkur.
slarc uchicago Free bangla fonts (nongnu)
I’ve been happily using pysqlite to access my sqlite databases from python. Suddenly, I find, however, that there is a query that runs much, much slower in pysqlite than in apsw and the sqlite shell. I’ve filed a bug report but it looks like I’ll be switching to apsw until this thing gets resolved.
From a blog post here, I found out about Paperpile. I downloaded and ran it, but haven’t used it, since I use my own, but Paperpile has a nice clean look. Though there is GPL code of Paperpile on github, the main website seems to indicate the author has hopes of commercializing (and closing the… Read More Another open source reference manager : Paperpile
mencoder -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=1:vbitrate=375000:mbd=2:keyint=132:vqblur=1.0:cmp=2:subcmp=2:dia=2:mv0:last_pred=3 -oac copy -o /dev/null MVI_0052.AVImencoder -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=2:vbitrate=375000:mbd=2:keyint=132:vqblur=1.0:cmp=2:subcmp=2:dia=2:mv0:last_pred=3 -oac copy -o output.avi MVI_0052.AVI
From here, using only standard python modules: import zipfile, re docx = zipfile.ZipFile(‘/path/to/file/mydocument.docx’)content = docx.read(‘word/document.xml’)cleaned = re.sub(”,”,content)print cleaned But, if you want to mess around in more detail in the document, then we can use the python-docx module.
import discounta = discount.Markdown(”)a.get_html_content()–> Yields TypeErrorTypeError: ‘NoneType’ object is unsubscriptableShould return a blank. Found that markdown or markdown2 give comparable performance, so now no longer using discount.
adminer is a nice php based sqlite manager. I prefer the firefox plugin “sqlite manager” but it currently has a strange issue with FF5 that basically makes it unworkable, so I was looking for an alternative to tide me over. I really don’t want apache running all the time on my computer and don’t want… Read More Using adminer on Mac OS X
Problem: Bottlepy server exits when computer comes out of sleepSolution: Set “reloader” option to False.