title stringlengths 10 172 | question_id int64 469 40.1M | question_body stringlengths 22 48.2k | question_score int64 -44 5.52k | question_date stringlengths 20 20 | answer_id int64 497 40.1M | answer_body stringlengths 18 33.9k | answer_score int64 -38 8.38k | answer_date stringlengths 20 20 | tags listlengths 1 5 |
|---|---|---|---|---|---|---|---|---|---|
Embedded objects in MS Office documents using Python? | 1,559,709 | <p>How could I create embedded objects in an MS office document using Python? </p>
<p>I don't need anything fancy, just what one used to do in the first version of OLE: doing a copy-paste from my application into e.g. MS Word should give me an object embedded in the Word document, which I can then double-click to op... | 1 | 2009-10-13T11:43:31Z | 1,559,740 | <p>OLE compound documents enable users working within a single application to manipulate data written in various formats and derived from multiple sources. A compound document object is essentially a COM object that can be embedded in, or linked to, an existing document. As a COM object, a compound document object expo... | 1 | 2009-10-13T11:50:40Z | [
"python",
"windows",
"com",
"ms-office",
"ole"
] |
"undefined symbol: TLSv1_method" error when import psycopg2 | 1,560,066 | <p>I installed psycopg2 by "easy_install psycopg2" on CentOS 5.3, no error was reported, but when I tried "import psycopg2", I got :</p>
<pre><code>exceptions.ImportError: /usr/lib/python2.4/site-packages/psycopg2-2.0.9-py2.4-linux-i686.egg/psycopg2/_psycopg.so: undefined symbol: TLSv1_method
</code></pre>
<p>What mi... | 0 | 2009-10-13T12:57:20Z | 1,560,204 | <p>You might have to <code>yum install openssl</code>?</p>
| 1 | 2009-10-13T13:19:05Z | [
"python"
] |
Optparse library - callback action while storing arg | 1,560,092 | <p>My code:</p>
<pre><code>def main():
usage = "usage: %prog [options] arg"
parser = OptionParser(usage)
parser.add_option("-p", "--pending", action="callback", callback=pending, type="string", dest="test", help="View Pending Jobs")
(options, args) = parser.parse_args()
if x == 0:
print usage,... | 0 | 2009-10-13T13:00:29Z | 1,560,316 | <p>Ended up passing the argument to the function that is being called.</p>
| 0 | 2009-10-13T13:37:46Z | [
"python",
"ironpython",
"optparse"
] |
Optparse library - callback action while storing arg | 1,560,092 | <p>My code:</p>
<pre><code>def main():
usage = "usage: %prog [options] arg"
parser = OptionParser(usage)
parser.add_option("-p", "--pending", action="callback", callback=pending, type="string", dest="test", help="View Pending Jobs")
(options, args) = parser.parse_args()
if x == 0:
print usage,... | 0 | 2009-10-13T13:00:29Z | 1,560,544 | <p>The arguments are available through <em>sys.argv</em>.</p>
| 0 | 2009-10-13T14:20:29Z | [
"python",
"ironpython",
"optparse"
] |
What is a good example of an __eq__ method for a collection class? | 1,560,245 | <p>I'm working on a collection class that I want to create an <code>__eq__</code> method for. It's turning out to be more nuanced than I thought it would be and I've noticed several intricacies as far as how the built-in collection classes work.</p>
<p>What would really help me the most is a good example. Are there ... | 6 | 2009-10-13T13:26:53Z | 1,560,279 | <p>Parts are hard. Parts should be simple delegation.</p>
<pre><code>def __eq__( self, other ):
if len(self) != len(other):
# Can we continue? If so, what rule applies? Pad shorter? Truncate longer?
else:
return all( self[i] == other[i] for i in range(len(self)) )
</code></pre>
| 7 | 2009-10-13T13:31:03Z | [
"python",
"api",
"collections",
"equality"
] |
What is a good example of an __eq__ method for a collection class? | 1,560,245 | <p>I'm working on a collection class that I want to create an <code>__eq__</code> method for. It's turning out to be more nuanced than I thought it would be and I've noticed several intricacies as far as how the built-in collection classes work.</p>
<p>What would really help me the most is a good example. Are there ... | 6 | 2009-10-13T13:26:53Z | 1,569,134 | <p>Take a look at "collections.py". The latest version (from version control) implements an OrderedDict with an __eq__. There's also an __eq__ in sets.py</p>
| 1 | 2009-10-14T21:33:03Z | [
"python",
"api",
"collections",
"equality"
] |
How can I get the (x,y) values of the line that is ploted by a contour plot (matplotlib)? | 1,560,424 | <p>Is there an easy way to get the (x,y) values of a contour line that was plotted like this:</p>
<pre><code>import matplotlib.pyplot as plt
x = [1,2,3,4]
y = [1,2,3,4]
m = [[15,14,13,12],[14,12,10,8],[13,10,7,4],[12,8,4,0]]
cs = plt.contour(x,y,m, [9.5])
plt.show()
</code></pre>
<p>Cheers, Philipp</p>
| 11 | 2009-10-13T13:57:47Z | 1,560,735 | <p>Look at the collections property of the returned ContourSet. In particular the get_paths() method of the first collection returns paired points making up each line segment.</p>
<pre><code>cs.collections[0].get_paths()
</code></pre>
| 8 | 2009-10-13T14:52:11Z | [
"python",
"matplotlib",
"data-analysis"
] |
Equivalent of GetCursorPos() in Mac's Carbon | 1,560,472 | <p><b>Background</b>
We're porting our PythonOgre-based games to Mac, and the publishers demand ability for mouse to leave the window. On Windows, we're going around OIS (Object-oriented Input System) for the purposes of mouse control; that is, we don't let OIS keep the mouse captured inside window borders, and then tr... | 1 | 2009-10-13T14:07:08Z | 1,560,610 | <p>I believe that what you are looking for is GetMouse(). You can find an example in Apple's <a href="http://developer.apple.com/mac/library/samplecode/UIElementInspector/listing2.html" rel="nofollow">UIElementInspector sample code</a>. This is in Obj-C not Python, though.</p>
<p>EDIT: HIGetMousePosition() is the pref... | 1 | 2009-10-13T14:31:43Z | [
"python",
"osx",
"mouse",
"carbon"
] |
Histogram in matplotlib gets cropped at top | 1,560,734 | <p>I have a Python program that generates a histogram using matplotlib. The problem is that the images that are generated sometimes get cropped at the top. First, here's the relevant code excerpt, where <code>plt</code> is <code>matplotlib.pyplot</code> and <code>fig</code> is <code>matplotlib.figure</code>:</p>
<pr... | 1 | 2009-10-13T14:52:01Z | 1,560,816 | <p>File a bug report to the matplotlib's developers, and ask them to write a test case on it.</p>
<p>You should be able to set the y axis with the ylim function: is it what you are asking for? Can you show a screenshot of your problem?</p>
| 1 | 2009-10-13T15:02:52Z | [
"python",
"matplotlib",
"python-imaging-library"
] |
Python - Overwriting __getattribute__ for an instance? | 1,560,853 | <p>This one seems a bit tricky to me. Sometime ago I already managed to overwrite an instance's method with something like:</p>
<pre><code>def my_method(self, attr):
pass
instancemethod = type(self.method_to_overwrite)
self.method_to_overwrite = instancemethod(my_method, self, self.__class__)
</code></pre>
<p>wh... | 3 | 2009-10-13T15:08:50Z | 1,560,948 | <p>There are a couple of methods which you can't overwrite and <code>__getattribute__()</code> is one of them.</p>
| 3 | 2009-10-13T15:24:02Z | [
"python",
"django"
] |
Python - Overwriting __getattribute__ for an instance? | 1,560,853 | <p>This one seems a bit tricky to me. Sometime ago I already managed to overwrite an instance's method with something like:</p>
<pre><code>def my_method(self, attr):
pass
instancemethod = type(self.method_to_overwrite)
self.method_to_overwrite = instancemethod(my_method, self, self.__class__)
</code></pre>
<p>wh... | 3 | 2009-10-13T15:08:50Z | 1,560,957 | <p>I believe <em>method-wrapper</em> is a wrapper around a method written in C. </p>
| 1 | 2009-10-13T15:25:34Z | [
"python",
"django"
] |
Python - Overwriting __getattribute__ for an instance? | 1,560,853 | <p>This one seems a bit tricky to me. Sometime ago I already managed to overwrite an instance's method with something like:</p>
<pre><code>def my_method(self, attr):
pass
instancemethod = type(self.method_to_overwrite)
self.method_to_overwrite = instancemethod(my_method, self, self.__class__)
</code></pre>
<p>wh... | 3 | 2009-10-13T15:08:50Z | 1,561,244 | <p>You want to override the attribute lookup algorithm on an per instance basis? Without knowing why you are trying to do this, I would hazard a guess that there is a cleaner less convoluted way of doing what you need to do. If you really need to then as Aaron said, you'll need to install a redirecting <code>__getattri... | 5 | 2009-10-13T16:09:21Z | [
"python",
"django"
] |
Python - Overwriting __getattribute__ for an instance? | 1,560,853 | <p>This one seems a bit tricky to me. Sometime ago I already managed to overwrite an instance's method with something like:</p>
<pre><code>def my_method(self, attr):
pass
instancemethod = type(self.method_to_overwrite)
self.method_to_overwrite = instancemethod(my_method, self, self.__class__)
</code></pre>
<p>wh... | 3 | 2009-10-13T15:08:50Z | 1,562,632 | <p>You can't overwrite special methods at instance level. <a href="http://docs.python.org/reference/datamodel.html#new-style-special-lookup" rel="nofollow">For new-style classes, implicit invocations of special methods are only guaranteed to work correctly if defined on an objectâs type, not in the objectâs instanc... | 3 | 2009-10-13T20:06:17Z | [
"python",
"django"
] |
Playing sounds with python and changing their tone during playback? | 1,561,104 | <p>Is there a way to do this? Also, I need this to work with pygame, since I want audio in my game. I'm asking this because I didn't see any tone change function in pygame.. Anyone knows?</p>
<h3>Update:</h3>
<p>I need to do something like the noise of a car accelerating. I don't really know if it is timbre or tone.<... | 1 | 2009-10-13T15:44:54Z | 1,561,314 | <p>Well, it depends on how you're doing your sounds: I'm not sure if this is possible with pygame, but SDL (which pygame is based off of) lets you have a callback to retrieve data for the sound buffer, and it's possible to change the frequency of the sine wave (or whatever) to get different tones in the callback, given... | 1 | 2009-10-13T16:17:23Z | [
"python",
"pygame",
"pitch"
] |
Python Reverse Generator | 1,561,214 | <p>I'm looking for a way to reverse a generator object. I know how to reverse sequences:</p>
<pre><code>foo = imap(seq.__getitem__, xrange(len(seq)-1, -1, -1))
</code></pre>
<p>But is something similar possible with a generator as the input and a reversed generator as the output (len(seq) stays the same, so the value... | 8 | 2009-10-13T16:04:24Z | 1,561,275 | <p><code>reversed(list(input_generator))</code> is probably the easiest way.</p>
<p>There's no way to get a generator's values in "reverse" order without gathering all of them into a sequence first, because generating the second item could very well rely on the first having been generated.</p>
| 6 | 2009-10-13T16:13:18Z | [
"python",
"generator",
"reverse"
] |
Python Reverse Generator | 1,561,214 | <p>I'm looking for a way to reverse a generator object. I know how to reverse sequences:</p>
<pre><code>foo = imap(seq.__getitem__, xrange(len(seq)-1, -1, -1))
</code></pre>
<p>But is something similar possible with a generator as the input and a reversed generator as the output (len(seq) stays the same, so the value... | 8 | 2009-10-13T16:04:24Z | 1,561,276 | <p>You have to walk through the generator anyway to get the first item so you might as well make a list. Try</p>
<pre><code>reversed(list(g))
</code></pre>
<p>where <code>g</code> is a generator.</p>
<pre><code>reversed(tuple(g))
</code></pre>
<p>would work as well (I didn't check to see if there is a significant ... | 4 | 2009-10-13T16:13:19Z | [
"python",
"generator",
"reverse"
] |
Python Reverse Generator | 1,561,214 | <p>I'm looking for a way to reverse a generator object. I know how to reverse sequences:</p>
<pre><code>foo = imap(seq.__getitem__, xrange(len(seq)-1, -1, -1))
</code></pre>
<p>But is something similar possible with a generator as the input and a reversed generator as the output (len(seq) stays the same, so the value... | 8 | 2009-10-13T16:04:24Z | 1,561,303 | <p>You cannot reverse a generator in any generic way except by casting it to a sequence and creating an iterator from that. Later terms of a generator cannot necessarily be known until the earlier ones have been calculated. </p>
<p>Even worse, you can't know if your generator will ever hit a StopIteration exception u... | 15 | 2009-10-13T16:15:58Z | [
"python",
"generator",
"reverse"
] |
Structuring a program. Classes and functions in Python | 1,561,282 | <p>I'm writing a program that uses genetic techniques to evolve equations.
I want to be able to submit the function 'mainfunc' to the Parallel Python 'submit' function.
The function 'mainfunc' calls two or three methods defined in the Utility class.
They instantiate other classes and call various methods.
I think what ... | 3 | 2009-10-13T16:14:10Z | 1,561,414 | <p>It's fine to structure your program that way. A lot of command line utilities follow the same pattern:</p>
<pre><code>#imports, utilities, other functions
def main(arg):
#...
if __name__ == '__main__':
import sys
main(sys.argv[1])
</code></pre>
<p>That way you can call the <code>main</code> function ... | 3 | 2009-10-13T16:34:00Z | [
"python",
"parallel-python"
] |
Structuring a program. Classes and functions in Python | 1,561,282 | <p>I'm writing a program that uses genetic techniques to evolve equations.
I want to be able to submit the function 'mainfunc' to the Parallel Python 'submit' function.
The function 'mainfunc' calls two or three methods defined in the Utility class.
They instantiate other classes and call various methods.
I think what ... | 3 | 2009-10-13T16:14:10Z | 1,563,685 | <p>If you want all of the instances of <code>mainfunc</code> to use the same <code>KeySeq</code> object, you can use the default parameter value trick:</p>
<pre><code>def mainfunc(ks=KeySeq()):
key = ks.next()
</code></pre>
<p>As long as you don't actually pass in a value of <code>ks</code>, all calls to <code>mai... | 1 | 2009-10-14T00:26:26Z | [
"python",
"parallel-python"
] |
Structuring a program. Classes and functions in Python | 1,561,282 | <p>I'm writing a program that uses genetic techniques to evolve equations.
I want to be able to submit the function 'mainfunc' to the Parallel Python 'submit' function.
The function 'mainfunc' calls two or three methods defined in the Utility class.
They instantiate other classes and call various methods.
I think what ... | 3 | 2009-10-13T16:14:10Z | 1,577,206 | <p>Your concept of classes in Python is not sound I think. Perhaps, it would be a good idea to review the basics. This link will help.</p>
<p><a href="http://www.freenetpages.co.uk/hp/alan.gauld/tutclass.htm" rel="nofollow">Python Basics - Classes</a></p>
| 0 | 2009-10-16T10:01:41Z | [
"python",
"parallel-python"
] |
handling db connection on daemonize threads | 1,561,427 | <p>I have a problem handling database connections in a daemon I've been working on, I first connect to my postgres database with:</p>
<pre><code>try:
psycopg2.apilevel = '2.0'
psycopg2.threadsafety = 3
cnx = psycopg2.connect( "host='192.168.10.36' dbname='db' user='vas' password='vas'")
except Exception, e:
... | 0 | 2009-10-13T16:36:29Z | 1,562,521 | <p>Database handles don't survive across <code>fork()</code>. You'll need to open a new database handle in each subprocess, ie after you call <code>daemonize()</code> call <code>psycopg2.connect</code>.</p>
<p>I've not used postgres but I know this to be definitely true for MySQL.</p>
| 0 | 2009-10-13T19:46:51Z | [
"python",
"multithreading",
"psycopg2",
"daemons"
] |
How do you make a shared network file read-only using Python? | 1,561,482 | <p>Using Python, what's the correct way to set a file to be read-only when the file is located on a network share (being served from a Windows 2003 Server)?</p>
<p>I'm running Python 2.6.2 in OS X (10.6.1).</p>
<p>The following code throws an exception (as expected) when path is local, but <code>os.chmod</code> appea... | 0 | 2009-10-13T16:46:07Z | 1,561,614 | <p>I am pretty sure you must have the proper settings on your local SAMBA server (/etc/samba/smb.conf) to make this behave the way you intend. There is many ways to go around permission checking if smb.conf isn't set correctly.</p>
| 0 | 2009-10-13T17:07:14Z | [
"python"
] |
Performance difference on insert-sort in C and python | 1,561,596 | <p>I was curious about the performance of insert-sort using C and python but the results I've got just make me think if I've done something wrong. I suspected that C would be faster, but not that much.</p>
<p>I've profiled both codes and the insert-sort function is the place where the time is most spent.</p>
<p>Here ... | 0 | 2009-10-13T17:04:50Z | 1,561,644 | <p>What's wrong with:</p>
<pre><code>ln.sort()
</code></pre>
| -3 | 2009-10-13T17:12:09Z | [
"python",
"c",
"performance",
"profiling"
] |
Performance difference on insert-sort in C and python | 1,561,596 | <p>I was curious about the performance of insert-sort using C and python but the results I've got just make me think if I've done something wrong. I suspected that C would be faster, but not that much.</p>
<p>I've profiled both codes and the insert-sort function is the place where the time is most spent.</p>
<p>Here ... | 0 | 2009-10-13T17:04:50Z | 1,561,694 | <p>Python is a dynamic language and the standard implementation uses an interpreter to evaluate code. This means that where the compiled C code can escape with a single machine instruction, for instance assigning to vec->v[i+1], Python's interpreter has to look up the sequence variable from the local scope, look up its... | 13 | 2009-10-13T17:20:10Z | [
"python",
"c",
"performance",
"profiling"
] |
Performance difference on insert-sort in C and python | 1,561,596 | <p>I was curious about the performance of insert-sort using C and python but the results I've got just make me think if I've done something wrong. I suspected that C would be faster, but not that much.</p>
<p>I've profiled both codes and the insert-sort function is the place where the time is most spent.</p>
<p>Here ... | 0 | 2009-10-13T17:04:50Z | 1,562,714 | <p>What method did you use to measure the time?<br />
Doing this sort of thing, I find python is at least 30 times slower than C<br />
The C compiler may be able to use some optimisations that Python doesn't even attempt </p>
<p>If might be interesting to try psyco, that type of code is well suited to it.</p>
<p>bui... | 2 | 2009-10-13T20:25:19Z | [
"python",
"c",
"performance",
"profiling"
] |
Performance difference on insert-sort in C and python | 1,561,596 | <p>I was curious about the performance of insert-sort using C and python but the results I've got just make me think if I've done something wrong. I suspected that C would be faster, but not that much.</p>
<p>I've profiled both codes and the insert-sort function is the place where the time is most spent.</p>
<p>Here ... | 0 | 2009-10-13T17:04:50Z | 1,562,819 | <p>So, here are some lessons you should take away from this:</p>
<ul>
<li><p>Interpreted Python is on the slow side. Don't try to write your own FFT, MPEG encoder, etc. in Python.</p></li>
<li><p>Even slow interpreted Python is probably fast enough for small problems. An 8 second run time is not horrible, and it wou... | 4 | 2009-10-13T20:50:26Z | [
"python",
"c",
"performance",
"profiling"
] |
Performance difference on insert-sort in C and python | 1,561,596 | <p>I was curious about the performance of insert-sort using C and python but the results I've got just make me think if I've done something wrong. I suspected that C would be faster, but not that much.</p>
<p>I've profiled both codes and the insert-sort function is the place where the time is most spent.</p>
<p>Here ... | 0 | 2009-10-13T17:04:50Z | 1,564,061 | <p>My first thought was that the laptop I have at hand right now, a Macbook Pro, must be comparable to but slightly better than your machine -- I don't have enough of your surrounding code to try your C example (what's a vec_t, etc, etc), but running the Python you coded gives me:</p>
<pre><code>$ python -mtimeit -s'i... | 5 | 2009-10-14T03:13:19Z | [
"python",
"c",
"performance",
"profiling"
] |
Google wave robot inline reply | 1,561,655 | <p>I've been working on my first robot for google wave recently, a vital part of what it does is to insert inline replies into a blip. I can't for the life of me figure out how to do this!</p>
<p>The API docs have a function <a href="http://wave-robot-python-client.googlecode.com/svn/trunk/pydocs/waveapi.ops.OpBasedDo... | 5 | 2009-10-13T17:14:10Z | 1,582,481 | <p>It could be a possible <a href="http://code.google.com/p/google-wave-resources/issues/detail?id=212" rel="nofollow">bug</a>.</p>
| 2 | 2009-10-17T15:43:24Z | [
"python",
"google-wave"
] |
Google wave robot inline reply | 1,561,655 | <p>I've been working on my first robot for google wave recently, a vital part of what it does is to insert inline replies into a blip. I can't for the life of me figure out how to do this!</p>
<p>The API docs have a function <a href="http://wave-robot-python-client.googlecode.com/svn/trunk/pydocs/waveapi.ops.OpBasedDo... | 5 | 2009-10-13T17:14:10Z | 1,583,687 | <p>If you look at the <a href="http://wave-robot-python-client.googlecode.com/svn/trunk/pydocs/waveapi.ops-pysrc.html#OpBasedDocument.InsertInlineBlip" rel="nofollow">sourcecode</a> for <code>OpBasedDocument.InsertInlineBlip()</code> you will see the following:</p>
<pre><code> 412 - def InsertInlineBlip(self, positio... | 4 | 2009-10-18T01:16:36Z | [
"python",
"google-wave"
] |
Google wave robot inline reply | 1,561,655 | <p>I've been working on my first robot for google wave recently, a vital part of what it does is to insert inline replies into a blip. I can't for the life of me figure out how to do this!</p>
<p>The API docs have a function <a href="http://wave-robot-python-client.googlecode.com/svn/trunk/pydocs/waveapi.ops.OpBasedDo... | 5 | 2009-10-13T17:14:10Z | 1,649,036 | <p>This appears to have previously been a bug, however, an update today has hopefully fixed it:
<a href="http://code.google.com/p/google-wave-resources/wiki/WaveAPIsChangeLog" rel="nofollow">http://code.google.com/p/google-wave-resources/wiki/WaveAPIsChangeLog</a></p>
| 1 | 2009-10-30T10:32:15Z | [
"python",
"google-wave"
] |
View Windows file metadata in Python | 1,561,831 | <p>I am writing a script to email the owner of a file when a separate process has finished. I have tried:</p>
<pre><code>import os
FileInfo = os.stat("test.txt")
print (FileInfo.st_uid)
</code></pre>
<p>The output of this is the owner ID number. What I need is the Windows user name. </p>
| 0 | 2009-10-13T17:46:06Z | 1,562,035 | <p>I think the only chance you have is to use the <a href="https://sourceforge.net/projects/pywin32/" rel="nofollow">pywin32 extensions</a> and ask windows yourself.</p>
<p>Basically you <a href="http://msdn.microsoft.com/en-us/library/aa446629%28VS.85,loband%29.aspx" rel="nofollow">look on msdn how to do it in c++</a... | 2 | 2009-10-13T18:19:19Z | [
"python"
] |
View Windows file metadata in Python | 1,561,831 | <p>I am writing a script to email the owner of a file when a separate process has finished. I have tried:</p>
<pre><code>import os
FileInfo = os.stat("test.txt")
print (FileInfo.st_uid)
</code></pre>
<p>The output of this is the owner ID number. What I need is the Windows user name. </p>
| 0 | 2009-10-13T17:46:06Z | 1,562,137 | <p>Once I stopped searching for file meta data and started looking for file security I found exactly what I was looking for.</p>
<pre><code>import tempfile
import win32api
import win32con
import win32security
f = tempfile.NamedTemporaryFile ()
FILENAME = f.name
try:
sd = win32security.GetFileSecurity (FILENAME,win3... | 3 | 2009-10-13T18:37:45Z | [
"python"
] |
Retrieving and displaying UTF-8 from a .CSV in Python | 1,561,833 | <p>Basically I have been having real fun with this today. I have this data file called test.csv which is encoded as UTF-8:</p>
<p>"Nguyá»
n", 0.500
"Trần", 0.250
"Lê", 0.250</p>
<p>Now I am attempting to read it with this code and it displays all funny like this: Trần</p>
<p>Now I have gone through all the P... | 0 | 2009-10-13T17:46:41Z | 1,561,871 | <p>There's the unicode_csv_reader demo in the python docs:
<a href="http://docs.python.org/library/csv.html" rel="nofollow">http://docs.python.org/library/csv.html</a></p>
| -2 | 2009-10-13T17:51:41Z | [
"python",
"utf-8",
"csv"
] |
Retrieving and displaying UTF-8 from a .CSV in Python | 1,561,833 | <p>Basically I have been having real fun with this today. I have this data file called test.csv which is encoded as UTF-8:</p>
<p>"Nguyá»
n", 0.500
"Trần", 0.250
"Lê", 0.250</p>
<p>Now I am attempting to read it with this code and it displays all funny like this: Trần</p>
<p>Now I have gone through all the P... | 0 | 2009-10-13T17:46:41Z | 1,563,565 | <p>Your <em>current</em> problem is that you have been given a bum steer with the csv_unicode_reader thingy. As the name suggests, and as the documentation states explicitly: </p>
<p>"""(unicode_csv_reader() below is a generator that wraps csv.reader to handle Unicode CSV data (a list of Unicode strings). """</p>
<p>... | 1 | 2009-10-13T23:48:54Z | [
"python",
"utf-8",
"csv"
] |
Retrieving and displaying UTF-8 from a .CSV in Python | 1,561,833 | <p>Basically I have been having real fun with this today. I have this data file called test.csv which is encoded as UTF-8:</p>
<p>"Nguyá»
n", 0.500
"Trần", 0.250
"Lê", 0.250</p>
<p>Now I am attempting to read it with this code and it displays all funny like this: Trần</p>
<p>Now I have gone through all the P... | 0 | 2009-10-13T17:46:41Z | 1,563,916 | <p><code>unicode_csv_reader(open(familynamelist))</code> is trying to pass non-unicode data (byte strings with utf-8 encoding) to a function you wrote expecting unicode data. You could solve the problem with codecs.open (from standard library module codecs), but that's to roundabout: the codecs would be doing utf8->un... | 2 | 2009-10-14T02:07:28Z | [
"python",
"utf-8",
"csv"
] |
A good data model for finding a user's favorite stories | 1,562,131 | <h2>Original Design</h2>
<p>Here's how I originally had my <code>Models</code> set up:</p>
<pre><code>class UserData(db.Model):
user = db.UserProperty()
favorites = db.ListProperty(db.Key) # list of story keys
# ...
class Story(db.Model):
title = db.StringProperty()
# ...
</code></pre>
<p>On eve... | 4 | 2009-10-13T18:36:46Z | 1,562,372 | <p>I don't want to tackle your actual question, but here's a very small tip: you can replace this code:</p>
<pre><code>if story in user_data.favorites:
story_is_favorited = True
else:
story_is_favorited = False
</code></pre>
<p>with this single line:</p>
<pre><code>story_is_favorited = (story in user_data.fa... | 1 | 2009-10-13T19:20:41Z | [
"python",
"google-app-engine",
"gae-datastore"
] |
A good data model for finding a user's favorite stories | 1,562,131 | <h2>Original Design</h2>
<p>Here's how I originally had my <code>Models</code> set up:</p>
<pre><code>class UserData(db.Model):
user = db.UserProperty()
favorites = db.ListProperty(db.Key) # list of story keys
# ...
class Story(db.Model):
title = db.StringProperty()
# ...
</code></pre>
<p>On eve... | 4 | 2009-10-13T18:36:46Z | 1,562,614 | <p>What you've described is a good solution. You can optimise it further, however: For each favorite, create a 'UserFavorite' entity as a child entity of the relevant Story entry (or equivalently, as a child entity of a UserInfo entry), with the key name set to the user's unique ID. This way, you can determine if a use... | 2 | 2009-10-13T20:04:12Z | [
"python",
"google-app-engine",
"gae-datastore"
] |
A good data model for finding a user's favorite stories | 1,562,131 | <h2>Original Design</h2>
<p>Here's how I originally had my <code>Models</code> set up:</p>
<pre><code>class UserData(db.Model):
user = db.UserProperty()
favorites = db.ListProperty(db.Key) # list of story keys
# ...
class Story(db.Model):
title = db.StringProperty()
# ...
</code></pre>
<p>On eve... | 4 | 2009-10-13T18:36:46Z | 1,562,643 | <p>You can make the favorite index like a join on the two models</p>
<pre><code>class FavoriteIndex(db.Model):
user = db.UserProperty()
story = db.ReferenceProperty()
</code></pre>
<p>or</p>
<pre><code>class FavoriteIndex(db.Model):
user = db.UserProperty()
story = db.StringListProperty()
</code></pr... | 1 | 2009-10-13T20:08:28Z | [
"python",
"google-app-engine",
"gae-datastore"
] |
A good data model for finding a user's favorite stories | 1,562,131 | <h2>Original Design</h2>
<p>Here's how I originally had my <code>Models</code> set up:</p>
<pre><code>class UserData(db.Model):
user = db.UserProperty()
favorites = db.ListProperty(db.Key) # list of story keys
# ...
class Story(db.Model):
title = db.StringProperty()
# ...
</code></pre>
<p>On eve... | 4 | 2009-10-13T18:36:46Z | 1,589,364 | <p>With your new Design you can lookup if a user has favorited a certain story with a query.<br />
You don't need the UserFavorite class entities.<br />
It is a keys_only query so not as fast as a get(key) but faster then a normal query.<br />
The FavoriteIndex classes all have the same key_name='favs'.<br />
You can f... | 1 | 2009-10-19T15:27:48Z | [
"python",
"google-app-engine",
"gae-datastore"
] |
Python MySQL installing wrongly on Mac OS X 10.6 i386 | 1,562,314 | <p>When trying to install MySQL's python bindings, MySQLdb, I followed the instructions to build and install on my MacBook running Mac OS X 10.6 i386, and after entering the following line into the terminal:</p>
<pre><code>user-152-3-158-79:MySQL-python-1.2.3c1 jianweigan$ sudo python setup.py build
</code></pre>
<p>... | 2 | 2009-10-13T19:09:36Z | 1,562,361 | <p>Well the error is pretty clear, do you have xcode installed? <a href="http://developer.apple.com/tools/Xcode/" rel="nofollow">http://developer.apple.com/tools/Xcode/</a></p>
<p>You can look at a more detailed solution to this in <a href="http://blog.some-abstract-type.com/2009/09/mysql-python-and-mac-os-x-106-snow.... | -1 | 2009-10-13T19:19:40Z | [
"python",
"mysql",
"osx"
] |
Python MySQL installing wrongly on Mac OS X 10.6 i386 | 1,562,314 | <p>When trying to install MySQL's python bindings, MySQLdb, I followed the instructions to build and install on my MacBook running Mac OS X 10.6 i386, and after entering the following line into the terminal:</p>
<pre><code>user-152-3-158-79:MySQL-python-1.2.3c1 jianweigan$ sudo python setup.py build
</code></pre>
<p>... | 2 | 2009-10-13T19:09:36Z | 1,562,456 | <p>It appears you have installed and are using a python.org python2.6. Because that installer is designed to work for a range of systems, to build extensions with that python on 10.6, you need to install the optional 10.4 SDK which is part of the Xcode package on the Snow Leopard installation DVD or machine restore DV... | 9 | 2009-10-13T19:34:22Z | [
"python",
"mysql",
"osx"
] |
Python MySQL installing wrongly on Mac OS X 10.6 i386 | 1,562,314 | <p>When trying to install MySQL's python bindings, MySQLdb, I followed the instructions to build and install on my MacBook running Mac OS X 10.6 i386, and after entering the following line into the terminal:</p>
<pre><code>user-152-3-158-79:MySQL-python-1.2.3c1 jianweigan$ sudo python setup.py build
</code></pre>
<p>... | 2 | 2009-10-13T19:09:36Z | 7,658,425 | <p>Installing the latest version of Python from python.org, fixed this problem for me.</p>
| 1 | 2011-10-05T08:11:29Z | [
"python",
"mysql",
"osx"
] |
Could use some help with this soundex coding | 1,562,438 | <p>The US census bureau uses a special encoding called âsoundexâ to locate information about a person. The soundex is an encoding of surnames (last names) based on the way a surname sounds rather than the way it is spelled. Surnames that sound the same, but are spelled differently, like SMITH and SMYTH, have the sa... | 2 | 2009-10-13T19:31:28Z | 1,562,493 | <p>A few hints:</p>
<ul>
<li><p>By using an array where each Soundex code is stored and indexed by the ASCII value (or a value in a shorter numeric range derived thereof) of the letter it corresponds to, you will both make the code for efficient and more readable. This is <strong>a very common technique</strong>: unde... | 0 | 2009-10-13T19:41:01Z | [
"python",
"soundex"
] |
Could use some help with this soundex coding | 1,562,438 | <p>The US census bureau uses a special encoding called âsoundexâ to locate information about a person. The soundex is an encoding of surnames (last names) based on the way a surname sounds rather than the way it is spelled. Surnames that sound the same, but are spelled differently, like SMITH and SMYTH, have the sa... | 2 | 2009-10-13T19:31:28Z | 1,562,597 | <p>Here are some small hints on general Python stuff.</p>
<p>0) You can use a for loop to loop over any sequence, and a string counts as a sequence. So you can write:</p>
<pre><code>for nextletter in surname[1:]:
# do stuff
</code></pre>
<p>This is easier to write and easier to understand than computing an inde... | 0 | 2009-10-13T20:01:38Z | [
"python",
"soundex"
] |
How to encrypt text into a image using python | 1,562,664 | <p>I was wondering how can someone use python to encrypt text into an image.</p>
| 0 | 2009-10-13T20:12:33Z | 1,562,674 | <p>Google search for "python steganography" and you find some stuff.</p>
<p>Here's a Python library module: <a href="http://domnit.org/stepic/doc/" rel="nofollow">stepic</a></p>
| 7 | 2009-10-13T20:15:31Z | [
"python",
"steganography"
] |
How to encrypt text into a image using python | 1,562,664 | <p>I was wondering how can someone use python to encrypt text into an image.</p>
| 0 | 2009-10-13T20:12:33Z | 1,567,877 | <p>This issue has need the type of file . Some image has special has place for description. You can use this with an encripted string. All you need is to write python script to read this places and decrypt it.</p>
| -1 | 2009-10-14T17:44:14Z | [
"python",
"steganography"
] |
Can Python print a function definition? | 1,562,759 | <p>In JavaScript, one can print out the definition of a function. Is there a way to accomplish this in Python? </p>
<p>(Just playing around in interactive mode, and I wanted to read a module without open(). I was just curious). </p>
| 37 | 2009-10-13T20:33:35Z | 1,562,772 | <p>If you're using <a href="http://ipython.org/" rel="nofollow" title="ipython homepage">iPython</a>, you can use <strong><code>function_name?</code></strong> to get help, and <strong><code>function_name??</code></strong> will print out the source, if it can.</p>
| 32 | 2009-10-13T20:35:55Z | [
"python"
] |
Can Python print a function definition? | 1,562,759 | <p>In JavaScript, one can print out the definition of a function. Is there a way to accomplish this in Python? </p>
<p>(Just playing around in interactive mode, and I wanted to read a module without open(). I was just curious). </p>
| 37 | 2009-10-13T20:33:35Z | 1,562,795 | <p>If you are importing the function, you can use <a href="http://docs.python.org/library/inspect.html#inspect.getsource"><code>inspect.getsource</code></a>:</p>
<pre><code>>>> import re
>>> import inspect
>>> print inspect.getsource(re.compile)
def compile(pattern, flags=0):
"Compile a ... | 53 | 2009-10-13T20:41:18Z | [
"python"
] |
Can Python print a function definition? | 1,562,759 | <p>In JavaScript, one can print out the definition of a function. Is there a way to accomplish this in Python? </p>
<p>(Just playing around in interactive mode, and I wanted to read a module without open(). I was just curious). </p>
| 37 | 2009-10-13T20:33:35Z | 1,562,798 | <p>You can use the __doc__ keyword:</p>
<pre><code>#print the class description
print string.__doc__
#print function description
print open.__doc__
</code></pre>
| 0 | 2009-10-13T20:41:42Z | [
"python"
] |
Can Python print a function definition? | 1,562,759 | <p>In JavaScript, one can print out the definition of a function. Is there a way to accomplish this in Python? </p>
<p>(Just playing around in interactive mode, and I wanted to read a module without open(). I was just curious). </p>
| 37 | 2009-10-13T20:33:35Z | 1,564,151 | <p>Take a look at <code>help()</code> function from <code>pydoc</code> module. In interactive mode it should be already imported for you, so just type <code>help(funtion_to_describe)</code>. For more capabilities use <a href="http://ipython.scipy.org/" rel="nofollow">IPython</a>.</p>
| 1 | 2009-10-14T03:53:07Z | [
"python"
] |
Can Python print a function definition? | 1,562,759 | <p>In JavaScript, one can print out the definition of a function. Is there a way to accomplish this in Python? </p>
<p>(Just playing around in interactive mode, and I wanted to read a module without open(). I was just curious). </p>
| 37 | 2009-10-13T20:33:35Z | 27,458,391 | <p>While I'd generally agree that <code>inspect</code> is a good answer, I'd disagree that you can't get the source code of objects defined in the interpreter. If you use <code>dill.source.getsource</code> from <a href="https://github.com/uqfoundation/dill" rel="nofollow"><code>dill</code></a>, you can get the source ... | 4 | 2014-12-13T11:41:58Z | [
"python"
] |
What possibilities exist to build an installer for a windows application on Linux (install target=windows, build environment=Linux) | 1,562,999 | <p>After playing around with NSIS (Nullsoft Scriptable Installation System) for a few days, I really feel the pain it's use brings me. No wonder, the authors claim it's scripting implementation is a "mixture of PHP and Assembly".</p>
<p>So, I hope there is something better to write installation procedures to get Windo... | 2 | 2009-10-13T21:26:51Z | 1,563,032 | <p>You might try looking at <a href="http://www.flexerasoftware.com/products/installanywhere.htm" rel="nofollow">InstallAnywhere</a>, but it may require Java.</p>
| 0 | 2009-10-13T21:34:13Z | [
"python",
"windows",
"linux",
"installer"
] |
What possibilities exist to build an installer for a windows application on Linux (install target=windows, build environment=Linux) | 1,562,999 | <p>After playing around with NSIS (Nullsoft Scriptable Installation System) for a few days, I really feel the pain it's use brings me. No wonder, the authors claim it's scripting implementation is a "mixture of PHP and Assembly".</p>
<p>So, I hope there is something better to write installation procedures to get Windo... | 2 | 2009-10-13T21:26:51Z | 1,564,460 | <p>You may be interested by <a href="http://installbuilder.bitrock.com/index.html" rel="nofollow">BitRock</a></p>
| 2 | 2009-10-14T05:49:10Z | [
"python",
"windows",
"linux",
"installer"
] |
What possibilities exist to build an installer for a windows application on Linux (install target=windows, build environment=Linux) | 1,562,999 | <p>After playing around with NSIS (Nullsoft Scriptable Installation System) for a few days, I really feel the pain it's use brings me. No wonder, the authors claim it's scripting implementation is a "mixture of PHP and Assembly".</p>
<p>So, I hope there is something better to write installation procedures to get Windo... | 2 | 2009-10-13T21:26:51Z | 1,572,176 | <p>Try running <a href="http://www.jrsoftware.org/isinfo.php" rel="nofollow">InnoSetup</a> under <a href="http://www.winehq.org/" rel="nofollow">Wine</a>. It should work unless you have some very specific needs. InnoSetup is open source, BTW.</p>
| 0 | 2009-10-15T12:52:50Z | [
"python",
"windows",
"linux",
"installer"
] |
What possibilities exist to build an installer for a windows application on Linux (install target=windows, build environment=Linux) | 1,562,999 | <p>After playing around with NSIS (Nullsoft Scriptable Installation System) for a few days, I really feel the pain it's use brings me. No wonder, the authors claim it's scripting implementation is a "mixture of PHP and Assembly".</p>
<p>So, I hope there is something better to write installation procedures to get Windo... | 2 | 2009-10-13T21:26:51Z | 3,513,568 | <p>It seems that <a href="http://pyinstaller.python-hosting.com/" rel="nofollow">pyinstaller</a> might do the trick. I'm also looking for something like what you need. I have not tried it yet ...</p>
| 0 | 2010-08-18T15:09:45Z | [
"python",
"windows",
"linux",
"installer"
] |
URLs stored in database for Django site | 1,563,088 | <p>I've produced a few Django sites but up until now I have been mapping individual views and URLs in urls.py.</p>
<p>Now I've tried to create a small custom CMS but I'm having trouble with the URLs. I have a database table (SQLite3) which contains code for the pages like a column for header, one for right menu, one f... | 0 | 2009-10-13T21:43:48Z | 1,563,359 | <p>Your question is a little bit twisted, but I think what you're asking for is something similar to how django.contrib.flatpages handles this. Basically it uses middleware to catch the 404 error and then looks to see if any of the flatpages have a URL field that matches.</p>
<p>We did this on one site where all of th... | 1 | 2009-10-13T22:42:30Z | [
"python",
"database",
"django",
"url",
"content-management-system"
] |
URLs stored in database for Django site | 1,563,088 | <p>I've produced a few Django sites but up until now I have been mapping individual views and URLs in urls.py.</p>
<p>Now I've tried to create a small custom CMS but I'm having trouble with the URLs. I have a database table (SQLite3) which contains code for the pages like a column for header, one for right menu, one f... | 0 | 2009-10-13T21:43:48Z | 1,563,592 | <p>You dont have to to it in the flatpage-way</p>
<p>For models, that should be addressable, I do this:</p>
<p>In urls.py I have a url-mapping like</p>
<pre><code> url(r'(?P<slug>[a-z1-3_]{1,})/$','cms.views.category_view', name="category-view")
</code></pre>
<p>in this case the regular expression <code>(?P&... | 5 | 2009-10-13T23:55:20Z | [
"python",
"database",
"django",
"url",
"content-management-system"
] |
What pure Python library should I use to scrape a website? | 1,563,165 | <p>I currently have some Ruby code used to scrape some websites. I was using Ruby because at the time I was using Ruby on Rails for a site, and it just made sense.</p>
<p>Now I'm trying to port this over to Google App Engine, and keep getting stuck.</p>
<p>I've ported Python Mechanize to work with Google App Engine,... | 2 | 2009-10-13T21:58:03Z | 1,563,177 | <p>Beautiful Soup.</p>
| 11 | 2009-10-13T22:01:06Z | [
"python",
"google-app-engine",
"xpath",
"beautifulsoup",
"mechanize"
] |
What pure Python library should I use to scrape a website? | 1,563,165 | <p>I currently have some Ruby code used to scrape some websites. I was using Ruby because at the time I was using Ruby on Rails for a site, and it just made sense.</p>
<p>Now I'm trying to port this over to Google App Engine, and keep getting stuck.</p>
<p>I've ported Python Mechanize to work with Google App Engine,... | 2 | 2009-10-13T21:58:03Z | 1,563,301 | <p>lxml -- 100x better than elementtree</p>
| 6 | 2009-10-13T22:28:18Z | [
"python",
"google-app-engine",
"xpath",
"beautifulsoup",
"mechanize"
] |
What pure Python library should I use to scrape a website? | 1,563,165 | <p>I currently have some Ruby code used to scrape some websites. I was using Ruby because at the time I was using Ruby on Rails for a site, and it just made sense.</p>
<p>Now I'm trying to port this over to Google App Engine, and keep getting stuck.</p>
<p>I've ported Python Mechanize to work with Google App Engine,... | 2 | 2009-10-13T21:58:03Z | 1,563,302 | <p>There's also <a href="http://scrapy.org/" rel="nofollow">scrapy</a>, might be more up your alley.</p>
| 4 | 2009-10-13T22:29:49Z | [
"python",
"google-app-engine",
"xpath",
"beautifulsoup",
"mechanize"
] |
What pure Python library should I use to scrape a website? | 1,563,165 | <p>I currently have some Ruby code used to scrape some websites. I was using Ruby because at the time I was using Ruby on Rails for a site, and it just made sense.</p>
<p>Now I'm trying to port this over to Google App Engine, and keep getting stuck.</p>
<p>I've ported Python Mechanize to work with Google App Engine,... | 2 | 2009-10-13T21:58:03Z | 1,563,437 | <p>There are a number of examples of web page scrapers written using <a href="http://pyparsing.wikispaces.com" rel="nofollow">pyparsing</a>, such as <a href="http://pyparsing.wikispaces.com/file/view/urlExtractorNew.py" rel="nofollow">this one</a> (extracts all URL links from yahoo.com) and <a href="http://pyparsing.wi... | 0 | 2009-10-13T23:01:53Z | [
"python",
"google-app-engine",
"xpath",
"beautifulsoup",
"mechanize"
] |
What pure Python library should I use to scrape a website? | 1,563,165 | <p>I currently have some Ruby code used to scrape some websites. I was using Ruby because at the time I was using Ruby on Rails for a site, and it just made sense.</p>
<p>Now I'm trying to port this over to Google App Engine, and keep getting stuck.</p>
<p>I've ported Python Mechanize to work with Google App Engine,... | 2 | 2009-10-13T21:58:03Z | 1,793,897 | <p><a href="http://www.crummy.com/software/BeautifulSoup/" rel="nofollow">BeautifulSoup</a> is good, but its API is awkward. Try <a href="http://effbot.org/zone/element-soup.htm" rel="nofollow">ElementSoup</a>, which provides an ElementTree interface to BeautifulSoup. </p>
| 0 | 2009-11-25T00:18:51Z | [
"python",
"google-app-engine",
"xpath",
"beautifulsoup",
"mechanize"
] |
How does the Jinja2 "recursive" tag actually work? | 1,563,276 | <p>I'm trying to write a very simple, tree-walking template in jinja2, using some custom objects with overloaded special methods (getattr, getitem, etc) It seems straightforward, and the equivalent python walk of the tree works fine, but there's something about the way that Jinja's recursion works that I don't underst... | 8 | 2009-10-13T22:21:37Z | 1,565,090 | <p>As I see from your code you understand recursive correctly, except one thing: it does replace iterable in the for statement, but doesn't update variable (<code>category</code> in your code) originally used in it. Thus, you nested loop iterates through children, but <code>set</code> tag lookups in original <code>cate... | 7 | 2009-10-14T08:56:56Z | [
"python",
"recursion",
"templates",
"jinja2"
] |
What is an "app" in Django? | 1,563,457 | <p>According to <a href="http://docs.djangoproject.com/en/dev/intro/tutorial01/#id3">the documentation</a>:</p>
<blockquote>
<p>An app is a Web application that does
something -- e.g., a weblog system, a
database of public records or a simple
poll app. A project is a collection of
configuration and apps for ... | 11 | 2009-10-13T23:09:56Z | 1,563,466 | <p>User management could very well be an app, if you are not going to use Django's built in user framework.</p>
<p>It has user interfaces and defined models for stored data, and it is really separate from the Blog or the Wiki application (although the information will be shared).</p>
<p>As long as both applications a... | 2 | 2009-10-13T23:14:34Z | [
"python",
"django"
] |
What is an "app" in Django? | 1,563,457 | <p>According to <a href="http://docs.djangoproject.com/en/dev/intro/tutorial01/#id3">the documentation</a>:</p>
<blockquote>
<p>An app is a Web application that does
something -- e.g., a weblog system, a
database of public records or a simple
poll app. A project is a collection of
configuration and apps for ... | 11 | 2009-10-13T23:09:56Z | 1,563,500 | <p>What makes an app (for us) is one thing:</p>
<p><strong>An App Is The Unit Of Reuse</strong></p>
<p>If we might want to split it off to use somewhere else, it's an app. </p>
<p>If it has a reusable data model, it's an app. User Profiles: App. Customers: App. Customer Statistical History (this is hard to expla... | 12 | 2009-10-13T23:24:30Z | [
"python",
"django"
] |
What is an "app" in Django? | 1,563,457 | <p>According to <a href="http://docs.djangoproject.com/en/dev/intro/tutorial01/#id3">the documentation</a>:</p>
<blockquote>
<p>An app is a Web application that does
something -- e.g., a weblog system, a
database of public records or a simple
poll app. A project is a collection of
configuration and apps for ... | 11 | 2009-10-13T23:09:56Z | 1,566,404 | <p>Django apps are bundles of reusable functionality. When starting off it's easy to just use one custom app for your project, but the "Django way" is to break it up into separate apps that each only do one thing. You can take a look at django.contrib for examples of really well made reusable apps.</p>
<p>A recent exa... | 4 | 2009-10-14T13:58:59Z | [
"python",
"django"
] |
Python library/framework to write an application that sends emails periodically | 1,563,468 | <p>I am considering to write an application that would covert the comments in reddit threads (<a href="http://www.reddit.com/r/Python/comments/9tebz/pje%5Fis%5Fabout%5Fto%5Fmake%5Fa%5Fnew%5Frelease%5Fof%5Fsetuptools/" rel="nofollow">example</a>) to emails. The idea is to parse the reddit json data (<a href="http://www.... | 0 | 2009-10-13T23:14:46Z | 1,563,508 | <p>I've used <a href="http://flexget.com/" rel="nofollow">Flexget</a> to parse RSS feeds and email them.
You can get ideas from there.</p>
| 0 | 2009-10-13T23:28:52Z | [
"python",
"email",
"frameworks",
"reddit"
] |
Python library/framework to write an application that sends emails periodically | 1,563,468 | <p>I am considering to write an application that would covert the comments in reddit threads (<a href="http://www.reddit.com/r/Python/comments/9tebz/pje%5Fis%5Fabout%5Fto%5Fmake%5Fa%5Fnew%5Frelease%5Fof%5Fsetuptools/" rel="nofollow">example</a>) to emails. The idea is to parse the reddit json data (<a href="http://www.... | 0 | 2009-10-13T23:14:46Z | 1,563,561 | <p>I would go with AppEngine to tackle this: integrated cron + email support.</p>
| 1 | 2009-10-13T23:46:25Z | [
"python",
"email",
"frameworks",
"reddit"
] |
Python library/framework to write an application that sends emails periodically | 1,563,468 | <p>I am considering to write an application that would covert the comments in reddit threads (<a href="http://www.reddit.com/r/Python/comments/9tebz/pje%5Fis%5Fabout%5Fto%5Fmake%5Fa%5Fnew%5Frelease%5Fof%5Fsetuptools/" rel="nofollow">example</a>) to emails. The idea is to parse the reddit json data (<a href="http://www.... | 0 | 2009-10-13T23:14:46Z | 1,563,629 | <p><a href="http://lamsonproject.org/" rel="nofollow">Lamson</a> aims to be an 'email app framework' (taking after the recent developments in web app frameworks). It seems like it would be a good fit for the problem you describe.</p>
| 0 | 2009-10-14T00:07:27Z | [
"python",
"email",
"frameworks",
"reddit"
] |
Sending a file with OBEX push in Python | 1,563,488 | <p>How to send a file using OBEX push to a device, which has an open OBEX port in Python? In my case it is a Bluetooth device.</p>
| 3 | 2009-10-13T23:21:04Z | 1,563,545 | <p>There is an "<a href="http://packages.debian.org/lenny/obex-data-server" rel="nofollow">OBEX data server</a>" DEBIAN package with DBus interface which could help you. Accessing DBus through Python is fairly easy.</p>
| 0 | 2009-10-13T23:41:21Z | [
"python",
"bluetooth",
"obex"
] |
Sending a file with OBEX push in Python | 1,563,488 | <p>How to send a file using OBEX push to a device, which has an open OBEX port in Python? In my case it is a Bluetooth device.</p>
| 3 | 2009-10-13T23:21:04Z | 1,595,353 | <p>Try <a href="http://lightblue.sourceforge.net/" rel="nofollow">http://lightblue.sourceforge.net/</a></p>
<p>The documentation for the OBEX client is here: <a href="http://lightblue.sourceforge.net/doc/lightblue.obex-OBEXClient.html" rel="nofollow">http://lightblue.sourceforge.net/doc/lightblue.obex-OBEXClient.html<... | 0 | 2009-10-20T15:13:10Z | [
"python",
"bluetooth",
"obex"
] |
Naming convention for actually choosing the words in Python, PEP8 compliant | 1,563,673 | <p>Iâm looking for a better way to name everything in Python. Yes, Iâve read <a href="http://www.python.org/dev/peps/pep-0008/" rel="nofollow">PEP8</a>, <a href="http://www.joelonsoftware.com/articles/Wrong.html" rel="nofollow">Spolskyâs wonderful rant</a>, and various other articles. But Iâm looking for more... | 3 | 2009-10-14T00:21:52Z | 1,563,890 | <p>The universe is multi-dimensional.</p>
<p>You have at least two dimensions to each variable name.</p>
<p>"Total", "Count", "Of Columns", "In a Table"</p>
<p>"Current", "Index", "", "Of a Column"</p>
<p>"Current", "Column", "", ""</p>
<p>"Sum", "Of Something", "", "In a Column"</p>
<p>Rats. It's irregular. </... | 1 | 2009-10-14T01:57:34Z | [
"python",
"naming-conventions"
] |
Naming convention for actually choosing the words in Python, PEP8 compliant | 1,563,673 | <p>Iâm looking for a better way to name everything in Python. Yes, Iâve read <a href="http://www.python.org/dev/peps/pep-0008/" rel="nofollow">PEP8</a>, <a href="http://www.joelonsoftware.com/articles/Wrong.html" rel="nofollow">Spolskyâs wonderful rant</a>, and various other articles. But Iâm looking for more... | 3 | 2009-10-14T00:21:52Z | 1,563,901 | <p>I believe that the need for complex variable naming conventions goes away with good object-oriented design. In the Spolsky article, much focus is on how variable naming helps preventing errors. I believe that those errors will more often occur when you have many variables in the same scope; this can be avoided by gr... | 4 | 2009-10-14T02:01:33Z | [
"python",
"naming-conventions"
] |
Naming convention for actually choosing the words in Python, PEP8 compliant | 1,563,673 | <p>Iâm looking for a better way to name everything in Python. Yes, Iâve read <a href="http://www.python.org/dev/peps/pep-0008/" rel="nofollow">PEP8</a>, <a href="http://www.joelonsoftware.com/articles/Wrong.html" rel="nofollow">Spolskyâs wonderful rant</a>, and various other articles. But Iâm looking for more... | 3 | 2009-10-14T00:21:52Z | 1,583,072 | <p>Remember that in English, when two ambiguous words are next to each other, the first one becomes an adjective which describes the second one. Try to stick to this rule and always name things with two components where the first component decribes the second.</p>
<p>For instance col_num is a number. What kind of numb... | 2 | 2009-10-17T19:59:39Z | [
"python",
"naming-conventions"
] |
Bundle additional executables with py2exe | 1,563,948 | <p>I have a python script that calls out to two Sysinternals tools (sigcheck and accesschk). Is there a way I can bundle these executables into a py2exe so that subprocess.Popen can see it when it runs?</p>
<p><hr /></p>
<p>Full explanation: My script is made to execute over a network share (S:\share\my_script.exe) a... | 3 | 2009-10-14T02:21:30Z | 1,563,963 | <p>I could be wrong about this, but I don't believe this is what py2exe was intended for. It's more about <em>what</em> you're distributing than about <em>how</em> you're distributing. I think what you may be looking for is the option to create a <a href="http://docs.python.org/distutils/builtdist.html#creating-windo... | 2 | 2009-10-14T02:29:37Z | [
"python",
"executable",
"bundle",
"py2exe"
] |
List of tuples to Numpy recarray | 1,564,000 | <p>Given a list of tuples, where each tuple represents a row in a table, e.g.</p>
<pre><code>tab = [('a',1),('b',2)]
</code></pre>
<p>Is there an easy way to convert this to a record array? I tried</p>
<pre><code>np.recarray(tab,dtype=[('name',str),('value',int)])
</code></pre>
<p>which doesn't seem to work.</p>
| 2 | 2009-10-14T02:45:16Z | 1,564,041 | <p>try</p>
<pre><code>np.rec.fromrecords(tab)
rec.array([('a', 1), ('b', 2)],
dtype=[('f0', '|S1'), ('f1', '<i4')])
</code></pre>
| 4 | 2009-10-14T03:01:48Z | [
"python",
"numpy"
] |
Extracting substrings at specified positions | 1,564,414 | <p>How to extract substrings from a string at specified positions
For e.g.: âABCDEFGHIJKLMâ. I have To extract the substring from 3 to 6 and 8 to 10.</p>
<p>Required output: DEFG, IJK</p>
<p>Thanks in advance.</p>
| 0 | 2009-10-14T05:30:26Z | 1,564,427 | <pre><code>s = 'ABCDEFGHIJKLM'
print s[3:7]
print s[8:11]
</code></pre>
| 2 | 2009-10-14T05:35:15Z | [
"python"
] |
Extracting substrings at specified positions | 1,564,414 | <p>How to extract substrings from a string at specified positions
For e.g.: âABCDEFGHIJKLMâ. I have To extract the substring from 3 to 6 and 8 to 10.</p>
<p>Required output: DEFG, IJK</p>
<p>Thanks in advance.</p>
| 0 | 2009-10-14T05:30:26Z | 1,564,428 | <pre><code>>>> 'ABCDEFGHIJKLM'[3:7]
'DEFG'
>>> 'ABCDEFGHIJKLM'[8:11]
'IJK'
</code></pre>
<p>You might want to read a <a href="http://docs.python.org/tutorial/" rel="nofollow">tutorial</a> or beginners book.</p>
| 2 | 2009-10-14T05:35:34Z | [
"python"
] |
Extracting substrings at specified positions | 1,564,414 | <p>How to extract substrings from a string at specified positions
For e.g.: âABCDEFGHIJKLMâ. I have To extract the substring from 3 to 6 and 8 to 10.</p>
<p>Required output: DEFG, IJK</p>
<p>Thanks in advance.</p>
| 0 | 2009-10-14T05:30:26Z | 1,564,429 | <p>Look into Python's concept called sequence slicing!</p>
| 3 | 2009-10-14T05:35:49Z | [
"python"
] |
Extracting substrings at specified positions | 1,564,414 | <p>How to extract substrings from a string at specified positions
For e.g.: âABCDEFGHIJKLMâ. I have To extract the substring from 3 to 6 and 8 to 10.</p>
<p>Required output: DEFG, IJK</p>
<p>Thanks in advance.</p>
| 0 | 2009-10-14T05:30:26Z | 1,564,431 | <p>Here you go</p>
<pre><code>myString = 'ABCDEFGHIJKLM'
first = myString[3:7] # => DEFG
second = myString[8:11] # => IJK
</code></pre>
<p>In the slicing syntax, the first number is inclusive and the second is excluded.</p>
<p>You can read more about String slicing from <a href="http://docs.python.org/tutorial... | 8 | 2009-10-14T05:36:16Z | [
"python"
] |
Extracting substrings at specified positions | 1,564,414 | <p>How to extract substrings from a string at specified positions
For e.g.: âABCDEFGHIJKLMâ. I have To extract the substring from 3 to 6 and 8 to 10.</p>
<p>Required output: DEFG, IJK</p>
<p>Thanks in advance.</p>
| 0 | 2009-10-14T05:30:26Z | 1,564,433 | <pre><code>a = "ABCDEFGHIJKLM"
print a[3:7], a[8:11]
</code></pre>
<p>--> DEFG IJK</p>
| 3 | 2009-10-14T05:36:59Z | [
"python"
] |
Extracting substrings at specified positions | 1,564,414 | <p>How to extract substrings from a string at specified positions
For e.g.: âABCDEFGHIJKLMâ. I have To extract the substring from 3 to 6 and 8 to 10.</p>
<p>Required output: DEFG, IJK</p>
<p>Thanks in advance.</p>
| 0 | 2009-10-14T05:30:26Z | 1,565,208 | <p>In alternative you can use operator.itemgetter:</p>
<pre><code>>>> import operator
>>> s = 'ABCDEFGHIJKLM'
>>> f = operator.itemgetter(3,4,5,6,7,8,9,10,11)
>>> f(s)
('D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L')
</code></pre>
| 0 | 2009-10-14T09:30:20Z | [
"python"
] |
Add timeout argument to python's Queue.join() | 1,564,501 | <p>I want to be able to join() the Queue class but timeouting after some time if the call hasn't returned yet.
What is the best way to do it? Is it possible to do it by subclassing queue\using metaclass?</p>
| 9 | 2009-10-14T06:02:49Z | 1,564,777 | <p>At first, you should ensure that all your working threads in the queue exit with <code>task_done()</code></p>
<p>To implement a timeout functionality with <code>Queue</code>, you can wrap the Queue's code in a Thread and add a timeout for this Thread using <code>Thread.join([timeout])</code></p>
<p><strong>unteste... | 0 | 2009-10-14T07:30:41Z | [
"python",
"join",
"timeout",
"queue"
] |
Add timeout argument to python's Queue.join() | 1,564,501 | <p>I want to be able to join() the Queue class but timeouting after some time if the call hasn't returned yet.
What is the best way to do it? Is it possible to do it by subclassing queue\using metaclass?</p>
| 9 | 2009-10-14T06:02:49Z | 1,564,786 | <p>Subclassing <code>Queue</code> is probably the best way. Something like this should work (untested):</p>
<pre><code>def join_with_timeout(self, timeout):
self.all_tasks_done.acquire()
try:
endtime = time() + timeout
while self.unfinished_tasks:
remaining = endtime - time()
... | 14 | 2009-10-14T07:33:14Z | [
"python",
"join",
"timeout",
"queue"
] |
Add timeout argument to python's Queue.join() | 1,564,501 | <p>I want to be able to join() the Queue class but timeouting after some time if the call hasn't returned yet.
What is the best way to do it? Is it possible to do it by subclassing queue\using metaclass?</p>
| 9 | 2009-10-14T06:02:49Z | 3,516,318 | <p>The <em>join()</em> method is all about waiting for all the tasks to be done. If you don't care whether the tasks have actually finished, you can periodically poll the unfinished task count:</p>
<pre><code>stop = time() + timeout
while q.unfinished_tasks and time() < stop:
sleep(1)
</code></pre>
<p>This lo... | 8 | 2010-08-18T20:20:30Z | [
"python",
"join",
"timeout",
"queue"
] |
CMake output name for dynamic-loaded library? | 1,564,696 | <p>I'm trying to write cmake rules to build dynamic-loaded library for python using boost.python on linux. I'd like to use 'foo' for python module name. So, the library must be called <code>foo.so</code>.
But by default, cmake uses standard rules for library naming, so if I write</p>
<pre><code>add_library(foo foo.cpp... | 32 | 2009-10-14T07:08:01Z | 1,564,798 | <p>The prefix "lib" is a convention for unix/linux and is exploited widely by compilers (e.g. when you link you write -lfoo). </p>
<p>I don't know if you can force cmake to create foo.so instead of libfoo.so, but maybe you can use "libfoo" for python module. Another option is to create install target in cmake ,which w... | 1 | 2009-10-14T07:37:17Z | [
"python",
"cmake",
"shared-libraries",
"boost-python"
] |
CMake output name for dynamic-loaded library? | 1,564,696 | <p>I'm trying to write cmake rules to build dynamic-loaded library for python using boost.python on linux. I'd like to use 'foo' for python module name. So, the library must be called <code>foo.so</code>.
But by default, cmake uses standard rules for library naming, so if I write</p>
<pre><code>add_library(foo foo.cpp... | 32 | 2009-10-14T07:08:01Z | 1,566,114 | <p>You can unset the prefix with this line:</p>
<pre><code>set_target_properties(foo PROPERTIES PREFIX "")
</code></pre>
| 53 | 2009-10-14T13:07:17Z | [
"python",
"cmake",
"shared-libraries",
"boost-python"
] |
Pylons/Formencode With Multiple Checkboxes | 1,565,035 | <p>I ran up against a few problems with Pylons/Formencode today when it came to validating multiple checkboxes. As a bit of background I have something like this in my Mako template:</p>
<pre><code><input type="checkbox" name="Project" value="1">Project 1</input>
<input type="checkbox" name="Project" va... | 0 | 2009-10-14T08:38:45Z | 1,566,740 | <p>maybe using <a href="http://formencode.org/modules/validators.html#formencode.validators.Set" rel="nofollow"><code>formencode.validators.Set</code></a>:</p>
<pre><code>>>> Set.to_python(None)
[]
>>> Set.to_python('this')
['this']
>>> Set.to_python(('this', 'that'))
['this', 'that']
>&g... | 2 | 2009-10-14T14:41:28Z | [
"python",
"validation",
"pylons",
"formencode"
] |
Pylons/Formencode With Multiple Checkboxes | 1,565,035 | <p>I ran up against a few problems with Pylons/Formencode today when it came to validating multiple checkboxes. As a bit of background I have something like this in my Mako template:</p>
<pre><code><input type="checkbox" name="Project" value="1">Project 1</input>
<input type="checkbox" name="Project" va... | 0 | 2009-10-14T08:38:45Z | 1,570,833 | <p>redrockettt,</p>
<p>Have you looked at the docstring to variabledecode? It suggests you use something like:</p>
<pre><code><input type="checkbox" name="Project-1" value="1">Project 1</input>
<input type="checkbox" name="Project-2" value="2">Project 2</input>
<input type="checkbox" name="... | 0 | 2009-10-15T07:38:07Z | [
"python",
"validation",
"pylons",
"formencode"
] |
python expression for this: max_value = max(firstArray) that is not in secondArray | 1,565,095 | <p>I wasn't sure if there was any good way of doing this. But I thought I'd give stackoverflow a try :)</p>
<p>I have a list/array with integers, and a second array also with integers. I want to find the max value from the first list, but the value can not be in the second array.</p>
<p>Is there any "fancy" way in py... | 1 | 2009-10-14T08:59:46Z | 1,565,103 | <p>Here's one way:</p>
<pre><code>max_value = [x for x in sorted(first) if x not in second][0]
</code></pre>
<p>It's less efficient than sorting then using a for loop to test if elements are in the second array, but it fits on one line nicely!</p>
| 1 | 2009-10-14T09:03:57Z | [
"python",
"expression"
] |
python expression for this: max_value = max(firstArray) that is not in secondArray | 1,565,095 | <p>I wasn't sure if there was any good way of doing this. But I thought I'd give stackoverflow a try :)</p>
<p>I have a list/array with integers, and a second array also with integers. I want to find the max value from the first list, but the value can not be in the second array.</p>
<p>Is there any "fancy" way in py... | 1 | 2009-10-14T08:59:46Z | 1,565,105 | <p>Use sets to get the values in firstArray that are not in secondArray:</p>
<pre><code>max_value = max(set(firstArray) - set(secondArray))
</code></pre>
| 12 | 2009-10-14T09:04:11Z | [
"python",
"expression"
] |
Python: imports at the beginning of the main program & PEP 8 | 1,565,173 | <p>The <a href="http://python.org/dev/peps/pep-0008/" rel="nofollow">PEP 8</a> recommends that modules be imported at the beginning of programs.</p>
<p>Now, I feel that importing some of them at the beginning of the <em>main</em> program (i.e., after <code>if __name__ == '__main__'</code>) makes sense. For instance, ... | 5 | 2009-10-14T09:20:19Z | 1,565,181 | <p>I can't really tell you how bad this is to do.</p>
<p>However, I've greatly improved performance (response time, load) for a web app by importing certain libraries only at the first usage.</p>
<p>BTW, the following is also from PEP 8:</p>
<blockquote>
<p>But most importantly: know when to be
inconsistent -- s... | 8 | 2009-10-14T09:23:03Z | [
"python",
"import",
"main",
"pep8",
"pep"
] |
Python: imports at the beginning of the main program & PEP 8 | 1,565,173 | <p>The <a href="http://python.org/dev/peps/pep-0008/" rel="nofollow">PEP 8</a> recommends that modules be imported at the beginning of programs.</p>
<p>Now, I feel that importing some of them at the beginning of the <em>main</em> program (i.e., after <code>if __name__ == '__main__'</code>) makes sense. For instance, ... | 5 | 2009-10-14T09:20:19Z | 1,565,185 | <p>I would recommend you to do what you feel is most appropriate when there is nothing in PEP about your concern.</p>
| 2 | 2009-10-14T09:23:54Z | [
"python",
"import",
"main",
"pep8",
"pep"
] |
Python: imports at the beginning of the main program & PEP 8 | 1,565,173 | <p>The <a href="http://python.org/dev/peps/pep-0008/" rel="nofollow">PEP 8</a> recommends that modules be imported at the beginning of programs.</p>
<p>Now, I feel that importing some of them at the beginning of the <em>main</em> program (i.e., after <code>if __name__ == '__main__'</code>) makes sense. For instance, ... | 5 | 2009-10-14T09:20:19Z | 1,565,258 | <p>Importing sys doesn't really take that long that I would worry about it. Some modules do take longer however.
I don't think sys really clogs up the namespace very much. I wouldn't use a variable or class called sys regardless.</p>
<p>If you think it's doing more harm than good to have it at the top, by all means do... | 2 | 2009-10-14T09:43:17Z | [
"python",
"import",
"main",
"pep8",
"pep"
] |
Python: imports at the beginning of the main program & PEP 8 | 1,565,173 | <p>The <a href="http://python.org/dev/peps/pep-0008/" rel="nofollow">PEP 8</a> recommends that modules be imported at the beginning of programs.</p>
<p>Now, I feel that importing some of them at the beginning of the <em>main</em> program (i.e., after <code>if __name__ == '__main__'</code>) makes sense. For instance, ... | 5 | 2009-10-14T09:20:19Z | 1,565,266 | <p>In general I don't think there's much harm in late importing for modules that may not be needed.</p>
<p>However <code>sys</code> I would definitely import early, at the top. It's such a common module that it's quite likely you might use sys elsewhere in your script and not notice that it's not always imported. <cod... | 6 | 2009-10-14T09:45:14Z | [
"python",
"import",
"main",
"pep8",
"pep"
] |
Python: imports at the beginning of the main program & PEP 8 | 1,565,173 | <p>The <a href="http://python.org/dev/peps/pep-0008/" rel="nofollow">PEP 8</a> recommends that modules be imported at the beginning of programs.</p>
<p>Now, I feel that importing some of them at the beginning of the <em>main</em> program (i.e., after <code>if __name__ == '__main__'</code>) makes sense. For instance, ... | 5 | 2009-10-14T09:20:19Z | 1,565,853 | <p>The issue isn't performance.</p>
<p>The issue is clarity.</p>
<p>Your "main" program is only a main program today. Tomorrow, it may be a library included in some higher-level main program. Later, it will be just one module in a bigger package. </p>
<p>Since your "main" program's life may change, you have two r... | 2 | 2009-10-14T12:07:10Z | [
"python",
"import",
"main",
"pep8",
"pep"
] |
Subclassing Python tuple with multiple __init__ arguments | 1,565,374 | <p>The following code works:</p>
<pre><code>class Foo(tuple):
def __init__(self, b):
super(Foo, self).__init__(tuple(b))
if __name__ == '__main__':
print Foo([3, 4])
$ python play.py
play.py:4: DeprecationWarning: object.__init__() takes no parameters
super(Foo, self).__init__(tuple(b))
(3, 4)
</... | 33 | 2009-10-14T10:10:41Z | 1,565,448 | <p>Because tuples are immutable, you have to override <code>__new__</code> instead:</p>
<p><a href="http://docs.python.org/reference/datamodel.html#object.__new__" rel="nofollow">python docs</a></p>
<blockquote>
<p><code>object.__new__(cls[, ...])</code></p>
<p>Called to create a new instance of
class <code>... | 43 | 2009-10-14T10:24:33Z | [
"python",
"inheritance",
"subclass",
"tuples"
] |
Subclassing Python tuple with multiple __init__ arguments | 1,565,374 | <p>The following code works:</p>
<pre><code>class Foo(tuple):
def __init__(self, b):
super(Foo, self).__init__(tuple(b))
if __name__ == '__main__':
print Foo([3, 4])
$ python play.py
play.py:4: DeprecationWarning: object.__init__() takes no parameters
super(Foo, self).__init__(tuple(b))
(3, 4)
</... | 33 | 2009-10-14T10:10:41Z | 13,094,796 | <p>To assign the tuple value you need to override the <code>__new__</code> method:</p>
<pre><code>class Foo(tuple):
def __new__ (cls, a, b):
return super(Foo, cls).__new__(cls, tuple(b))
</code></pre>
<p>The arguments seem to be ignored by the <code>__init__</code> implementation of the tuple class, but ... | 26 | 2012-10-26T21:38:33Z | [
"python",
"inheritance",
"subclass",
"tuples"
] |
Plot GeoIP data on a World Map | 1,565,555 | <p>I need a library (preferably written in Python) which is able to take a series of IP addresses (or geographic coordinates) and plots them on a World Map. </p>
<p>I already found <a href="http://gsl-nagoya-u.net/appendix/software/worldmap/">this one</a>, but it outputs data as a .svg file and it's simply unable to c... | 6 | 2009-10-14T10:49:21Z | 1,565,791 | <p>The google maps API can support all of the above if you would be willing to set up a local web environment for testing. There is a wrapper around the API for Python called <a href="http://code.google.com/p/pymaps/" rel="nofollow">pymaps</a>.</p>
<p>The API documentation has an example on how to use Google's geocod... | 2 | 2009-10-14T11:53:14Z | [
"python",
"geolocation",
"maps",
"plot"
] |
Plot GeoIP data on a World Map | 1,565,555 | <p>I need a library (preferably written in Python) which is able to take a series of IP addresses (or geographic coordinates) and plots them on a World Map. </p>
<p>I already found <a href="http://gsl-nagoya-u.net/appendix/software/worldmap/">this one</a>, but it outputs data as a .svg file and it's simply unable to c... | 6 | 2009-10-14T10:49:21Z | 1,566,197 | <p>Perhaps <a href="http://matplotlib.org/basemap/" rel="nofollow">Basemap</a> in <a href="http://matplotlib.sourceforge.net/" rel="nofollow">Matplotlib</a> for the plotting. </p>
<p>It can do all sorts of <a href="http://matplotlib.org/basemap/users/mapsetup.html" rel="nofollow">projections</a> (don't mind the ugly d... | 7 | 2009-10-14T13:23:08Z | [
"python",
"geolocation",
"maps",
"plot"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.