2011 August
-
💬 Reply to :
Earlier today i was thinking of writing a python script to detect duplicate mp3s, you might want to try that. There are existing programs to do it, but they all seem terrible!
2010 October
-
In Python, say I have a string that contains the name of a class function that I know a particular object will have, how can I invoke it?
That is:
obj = MyClass() # this class has a method doStuff() func = "doStuff" # how to call obj.doStuff() using the func variable?
-
💬 Reply to :
Split your processing into multiple threads. Your particular i7 should be able to support up to 8 threads in parallel.
2010 June
-
Is there any Python library that allows me to parse an HTML document similar to what jQuery does?
i.e. I'd like to be able to use CSS selector syntax to grab an arbitrary set of nodes from the document, read their content/attributes, etc.
The only Python HTML parsing lib I've used before was BeautifulSoup, and even though it's fine I keep thinking it would be faster to do my parsing if I had jQuery syntax available. :D
2010 January
-
💬 Reply to :
urlpatterns = patterns('',
(r'^salaries/employee/$', list_detail.object_list, 'employee_info'), )The third item in the tuple needs to be a dictionary, not a string. Try removing the single quotes around employee_info:
urlpatterns = patterns('', (r'^salaries/employee/$', list_detail.object_list, employee_info), )
2009 December
-
💬 Reply to :
You will need a better editor than Notepad. With Notepad, use Save As..., and type "helloworld.py" in the dialog, including quotes so that the file extension is .py instead of .txt
-
💬 Reply to :
You can have an array of 3-item tuples.
arr = [ (1,2,3), (4,5,6), (7,8,9)] for (k, v, x) in arr: # do stuff