All entries tagged python.
You can subscribe to an RSS feed of this list.
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!
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?
obj = MyClass() # this class has a method doStuff() func = "doStuff" # how to call obj.doStuff() using the func variable?
Split your processing into multiple threads. Your particular i7 should be able to support up to 8 threads in parallel.
Ask HN: How will it impact my webapp if it is written in Python instead of PHP.
One of the responses has a nice discussion on the state of python web frameworks.
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
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), )
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
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
Roy Tang is a:
- programmer, engineer, scientist, critic, gamer, dreamer, and kid-at-heart
- Frustrated writer and sketch artist
- Magic player on weekends
- Sometimes I stream video games.
- Software developer since 2003. If you’d like to work with me, take a look at my resume.
roytang.net is a personal site, an E/N site, and kind of a commonplace book; I post about a random assortment of topics that interest me including software development, Magic the Gathering, pop culture, gaming, and tech life. This site is perpetually under renovation.