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
How to get lxml working under IronPython?
1,200,726
<p>I need to port some code that relies heavily on lxml from a CPython application to IronPython.</p> <p>lxml is very Pythonic and I would like to keep using it under IronPython, but it depends on libxslt and libxml2, which are C extensions.</p> <p>Does anyone know of a workaround to allow lxml under IronPython or a ...
6
2009-07-29T14:36:12Z
1,215,474
<p>You might check out <a href="http://www.resolversystems.com/documentation/index.php/Ironclad.html" rel="nofollow">IronClad</a>, which is an open source project intended to make C Extensions for Python available in IronPython.</p>
2
2009-08-01T00:31:50Z
[ ".net", "xml", "ironpython", "python", "lxml" ]
pylint false positive for superclass __init__
1,201,094
<p>If I derive a class from ctypes.BigEndianStructure, pylint warns if I don't call BigEndianStructure.<strong>init</strong> (). Great, but if I fix my code, pylint still warns:</p> <pre><code>import ctypes class Foo(ctypes.BigEndianStructure): def __init__(self): ctypes.BigEndianStructure.__init__(self) ...
0
2009-07-29T15:25:52Z
1,201,213
<p>Try using the new-style <code>super</code> calls:</p> <pre><code>class Foo(ctypes.BigEndianStructure): def __init__(self): super(Foo, self).__init__() </code></pre>
4
2009-07-29T15:44:55Z
[ "python", "pylint" ]
Importing files in Python from __init__.py
1,201,115
<p>Suppose I have the following structure:</p> <pre><code>app/ __init__.py foo/ a.py b.py c.py __init__.py </code></pre> <p>a.py, b.py and c.py share some common imports (logging, os, re, etc). Is it possible to import these three or four common modules from the <code>__init__.py</code> file so I ...
11
2009-07-29T15:29:26Z
1,201,151
<p>No, they have to be put in each module's namespace, so you have to import them somehow (unless you pass <code>logging</code> around as a function argument, which would be a weird way to do things, to say the least).</p> <p>But the modules are only imported once anyway (and then put into the <code>a</code>, <code>b<...
11
2009-07-29T15:33:20Z
[ "python", "import", "module" ]
Importing files in Python from __init__.py
1,201,115
<p>Suppose I have the following structure:</p> <pre><code>app/ __init__.py foo/ a.py b.py c.py __init__.py </code></pre> <p>a.py, b.py and c.py share some common imports (logging, os, re, etc). Is it possible to import these three or four common modules from the <code>__init__.py</code> file so I ...
11
2009-07-29T15:29:26Z
1,201,177
<p>You can do this using a common file such as <code>include.py</code>, but it goes against recommended practices because it involves a wildcard import. Consider the following files:</p> <pre><code>app/ __init__.py foo/ a.py b.py c.py include.py &lt;- put the includes here. __init__.py </code><...
13
2009-07-29T15:38:32Z
[ "python", "import", "module" ]
Importing files in Python from __init__.py
1,201,115
<p>Suppose I have the following structure:</p> <pre><code>app/ __init__.py foo/ a.py b.py c.py __init__.py </code></pre> <p>a.py, b.py and c.py share some common imports (logging, os, re, etc). Is it possible to import these three or four common modules from the <code>__init__.py</code> file so I ...
11
2009-07-29T15:29:26Z
1,201,244
<p>Yes, but <strong>don't do it</strong>. Seriously, don't. But if you still want to know how to do it, it'd look like this:</p> <pre><code>import __init__ re = __init__.re logging = __init__.logging os = __init__.os </code></pre> <p>I say not to do it not only because it's messy and pointless, but also because your...
6
2009-07-29T15:51:04Z
[ "python", "import", "module" ]
Check if an element exists
1,201,381
<p>I'm trying to find out if an Element in a Django model exists. I think that should be very easy to do, but couldn't find any elegant way in the <a href="http://docs.djangoproject.com/en/dev/topics/db/queries/" rel="nofollow">Making queries</a> section of the Django documentation.</p> <p>The problem I have is that I...
0
2009-07-29T16:12:10Z
1,201,455
<p>You could try:</p> <pre><code>Screenshot.objects.filter(filename__in = filenames) </code></pre> <p>That will give you a list of all the screenshots you do have. You could compare the two lists and see what doesnt exist between the two. That should get you started, but you might want to tweak the query for perfor...
1
2009-07-29T16:25:09Z
[ "python", "django", "performance" ]
Check if an element exists
1,201,381
<p>I'm trying to find out if an Element in a Django model exists. I think that should be very easy to do, but couldn't find any elegant way in the <a href="http://docs.djangoproject.com/en/dev/topics/db/queries/" rel="nofollow">Making queries</a> section of the Django documentation.</p> <p>The problem I have is that I...
0
2009-07-29T16:12:10Z
1,201,456
<p>If your <code>Screenshot</code> model has a lot of attributes, then the code you showed is doing unnecessary work for your specific need. For example, you can do something like this:</p> <pre><code>files_in_db = Screenshot.objects.values_list('filename', flat=True).distinct() </code></pre> <p>which will give you a...
2
2009-07-29T16:25:33Z
[ "python", "django", "performance" ]
Check if an element exists
1,201,381
<p>I'm trying to find out if an Element in a Django model exists. I think that should be very easy to do, but couldn't find any elegant way in the <a href="http://docs.djangoproject.com/en/dev/topics/db/queries/" rel="nofollow">Making queries</a> section of the Django documentation.</p> <p>The problem I have is that I...
0
2009-07-29T16:12:10Z
1,201,923
<p>This query gets you all the files that are in your database and filesystem:</p> <pre><code>discfiles = os.listdir(settings.SCREENSHOTS_ON_DISC) filenames = (Screenshot.objects.filter(filename__in=discfiles) .values_list('filename', flat=True) .order_by(...
1
2009-07-29T17:46:35Z
[ "python", "django", "performance" ]
Sending an exception on the SimpleXMLRPCServer
1,201,507
<p>I'm trying to raise an exception on the Server Side of an SimpleXMLRPCServer; however, all attempts get a "Fault 1" exception on the client side.</p> <p>RPC_Server.AbortTest() File "C:\Python25\lib\xmlrpclib.py", line 1147, in <strong>call</strong> return self.<strong>send(self.__name, args) File "C:\Python...
0
2009-07-29T16:34:21Z
1,202,742
<p>Yes, this is what happens when you raise an exception on the server side. Are you expecting the SimpleXMLRPCServer to return the exception to the client?</p> <p>You can only use objects that can be marshalled through XML. This includes</p> <ul> <li>boolean : The True and False constants</li> <li>integers : Pass in...
1
2009-07-29T20:11:06Z
[ "python", "exception", "simplexmlrpcserver" ]
Sending an exception on the SimpleXMLRPCServer
1,201,507
<p>I'm trying to raise an exception on the Server Side of an SimpleXMLRPCServer; however, all attempts get a "Fault 1" exception on the client side.</p> <p>RPC_Server.AbortTest() File "C:\Python25\lib\xmlrpclib.py", line 1147, in <strong>call</strong> return self.<strong>send(self.__name, args) File "C:\Python...
0
2009-07-29T16:34:21Z
19,157,397
<p>If you raise an exception like this:</p> <pre><code>raise Exception('Help!') </code></pre> <p>in the server the message member of the exception you get in the client will be the same as executing str() on the original exception prefixed with the string representation of the type.</p> <p>The result I get for the m...
0
2013-10-03T10:57:22Z
[ "python", "exception", "simplexmlrpcserver" ]
Cannot insert data into an sqlite3 database using Python
1,201,522
<p>I can successfully use Python to create a database and run the execute() method to create 2 new tables and specify the column names. However, I cannot insert data into the database. This is the code that I am trying to use to insert the data into the database:</p> <pre><code>#! /usr/bin/env python import sqlite3 ...
4
2009-07-29T16:36:23Z
1,201,577
<p>To insert the data you don't need a cursor</p> <p>just use the db</p> <p>db.execute() instead of c.execute() and get rid of the c = db.cursor() line</p> <p>Cursors aren't used to insert data, but usually to read data, or update data in place.</p>
3
2009-07-29T16:44:46Z
[ "python", "sqlite", "sqlite3" ]
Cannot insert data into an sqlite3 database using Python
1,201,522
<p>I can successfully use Python to create a database and run the execute() method to create 2 new tables and specify the column names. However, I cannot insert data into the database. This is the code that I am trying to use to insert the data into the database:</p> <pre><code>#! /usr/bin/env python import sqlite3 ...
4
2009-07-29T16:36:23Z
1,201,594
<p>Try to add</p> <pre><code>db.commit() </code></pre> <p>after the inserting.</p>
19
2009-07-29T16:46:56Z
[ "python", "sqlite", "sqlite3" ]
How do I link relative to a Pylons application root?
1,201,555
<p>In Pylons I have a mako template linking to <code>/static/resource.css</code>. How do I automatically link to <code>/pylons/static/resource.css</code> when I decide to map the application to a subdirectory on my web server?</p>
1
2009-07-29T16:41:49Z
1,224,667
<p>What you want are <a href="http://routes.groovie.org/manual.html#static-named-routes" rel="nofollow">static routes</a>:</p> <pre><code>map.connect('resource', '/static/resource.css', _static=True) </code></pre>
1
2009-08-03T21:11:21Z
[ "python", "pylons", "mako" ]
How do I link relative to a Pylons application root?
1,201,555
<p>In Pylons I have a mako template linking to <code>/static/resource.css</code>. How do I automatically link to <code>/pylons/static/resource.css</code> when I decide to map the application to a subdirectory on my web server?</p>
1
2009-07-29T16:41:49Z
1,331,147
<p>If you want your static file links to be relative to your app root, wrap them like this in your templates (assuming Mako and Pylons 0.9.7):</p> <pre><code>${url('/static/resource.css')} </code></pre> <p>The root path of your app will be prepended. No need to define specific routes for each file.</p>
2
2009-08-25T21:35:22Z
[ "python", "pylons", "mako" ]
Java Wrapper to Perl/Python code
1,201,628
<p>I have to deploy some Web Services on a server that only supports the Java ones, but some of them will be done using perl or python. I want to know if is possible to develop a Java wrapper to call a specific code written in perl or python. So, I want to have all the Web Services in Java, but some of them will call s...
3
2009-07-29T16:53:47Z
1,201,644
<p>There's something I used a while back called Jython which allows you to execute Python code from Java. It was a little quirky, but I got it to do what I needed.</p> <p><a href="http://www.jython.org" rel="nofollow">http://www.jython.org</a></p>
0
2009-07-29T16:56:53Z
[ "java", "python", "perl", "web-services", "wrapper" ]
Java Wrapper to Perl/Python code
1,201,628
<p>I have to deploy some Web Services on a server that only supports the Java ones, but some of them will be done using perl or python. I want to know if is possible to develop a Java wrapper to call a specific code written in perl or python. So, I want to have all the Web Services in Java, but some of them will call s...
3
2009-07-29T16:53:47Z
1,201,645
<p>For the Python part of it you can use <a href="http://www.jython.org/" rel="nofollow">Jython</a> to run Python code right from your Java virtual machine. It'll integrate fully with your Java code as a bonus.</p>
3
2009-07-29T16:56:56Z
[ "java", "python", "perl", "web-services", "wrapper" ]
Java Wrapper to Perl/Python code
1,201,628
<p>I have to deploy some Web Services on a server that only supports the Java ones, but some of them will be done using perl or python. I want to know if is possible to develop a Java wrapper to call a specific code written in perl or python. So, I want to have all the Web Services in Java, but some of them will call s...
3
2009-07-29T16:53:47Z
1,201,710
<p>For Python you can use the <a href="http://developers.sun.com/scripting/" rel="nofollow">Java Scripting API</a>.<br /> A Perl implementation is sadly still missing.</p>
1
2009-07-29T17:05:16Z
[ "java", "python", "perl", "web-services", "wrapper" ]
Java Wrapper to Perl/Python code
1,201,628
<p>I have to deploy some Web Services on a server that only supports the Java ones, but some of them will be done using perl or python. I want to know if is possible to develop a Java wrapper to call a specific code written in perl or python. So, I want to have all the Web Services in Java, but some of them will call s...
3
2009-07-29T16:53:47Z
1,201,722
<p>This depends heavily upon your needs. If Jython is an option for the Python code (it isn't always 100% compatible), then it is probably the best option there. Otherwise, you will need to use Java's Process Builder to call the interpretters directly and return the results on their output stream. This will not be f...
3
2009-07-29T17:06:23Z
[ "java", "python", "perl", "web-services", "wrapper" ]
Java Wrapper to Perl/Python code
1,201,628
<p>I have to deploy some Web Services on a server that only supports the Java ones, but some of them will be done using perl or python. I want to know if is possible to develop a Java wrapper to call a specific code written in perl or python. So, I want to have all the Web Services in Java, but some of them will call s...
3
2009-07-29T16:53:47Z
1,203,587
<p>For Perl, use <a href="http://search.cpan.org/dist/Inline-Java/" rel="nofollow">Inline::Java</a>. There are several options for integrating the code; you can <a href="http://search.cpan.org/dist/Inline-Java/Java/Callback.pod" rel="nofollow">call a separate process</a> or you can use an <a href="http://search.cpan.o...
3
2009-07-29T23:09:23Z
[ "java", "python", "perl", "web-services", "wrapper" ]
How to identify the currently available wireless networks with Python in Windows?
1,201,749
<p>Is there a way to get a list of wireless networks (SSID's) that are currently available? And seeing what is the current connected network? </p> <p>Doesn't need to be exactly the SSID, I just need to identify the current wireless network.</p>
2
2009-07-29T17:10:46Z
1,201,916
<p>You can use the netsh command. I don't remember the exact syntax used to invoke cli commands from within python, but I'm sure it should be fairly easy to locate.</p> <p>The article below has more information about how to use netsh itself:</p> <p><a href="http://technet.microsoft.com/en-us/library/cc755301%28WS.10%...
2
2009-07-29T17:44:54Z
[ "python", "windows", "windows-xp", "wireless", "ssid" ]
How to set proxy in Windows with Python?
1,201,771
<p>How can I get the current Windows' browser proxy setting, as well as set them to a value?</p> <p>I know I can do this by looking in the registry at <code>Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer</code>, but I'm looking, if it is possible, to do this without messing directly with the r...
1
2009-07-29T17:14:20Z
1,201,789
<p>If the code you are using uses <code>urlopen</code> under the hood you an set the <code>http_proxy</code> environment variable to have it picked up.</p> <p>See the <a href="http://docs.python.org/library/urllib.html" rel="nofollow">documentation</a> here for more info.</p>
0
2009-07-29T17:18:37Z
[ "python", "windows", "proxy", "registry" ]
How to set proxy in Windows with Python?
1,201,771
<p>How can I get the current Windows' browser proxy setting, as well as set them to a value?</p> <p>I know I can do this by looking in the registry at <code>Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer</code>, but I'm looking, if it is possible, to do this without messing directly with the r...
1
2009-07-29T17:14:20Z
1,205,881
<p>urllib module automatically retrieves settings from registry when no proxies are specified as a parameter or in the environment variables</p> <blockquote> <p>In a Windows environment, if no proxy environment variables are set, proxy settings are obtained from the registry’s Internet Settings section.</p> ...
3
2009-07-30T11:02:16Z
[ "python", "windows", "proxy", "registry" ]
How to set proxy in Windows with Python?
1,201,771
<p>How can I get the current Windows' browser proxy setting, as well as set them to a value?</p> <p>I know I can do this by looking in the registry at <code>Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer</code>, but I'm looking, if it is possible, to do this without messing directly with the r...
1
2009-07-29T17:14:20Z
9,039,001
<p>You can use WinHttpGetIEProxyConfigForCurrentUser as stated in <a href="http://stackoverflow.com/questions/202547/how-do-i-find-out-the-browsers-proxy-settings">this SO question</a></p> <p>There's <a href="http://stackoverflow.com/questions/1025029/how-to-use-win32-apis-with-python">another SO question</a> with exa...
0
2012-01-27T19:34:46Z
[ "python", "windows", "proxy", "registry" ]
Django and File Permissions: Best Practices?
1,201,785
<p>I am integrating "legacy" code with Django, and have problems when the process executing Django must write to legacy code directories where it lacks write permissions. (The legacy code is a Python backend to a Tkinter GUI, which I'm repurposing to a browser-based UI.)</p> <p>I could:</p> <ul> <li>Make the legacy ...
0
2009-07-29T17:17:18Z
1,201,895
<p>I'd go with option number 2. I don't think your django user is any more likely to get compromised than your Tkinter user. If there's something else under apache that you're worried about, run it under a separate apache with the right user.</p>
0
2009-07-29T17:39:53Z
[ "python", "django" ]
Adding a field to a structured numpy array
1,201,817
<p>What is the cleanest way to add a field to a structured numpy array? Can it be done destructively, or is it necessary to create a new array and copy over the existing fields? Are the contents of each field stored contiguously in memory so that such copying can be done efficiently?</p>
18
2009-07-29T17:24:12Z
1,201,821
<pre><code>import numpy def add_field(a, descr): """Return a new array that is like "a", but has additional fields. Arguments: a -- a structured numpy array descr -- a numpy type description of the new fields The contents of "a" are copied over to the appropriate fields in the new arr...
4
2009-07-29T17:25:29Z
[ "python", "numpy" ]
Adding a field to a structured numpy array
1,201,817
<p>What is the cleanest way to add a field to a structured numpy array? Can it be done destructively, or is it necessary to create a new array and copy over the existing fields? Are the contents of each field stored contiguously in memory so that such copying can be done efficiently?</p>
18
2009-07-29T17:24:12Z
1,208,039
<p>If you're using numpy 1.3, there's also numpy.lib.recfunctions.append_fields(). </p> <p>For many installations, you'll need to <code>import numpy.lib.recfunctions</code> to access this. <code>import numpy</code> will not allow one to see the <code>numpy.lib.recfunctions</code></p>
16
2009-07-30T17:18:58Z
[ "python", "numpy" ]
wxPython: Handling events in a widget that is inside a notebook
1,201,979
<p>I have a wxPython notebook, in this case a <code>wx.aui.AuiNotebook</code>. (but this problem has happened with other kinds of notebooks as well.) In my notebook I have a widget, in this case a subclass of <code>ScrolledPanel</code>, for which I am trying to do some custom event handling (for <code>wx.EVT_KEY_DOWN</...
2
2009-07-29T17:58:41Z
1,203,996
<p>I tried reproducing your problem but it worked fine for me. The only thing I can think of is that there is one of your classes that also binds to <code>wx.EVT_KEY_DOWN</code> and doesn't call <a href="http://www.wxpython.org/docs/api/wx.Event-class.html#Skip" rel="nofollow">wx.Event.Skip()</a> in its callback. That ...
2
2009-07-30T01:21:58Z
[ "python", "user-interface", "event-handling", "wxpython" ]
OpenSocial Win32 compatibility
1,202,086
<p>I am planning to develop an application in Python on the Win32 platform. Does the <a href="http://en.wikipedia.org/wiki/OpenSocial" rel="nofollow">OpenSocial</a> API work upon the Win32 platform as well?</p> <p>To make things more clear, I need to use information from the OpenSocial API to conduct certain things in...
0
2009-07-29T18:16:52Z
1,202,124
<p>Yes the general idea of an API is it uses a standard language like XML or JSON or whatever. You can easily find libraries that read/write those formats in most languages, no matter the platform. If you're lucky someone will have written a library for the specific API you need.</p> <p>Which in this case, they have :...
1
2009-07-29T18:23:40Z
[ "python", "opensocial" ]
Sorting a list of dictionaries of objects by dictionary values
1,202,088
<p>This is related to the various other questions about sorting values of dictionaries that I have read here, but I have not found the answer. I'm a newbie and maybe I just didn't see the answer as it concerns my problem.</p> <p>I have this function, which I'm using as a Django custom filter to sort results from a lis...
2
2009-07-29T18:17:25Z
1,202,438
<p>As far as I can see, there are two things you need to do.</p> <p>First, parse the call path out of the sort key, that is: turn <code>'TOT_PTS_Misc.value'</code> to <code>('TOT_PTS_Misc','value')</code> Second, use attrgetter in a similar way to the use of itemgetter, for the callable part.</p> <p>If i'm not mistak...
0
2009-07-29T19:15:03Z
[ "python", "django" ]
Sorting a list of dictionaries of objects by dictionary values
1,202,088
<p>This is related to the various other questions about sorting values of dictionaries that I have read here, but I have not found the answer. I'm a newbie and maybe I just didn't see the answer as it concerns my problem.</p> <p>I have this function, which I'm using as a Django custom filter to sort results from a lis...
2
2009-07-29T18:17:25Z
1,202,936
<p>You gain access to the keys using <code>itemgetter</code> and to the value attributes using <code>attrgetter</code>.</p> <p>So, once you've extracted the key, value names you're interested in, you can construct your key function:</p> <pre><code>from operator import attrgetter, itemgetter itmget = itemgetter('TOT_P...
2
2009-07-29T20:46:41Z
[ "python", "django" ]
raw_input without leaving a history in readline
1,202,127
<p>Is there a way of using raw_input without leaving a sign in the readline history, so that it don't show when tab-completing?</p>
4
2009-07-29T18:24:10Z
1,202,308
<p>You could make a function something like</p> <pre><code>import readline def raw_input_no_history(): input = raw_input() readline.remove_history_item(readline.get_current_history_length()-1) return input </code></pre> <p>and call that function instead of raw_input. You may not need the minus 1 dependen...
6
2009-07-29T18:53:08Z
[ "python", "history", "readline", "tab-completion" ]
random.sample return only characters instead of strings
1,202,251
<p>This is a kind of newbie question, but I couldn't find a solution. I read a list of strings from a file, and try to get a random, 5 element sample with random.sample, but the resultung list only contains characters. Why is that? How can I get a random sample list of strings?</p> <p>This is what I do:</p> <pre><cod...
2
2009-07-29T18:44:26Z
1,202,272
<p>If the names are all on seperate lines, ry the following:</p> <pre><code>names = random.sample(open('names.txt').readlines(), count) print names </code></pre> <p>Essentially you are going wrong because you need to pass an interable to <code>random.sample()</code>. When you pass a string it treats it like a list. ...
3
2009-07-29T18:47:14Z
[ "python", "string", "character", "random-sample" ]
Combinatorics Counting Puzzle: Roll 20, 8-sided dice, what is the probability of getting at least 5 dice of the same value
1,202,343
<p>Assume a game in which one rolls 20, 8-sided die, for a total number of 8^20 possible outcomes. To calculate the probability of a particular event occurring, we divide the number of ways that event can occur by 8^20. </p> <p>One can calculate the number of ways to get exactly 5 dice of the value 3. (20 choose 5) gi...
3
2009-07-29T18:58:43Z
1,202,427
<p>The exact probability distribution Fs,i of a sum of i s-sided dice can be calculated as the repeated convolution of the single-die probability distribution with itself.</p> <p><img src="http://upload.wikimedia.org/math/b/1/4/b140f36d9f022772b54f1236c3744190.png" alt="alt text" /></p> <p>where <img src="http://upl...
2
2009-07-29T19:12:59Z
[ "python", "puzzle", "combinatorics", "discrete-mathematics", "dice" ]
Combinatorics Counting Puzzle: Roll 20, 8-sided dice, what is the probability of getting at least 5 dice of the same value
1,202,343
<p>Assume a game in which one rolls 20, 8-sided die, for a total number of 8^20 possible outcomes. To calculate the probability of a particular event occurring, we divide the number of ways that event can occur by 8^20. </p> <p>One can calculate the number of ways to get exactly 5 dice of the value 3. (20 choose 5) gi...
3
2009-07-29T18:58:43Z
1,202,507
<p>Recursive solution:</p> <pre><code>Prob_same_value(n) = Prob_same_value(n-1) * (1 - Prob_noone_rolling_that_value(N-(n-1))) </code></pre>
1
2009-07-29T19:29:02Z
[ "python", "puzzle", "combinatorics", "discrete-mathematics", "dice" ]
Combinatorics Counting Puzzle: Roll 20, 8-sided dice, what is the probability of getting at least 5 dice of the same value
1,202,343
<p>Assume a game in which one rolls 20, 8-sided die, for a total number of 8^20 possible outcomes. To calculate the probability of a particular event occurring, we divide the number of ways that event can occur by 8^20. </p> <p>One can calculate the number of ways to get exactly 5 dice of the value 3. (20 choose 5) gi...
3
2009-07-29T18:58:43Z
1,202,598
<p>Here is what I am thinking...</p> <p>If you just had 5 dice, you would only have eight ways to get what you want.</p> <p>For each of those eight ways, all possible combinations of the other 15 dice work.</p> <p>So - I think the answer is: (8 * 8**15) / 8**20</p> <p>(The answer for at least 5 the same.)</p>
1
2009-07-29T19:44:56Z
[ "python", "puzzle", "combinatorics", "discrete-mathematics", "dice" ]
Combinatorics Counting Puzzle: Roll 20, 8-sided dice, what is the probability of getting at least 5 dice of the same value
1,202,343
<p>Assume a game in which one rolls 20, 8-sided die, for a total number of 8^20 possible outcomes. To calculate the probability of a particular event occurring, we divide the number of ways that event can occur by 8^20. </p> <p>One can calculate the number of ways to get exactly 5 dice of the value 3. (20 choose 5) gi...
3
2009-07-29T18:58:43Z
1,202,614
<p>Double counting can be solved by use of the <a href="http://en.wikipedia.org/wiki/Inclusion-exclusion%5Fprinciple" rel="nofollow">Inclusion/Exclusion Principle</a></p> <p>I suspect it comes out to: </p> <pre><code>Choose(8,1)*P(one set of 5 Xs) - Choose(8,2)*P(a set of 5 Xs and a set of 5 Ys) + Choose(8,3)*P(5 X...
3
2009-07-29T19:48:39Z
[ "python", "puzzle", "combinatorics", "discrete-mathematics", "dice" ]
Combinatorics Counting Puzzle: Roll 20, 8-sided dice, what is the probability of getting at least 5 dice of the same value
1,202,343
<p>Assume a game in which one rolls 20, 8-sided die, for a total number of 8^20 possible outcomes. To calculate the probability of a particular event occurring, we divide the number of ways that event can occur by 8^20. </p> <p>One can calculate the number of ways to get exactly 5 dice of the value 3. (20 choose 5) gi...
3
2009-07-29T18:58:43Z
1,202,632
<p>I believe you can use the formula of x occurrences in n events as:</p> <p>P = probability^n * (n!/((n - x)!x!))</p> <p>So the final result is going to be the sum of results from 0 to n.</p> <p>I don't really see any easy way to combine it into one step that would be less messy. With this way you have the formula ...
1
2009-07-29T19:52:36Z
[ "python", "puzzle", "combinatorics", "discrete-mathematics", "dice" ]
Combinatorics Counting Puzzle: Roll 20, 8-sided dice, what is the probability of getting at least 5 dice of the same value
1,202,343
<p>Assume a game in which one rolls 20, 8-sided die, for a total number of 8^20 possible outcomes. To calculate the probability of a particular event occurring, we divide the number of ways that event can occur by 8^20. </p> <p>One can calculate the number of ways to get exactly 5 dice of the value 3. (20 choose 5) gi...
3
2009-07-29T18:58:43Z
1,202,634
<p>I suggest that you spend a little bit of time writing up a Monte Carlo simulation and let it run while you work out the math by hand. Hopefully the Monte Carlo simulation will converge before you're finished with the math and you'll be able to check your solution.</p> <p>A slightly faster option might involve crea...
4
2009-07-29T19:53:20Z
[ "python", "puzzle", "combinatorics", "discrete-mathematics", "dice" ]
Combinatorics Counting Puzzle: Roll 20, 8-sided dice, what is the probability of getting at least 5 dice of the same value
1,202,343
<p>Assume a game in which one rolls 20, 8-sided die, for a total number of 8^20 possible outcomes. To calculate the probability of a particular event occurring, we divide the number of ways that event can occur by 8^20. </p> <p>One can calculate the number of ways to get exactly 5 dice of the value 3. (20 choose 5) gi...
3
2009-07-29T18:58:43Z
1,203,223
<p>This problem is really hard if you have to generalize it (get the exact formula).</p> <p>But anyways, let me explain the algorithm. If you want to know </p> <blockquote> <p>the number of ways to get exactly 5 dice of the same value</p> </blockquote> <p>you have to rephrase your previous problem, as</p> <blo...
2
2009-07-29T21:38:14Z
[ "python", "puzzle", "combinatorics", "discrete-mathematics", "dice" ]
Templating+scripting reverse proxy?
1,202,430
<p>Thinking through an idea, wanted to get feedback/suggestions:</p> <p>Having had great success with url rewriting and nginx, I'm now thinking of a more capable reverse proxy/router that would do the following:</p> <ul> <li>Map requests to handlers based on regex matching (ala Django)</li> <li>Certain requests would...
2
2009-07-29T19:13:33Z
1,204,970
<p>So instead of doing something an AJAXy call into an iframe or something, you're doing it on the server side.</p> <p>I think it's something I'd only do if the external site was totally under my control, purely for the security implications. It'd also hit your response times quite a bit.</p> <p>Am I missing the poin...
0
2009-07-30T07:26:54Z
[ "python", "proxy", "twisted", "reverse-proxy" ]
Templating+scripting reverse proxy?
1,202,430
<p>Thinking through an idea, wanted to get feedback/suggestions:</p> <p>Having had great success with url rewriting and nginx, I'm now thinking of a more capable reverse proxy/router that would do the following:</p> <ul> <li>Map requests to handlers based on regex matching (ala Django)</li> <li>Certain requests would...
2
2009-07-29T19:13:33Z
1,328,662
<p>This already exist an is called Deliverance: <a href="http://deliverance.openplans.org/" rel="nofollow">http://deliverance.openplans.org/</a></p>
1
2009-08-25T14:28:52Z
[ "python", "proxy", "twisted", "reverse-proxy" ]
Constructor specialization in python
1,202,711
<p>Class hierarchies and constructors are related. Parameters from a child class need to be passed to their parent. </p> <p>So, in Python, we end up with something like this:</p> <pre><code>class Parent(object): def __init__(self, a, b, c, ka=None, kb=None, kc=None): # do something with a, b, c, ka, kb, k...
4
2009-07-29T20:06:15Z
1,202,783
<p>Well, the only solution I could see is using a mixture of listed variables as well as *args and **kwargs, as such:</p> <pre><code>class Parent(object): def __init__(self, a, b, c, ka=None, kb=None, kc=None): pass class Child(Parent): def __init__(self, d, e, f, *args, kd=None, ke=None, kf=None, **kwar...
2
2009-07-29T20:18:33Z
[ "python", "design-patterns", "class", "oop", "anti-patterns" ]
Constructor specialization in python
1,202,711
<p>Class hierarchies and constructors are related. Parameters from a child class need to be passed to their parent. </p> <p>So, in Python, we end up with something like this:</p> <pre><code>class Parent(object): def __init__(self, a, b, c, ka=None, kb=None, kc=None): # do something with a, b, c, ka, kb, k...
4
2009-07-29T20:06:15Z
1,202,787
<p>"dozen child classes and lots of parameters" sounds like a problem irrespective of parameter naming.</p> <p>I suspect that a little refactoring can peel out some <strong>Strategy</strong> objects that would simplify this hierarchy and make the super-complex constructors go away.</p>
6
2009-07-29T20:20:00Z
[ "python", "design-patterns", "class", "oop", "anti-patterns" ]
Constructor specialization in python
1,202,711
<p>Class hierarchies and constructors are related. Parameters from a child class need to be passed to their parent. </p> <p>So, in Python, we end up with something like this:</p> <pre><code>class Parent(object): def __init__(self, a, b, c, ka=None, kb=None, kc=None): # do something with a, b, c, ka, kb, k...
4
2009-07-29T20:06:15Z
1,203,012
<p>I try to group the parameters into their own objects, e.g, instead of passing sourceDirectory, targetDirectory, temporaryDirectory, serverName, serverPort, I'd have a DirectoryContext and ServerContext objects. </p> <p>If the context objects start having more behavior or logic it might lead to the strategy object...
1
2009-07-29T21:01:05Z
[ "python", "design-patterns", "class", "oop", "anti-patterns" ]
get request data in Django form
1,202,839
<p>Is it possible to get request.user data in a form class? I want to clean an email address to make sure that it's unique, but if it's the current users email address then it should pass.</p> <p>This is what I currently have which works great for creating new users, but if I want to edit a user I run into the proble...
34
2009-07-29T20:29:51Z
1,202,963
<p>Not that I'm aware of. One way to handle this is have your Form class's <code>__init__</code> take an optional email parameter, which it can store as an attribute. If supplied at form creation time, it can use that during validation for the comparison you're interested in. </p>
0
2009-07-29T20:51:48Z
[ "python", "django" ]
get request data in Django form
1,202,839
<p>Is it possible to get request.user data in a form class? I want to clean an email address to make sure that it's unique, but if it's the current users email address then it should pass.</p> <p>This is what I currently have which works great for creating new users, but if I want to edit a user I run into the proble...
34
2009-07-29T20:29:51Z
1,204,136
<p>As ars and Diarmuid have pointed out, you can pass <code>request.user</code> into your form, and use it in validating the email. Diarmuid's code, however, is wrong. The code should actually read:</p> <pre><code>from django import forms class UserForm(forms.Form): email_address = forms.EmailField(widget = forms...
48
2009-07-30T02:24:04Z
[ "python", "django" ]
get request data in Django form
1,202,839
<p>Is it possible to get request.user data in a form class? I want to clean an email address to make sure that it's unique, but if it's the current users email address then it should pass.</p> <p>This is what I currently have which works great for creating new users, but if I want to edit a user I run into the proble...
34
2009-07-29T20:29:51Z
14,201,789
<p>Just so you know, with Django 1.4 and generic class based CreateView and UpdateView, a self.instance is populated on each model form, which allows you to compare the POSTed email vs the current user email.</p> <p>Here is a code sample, using mixin</p> <pre><code>class EmailUniqueMixin(object): """ Ensure e...
3
2013-01-07T18:26:16Z
[ "python", "django" ]
get request data in Django form
1,202,839
<p>Is it possible to get request.user data in a form class? I want to clean an email address to make sure that it's unique, but if it's the current users email address then it should pass.</p> <p>This is what I currently have which works great for creating new users, but if I want to edit a user I run into the proble...
34
2009-07-29T20:29:51Z
14,656,536
<p>Here's the way to get the user in your form when using generic views:</p> <p>In the view, pass the <code>request.user</code> to the form using <code>get_form_kwargs</code>:</p> <pre><code>class SampleView( View ): def get_form_kwargs( self ): kwargs = super( SampleView, self ).get_form_kwargs() ...
17
2013-02-01T23:01:56Z
[ "python", "django" ]
Python - tempfile.TemporaryFile cannot be read; why?
1,202,848
<p>The <a href="http://docs.python.org/library/tempfile.html#tempfile.TemporaryFile">official documentation for TemporaryFile</a> reads:</p> <blockquote> <p>The mode parameter defaults to 'w+b' so that the file created <strong>can be read and written without being closed</strong>.</p> </blockquote> <p>Yet, the ...
13
2009-07-29T20:31:34Z
1,202,917
<p><code>read()</code> does not return anything because you are at the end of the file. You need to call <a href="http://docs.python.org/library/stdtypes.html#file.seek" rel="nofollow"><code>seek()</code></a> first before <code>read()</code> will return anything. For example, put this line in front of the first <code>r...
7
2009-07-29T20:43:00Z
[ "python", "file", "io", "temporary-files" ]
Python - tempfile.TemporaryFile cannot be read; why?
1,202,848
<p>The <a href="http://docs.python.org/library/tempfile.html#tempfile.TemporaryFile">official documentation for TemporaryFile</a> reads:</p> <blockquote> <p>The mode parameter defaults to 'w+b' so that the file created <strong>can be read and written without being closed</strong>.</p> </blockquote> <p>Yet, the ...
13
2009-07-29T20:31:34Z
1,202,998
<p>You must put </p> <pre><code>f.seek(0) </code></pre> <p>before trying to read the file (this will send you to the beginning of the file), and</p> <pre><code>f.seek(0, 2) </code></pre> <p>to return to the end so you can assure you won't overwrite it.</p>
25
2009-07-29T20:58:55Z
[ "python", "file", "io", "temporary-files" ]
Python CSV DictReader/Writer issues
1,202,855
<p>I'm trying to extract a bunch of lines from a CSV file and write them into another, but I'm having some problems.</p> <pre><code>import csv f = open("my_csv_file.csv", "r") r = csv.DictReader(f, delimiter=',') fieldnames = r.fieldnames target = open("united.csv", 'w') w = csv.DictWriter(united, fieldnames=fieldna...
2
2009-07-29T20:32:42Z
1,202,875
<p>I don't know either, but since all you're doing is copying lines from one file to another why are you bothering with the <code>csv</code> stuff at all? Why not something like:</p> <pre><code>f = open("my_csv_file.csv", "r") target = open("united.csv", 'w') f.readline() f.readline() for line in f: target.write(...
11
2009-07-29T20:35:26Z
[ "python", "csv" ]
Python CSV DictReader/Writer issues
1,202,855
<p>I'm trying to extract a bunch of lines from a CSV file and write them into another, but I'm having some problems.</p> <pre><code>import csv f = open("my_csv_file.csv", "r") r = csv.DictReader(f, delimiter=',') fieldnames = r.fieldnames target = open("united.csv", 'w') w = csv.DictWriter(united, fieldnames=fieldna...
2
2009-07-29T20:32:42Z
1,282,896
<p>As for the exception, looks like this line:</p> <pre><code>w = csv.DictWriter(united, fieldnames=fieldnames) </code></pre> <p>should be</p> <pre><code>w = csv.DictWriter(target, fieldnames=fieldnames) </code></pre>
1
2009-08-15T21:29:53Z
[ "python", "csv" ]
Python CSV DictReader/Writer issues
1,202,855
<p>I'm trying to extract a bunch of lines from a CSV file and write them into another, but I'm having some problems.</p> <pre><code>import csv f = open("my_csv_file.csv", "r") r = csv.DictReader(f, delimiter=',') fieldnames = r.fieldnames target = open("united.csv", 'w') w = csv.DictWriter(united, fieldnames=fieldna...
2
2009-07-29T20:32:42Z
2,413,953
<p>The reason you're getting the error is most likely that your original CSV file (my_csv_file.csv) doesn't have a header row. Therefore, when you construct the reader object, its fieldnames field is set to <code>None</code>.</p> <p>When you try to write a row using the writer, it first checks to make sure there are n...
1
2010-03-10T01:36:58Z
[ "python", "csv" ]
Python CSV DictReader/Writer issues
1,202,855
<p>I'm trying to extract a bunch of lines from a CSV file and write them into another, but I'm having some problems.</p> <pre><code>import csv f = open("my_csv_file.csv", "r") r = csv.DictReader(f, delimiter=',') fieldnames = r.fieldnames target = open("united.csv", 'w') w = csv.DictWriter(united, fieldnames=fieldna...
2
2009-07-29T20:32:42Z
3,595,110
<p>To clear up the confusion about the error: you get it because <code>r.fieldnames</code> is only set once you read from the input file for the first time using <code>r</code>. Hence the way you wrote it, <code>fieldnames</code> will always be initialized to <code>None</code>.</p> <p>You may initialize <code>w = csv....
11
2010-08-29T14:27:34Z
[ "python", "csv" ]
How to use Python's Easygui module to pick files and insert filenames into code
1,202,902
<p>I'm trying to use Python's easygui module to select a file and then insert it's name into a program I wrote (see code below). So I want to insert filename 1 and 2 where it says <strong>insert filename1</strong>, etc.. Any help would be greatly appreciated. Thanks! </p> <pre><code>import easygui import csv msg='n...
0
2009-07-29T20:40:22Z
1,206,424
<p>I'm going to assume you're new to programming. If I misunderstood your question, I apologize.</p> <p>In your code, after the lines:</p> <pre><code>filename1 = easygui.fileopenbox() filename2 = easygui.fileopenbox() </code></pre> <p>The selected file names are stored in the variables <code>filename1</code> and <co...
2
2009-07-30T12:53:55Z
[ "python", "file", "easygui" ]
Using Enthought
1,202,967
<p>I need to calculate the inverse of the complementary error function (erfc^(1)) for a problem.</p> <p>I was looking into Python tools for it, and many threads said Enthought has most of the math tools needed, so I downloaded and installed it in my local user account. But I am not very sure about how to use it? </p> ...
1
2009-07-29T20:52:12Z
1,203,037
<p><a href="http://scipy.org/" rel="nofollow">SciPy</a>, which is included in the <a href="http://en.wikipedia.org/wiki/Enthought" rel="nofollow">Enthought</a> Python distribution, contains that <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.special.erfcinv.html#scipy.special.erfcinv" rel="nofollow"...
8
2009-07-29T21:05:17Z
[ "python", "scipy" ]
Using Enthought
1,202,967
<p>I need to calculate the inverse of the complementary error function (erfc^(1)) for a problem.</p> <p>I was looking into Python tools for it, and many threads said Enthought has most of the math tools needed, so I downloaded and installed it in my local user account. But I am not very sure about how to use it? </p> ...
1
2009-07-29T20:52:12Z
1,203,097
<p>Here's a quick example of calculations in the Enthought Python Distribution (EPD) with the inverse of the complementary error function (<code>erfcinv</code>), which is included in the <a href="http://www.scipy.org/" rel="nofollow">SciPy</a> package that comes with the EPD:</p> <pre><code>C:\&gt;c:\Python25\python E...
1
2009-07-29T21:16:12Z
[ "python", "scipy" ]
Formatting text into boxes in the Python Shell
1,203,036
<p>I've created a basic menu class that looks like this:</p> <pre><code>class Menu: def __init__(self, title, body): self.title = title self.body = body def display(self): #print the menu to the screen </code></pre> <p>What I want to do is format the title and the body so they fit insi...
1
2009-07-29T21:04:56Z
1,203,113
<pre><code>#!/usr/bin/env python def format_box(title, body, width=80): box_line = lambda text: "* " + text + (" " * (width - 6 - len(text))) + " *" print "*" * width print box_line(title) print "*" * width print box_line("") for line in body.split("\n"): print box_line(line.expandt...
4
2009-07-29T21:19:13Z
[ "python", "shell", "formatting" ]
Formatting text into boxes in the Python Shell
1,203,036
<p>I've created a basic menu class that looks like this:</p> <pre><code>class Menu: def __init__(self, title, body): self.title = title self.body = body def display(self): #print the menu to the screen </code></pre> <p>What I want to do is format the title and the body so they fit insi...
1
2009-07-29T21:04:56Z
1,210,175
<p>You could also try the standard <a href="http://docs.python.org/library/textwrap.html" rel="nofollow">'textwrap'</a> module</p>
0
2009-07-31T00:54:32Z
[ "python", "shell", "formatting" ]
Can you Make a Django form set validate the initial data?
1,203,237
<p>Here's an example:</p> <pre><code>from django import forms class ArticleForm(forms.Form): title = forms.CharField() pub_date = forms.DateField() from django.forms.formsets import formset_factory ArticleFormSet = formset_factory(ArticleForm) formset = ArticleFormSet(initial=my_data) </code></pre> <p>So ...
1
2009-07-29T21:40:45Z
1,203,279
<p>I can't see how there can be any validation errors if the data just came straight out of the DB. However, it's quite easy to do this - instead of passing the data in as <code>initial,</code> pass it as <code>data</code>, just as if it came from a POST.</p> <pre><code>formset = ArticleFormSet(data=my_data) </code></...
1
2009-07-29T21:51:03Z
[ "python", "django", "forms", "formset" ]
Can you Make a Django form set validate the initial data?
1,203,237
<p>Here's an example:</p> <pre><code>from django import forms class ArticleForm(forms.Form): title = forms.CharField() pub_date = forms.DateField() from django.forms.formsets import formset_factory ArticleFormSet = formset_factory(ArticleForm) formset = ArticleFormSet(initial=my_data) </code></pre> <p>So ...
1
2009-07-29T21:40:45Z
9,393,493
<p>Use </p> <p><code>formset = ArticleFormSet(data=my_data)</code></p> <p>Very important, my_data should be a dict with this format</p> <pre><code>data = { 'form-TOTAL_FORMS': u'2', 'form-INITIAL_FORMS': u'2', 'form-MAX_NUM_FORMS': u'', 'form-0-title': u'Test', 'form-0-pub_date': u'1904-06-16', ...
0
2012-02-22T10:59:05Z
[ "python", "django", "forms", "formset" ]
recursive lambda-expressions possible?
1,203,292
<p>I'm trying to write a lambda-expression that calls itself, but i can't seem to find any syntax for that, or even if it's possible.</p> <p>Essentially what I wanted to transfer the following function into the following lambda expression: (I realize it's a silly application, it just adds, but I'm exploring what I can...
17
2009-07-29T21:54:24Z
1,203,297
<p>Maybe you need a Y combinator?</p> <p><strong>Edit</strong> - make that a Z combinator (I hadn't realized that Y combinators are more for call-by-name)</p> <p>Using the definition of the Z combinator from <a href="http://en.wikipedia.org/wiki/Fixed%5Fpoint%5Fcombinator">Wikipedia</a></p> <pre><code>&gt;&gt;&gt; Z...
18
2009-07-29T21:55:53Z
[ "python", "recursion", "lambda" ]
recursive lambda-expressions possible?
1,203,292
<p>I'm trying to write a lambda-expression that calls itself, but i can't seem to find any syntax for that, or even if it's possible.</p> <p>Essentially what I wanted to transfer the following function into the following lambda expression: (I realize it's a silly application, it just adds, but I'm exploring what I can...
17
2009-07-29T21:54:24Z
1,203,337
<p>First of all recursive lambda expressions are completely unnecessary. As you yourself point out, for the lambda expression to call itself, it needs to have a name. But lambda expressions is nothing else than anonymous functions. So if you give the lambda expression a name, it's no longer a lambda expression, but a f...
7
2009-07-29T22:06:29Z
[ "python", "recursion", "lambda" ]
recursive lambda-expressions possible?
1,203,292
<p>I'm trying to write a lambda-expression that calls itself, but i can't seem to find any syntax for that, or even if it's possible.</p> <p>Essentially what I wanted to transfer the following function into the following lambda expression: (I realize it's a silly application, it just adds, but I'm exploring what I can...
17
2009-07-29T21:54:24Z
1,203,364
<pre><code>add = lambda a, b: b if a &lt;= 0 else 1 + add(a - 1, b) </code></pre>
3
2009-07-29T22:13:32Z
[ "python", "recursion", "lambda" ]
recursive lambda-expressions possible?
1,203,292
<p>I'm trying to write a lambda-expression that calls itself, but i can't seem to find any syntax for that, or even if it's possible.</p> <p>Essentially what I wanted to transfer the following function into the following lambda expression: (I realize it's a silly application, it just adds, but I'm exploring what I can...
17
2009-07-29T21:54:24Z
1,203,499
<p>Perhaps you should try the <a href="http://en.wikipedia.org/wiki/Fixed_point_combinator">Z combinator</a>, where this example is from:</p> <pre><code>&gt;&gt;&gt; Z = lambda f: (lambda x: f(lambda *args: x(x)(*args)))(lambda x: f(lambda *args: x(x)(*args))) &gt;&gt;&gt; fact = lambda f: lambda x: 1 if x == 0 else x...
7
2009-07-29T22:41:29Z
[ "python", "recursion", "lambda" ]
recursive lambda-expressions possible?
1,203,292
<p>I'm trying to write a lambda-expression that calls itself, but i can't seem to find any syntax for that, or even if it's possible.</p> <p>Essentially what I wanted to transfer the following function into the following lambda expression: (I realize it's a silly application, it just adds, but I'm exploring what I can...
17
2009-07-29T21:54:24Z
1,203,505
<p>You want the Y combinator, or some other <a href="http://en.wikipedia.org/wiki/Fixed%5Fpoint%5Fcombinator" rel="nofollow">fixed point combinator</a>.</p> <p>Here's an example implementation as a Python lambda expression:</p> <pre><code>Y = lambda g: (lambda f: g(lambda arg: f(f)(arg))) (lambda f: g(lambda arg: f(f...
0
2009-07-29T22:42:17Z
[ "python", "recursion", "lambda" ]
recursive lambda-expressions possible?
1,203,292
<p>I'm trying to write a lambda-expression that calls itself, but i can't seem to find any syntax for that, or even if it's possible.</p> <p>Essentially what I wanted to transfer the following function into the following lambda expression: (I realize it's a silly application, it just adds, but I'm exploring what I can...
17
2009-07-29T21:54:24Z
21,441,870
<p>a little late ... but I just found this gem @ <a href="http://metapython.blogspot.com/2010/11/recursive-lambda-functions.html" rel="nofollow">http://metapython.blogspot.com/2010/11/recursive-lambda-functions.html</a></p> <pre><code>def myself (*args, **kw): caller_frame = currentframe(1) code = caller_frame...
0
2014-01-29T20:24:49Z
[ "python", "recursion", "lambda" ]
can't see records inserted by django test case
1,203,295
<p>I'm trying to provide integration to my django application from subversion through the post commit hook.</p> <p>I have a django test case (a subclass of unittest.TestCase) that (a) inserts a couple of records into a table, (b) spawns an svn commit, (c) svn commit runs a hook that uses my django model to look up inf...
3
2009-07-29T21:55:29Z
1,203,379
<p>Are you using Django trunk? Recent changes (<a href="http://code.djangoproject.com/changeset/9756">Changeset 9756</a>) run tests in a transaction which is then rolled back. Here's the check-in comment:</p> <blockquote> <p>Fixed #8138 -- Changed django.test.TestCase to rollback tests (when the database support...
5
2009-07-29T22:17:16Z
[ "python", "django", "testing", "sqlite" ]
can't see records inserted by django test case
1,203,295
<p>I'm trying to provide integration to my django application from subversion through the post commit hook.</p> <p>I have a django test case (a subclass of unittest.TestCase) that (a) inserts a couple of records into a table, (b) spawns an svn commit, (c) svn commit runs a hook that uses my django model to look up inf...
3
2009-07-29T21:55:29Z
1,203,393
<p>The test framework is not saving the data to the database, the data is cleaned once the tests have finished.</p>
1
2009-07-29T22:19:41Z
[ "python", "django", "testing", "sqlite" ]
Error in Django running on Apache/mod_wsgi
1,203,448
<p>Recently i asked a <a href="http://stackoverflow.com/questions/1195260/installing-django-with-modwsgi">question</a> regarding an error in apache/mod_wsgi recognizing the python script directory. The community kindly answered the question resulting in a successful installation. Now I have a different error, the serve...
1
2009-07-29T22:31:34Z
1,203,465
<p>Try <strong>manage.py syncdb</strong> to make sure that django can connect to the database and that all the tables are created.</p>
0
2009-07-29T22:34:18Z
[ "python", "django", "apache", "sqlite3", "mod-wsgi" ]
Error in Django running on Apache/mod_wsgi
1,203,448
<p>Recently i asked a <a href="http://stackoverflow.com/questions/1195260/installing-django-with-modwsgi">question</a> regarding an error in apache/mod_wsgi recognizing the python script directory. The community kindly answered the question resulting in a successful installation. Now I have a different error, the serve...
1
2009-07-29T22:31:34Z
1,203,792
<p>You don't have a database. It's not clear why you don't have a sqlite3 driver. However, you don't have sqlite3 and you don't have a database.</p> <ol> <li><p>Run manage.py syncdb build the database. </p> <ul> <li><p>Be sure to use the same <code>settings.py</code> as your production instance. </p></li> <li><p>...
6
2009-07-30T00:19:08Z
[ "python", "django", "apache", "sqlite3", "mod-wsgi" ]
Error in Django running on Apache/mod_wsgi
1,203,448
<p>Recently i asked a <a href="http://stackoverflow.com/questions/1195260/installing-django-with-modwsgi">question</a> regarding an error in apache/mod_wsgi recognizing the python script directory. The community kindly answered the question resulting in a successful installation. Now I have a different error, the serve...
1
2009-07-29T22:31:34Z
1,204,119
<p>I solve the problem adding the sqlite3 binaries directory to the PYTHONPATH environment variable.</p>
1
2009-07-30T02:18:25Z
[ "python", "django", "apache", "sqlite3", "mod-wsgi" ]
Error in Django running on Apache/mod_wsgi
1,203,448
<p>Recently i asked a <a href="http://stackoverflow.com/questions/1195260/installing-django-with-modwsgi">question</a> regarding an error in apache/mod_wsgi recognizing the python script directory. The community kindly answered the question resulting in a successful installation. Now I have a different error, the serve...
1
2009-07-29T22:31:34Z
1,512,070
<p>Just fixed a problem similar. I think you have to add your app name to the INSTALLED_APPS list in settings.py.</p>
0
2009-10-02T22:19:33Z
[ "python", "django", "apache", "sqlite3", "mod-wsgi" ]
Error in Django running on Apache/mod_wsgi
1,203,448
<p>Recently i asked a <a href="http://stackoverflow.com/questions/1195260/installing-django-with-modwsgi">question</a> regarding an error in apache/mod_wsgi recognizing the python script directory. The community kindly answered the question resulting in a successful installation. Now I have a different error, the serve...
1
2009-07-29T22:31:34Z
8,866,318
<p>None of these were right for me when I was trying to run manage.py dbshell, but then it is 3 years later, and I'm on 10.7. I added my mysql path to my PATH variable like this:</p> <p>PATH=$PATH:/usr/local/mysql-5.5.16-osx10.6-x86_64/bin</p> <p>Actually, it's better to put this into your .profile file. With Mac OS ...
0
2012-01-14T23:36:55Z
[ "python", "django", "apache", "sqlite3", "mod-wsgi" ]
How to write an application for the system tray in Linux
1,203,451
<p>How do I write my application so it'll live in the system tray on Linux? In fact, just like <a href="http://checkgmail.sourceforge.net/">CheckGmail</a>.</p> <p>As with CheckGmail, I'd also like some sort of popup box to appear when I hover the tray icon.</p> <p>Is there an API, class or something for doing this? A...
20
2009-07-29T22:31:39Z
1,203,476
<p>This might help:</p> <p><a href="http://standards.freedesktop.org/systemtray-spec/systemtray-spec-latest.html">http://standards.freedesktop.org/systemtray-spec/systemtray-spec-latest.html</a></p>
11
2009-07-29T22:37:45Z
[ "c++", "python", "c", "linux", "system-tray" ]
How to write an application for the system tray in Linux
1,203,451
<p>How do I write my application so it'll live in the system tray on Linux? In fact, just like <a href="http://checkgmail.sourceforge.net/">CheckGmail</a>.</p> <p>As with CheckGmail, I'd also like some sort of popup box to appear when I hover the tray icon.</p> <p>Is there an API, class or something for doing this? A...
20
2009-07-29T22:31:39Z
1,203,482
<h1>python-eggtrayicon</h1> <p>here's the example that comes with the debian package <code>python-eggtrayicon</code> in debian/testing...</p> <pre><code>#!/usr/bin/python import pygtk pygtk.require("2.0") import gtk import egg.trayicon t = egg.trayicon.TrayIcon("MyFirstTrayIcon") t.add(gtk.Label("Hello")) t.show_all(...
8
2009-07-29T22:38:30Z
[ "c++", "python", "c", "linux", "system-tray" ]
How to write an application for the system tray in Linux
1,203,451
<p>How do I write my application so it'll live in the system tray on Linux? In fact, just like <a href="http://checkgmail.sourceforge.net/">CheckGmail</a>.</p> <p>As with CheckGmail, I'd also like some sort of popup box to appear when I hover the tray icon.</p> <p>Is there an API, class or something for doing this? A...
20
2009-07-29T22:31:39Z
1,203,493
<p><a href="http://qt.nokia.com/" rel="nofollow">Qt</a> is cross platform and has support for the system tray. Its <a href="http://www.riverbankcomputing.co.uk/software/pyqt/download" rel="nofollow">Python bindings</a> are pretty good as well. See the <a href="http://doc.qt.nokia.com/4.5/desktop-systray.html" rel="no...
4
2009-07-29T22:41:09Z
[ "c++", "python", "c", "linux", "system-tray" ]
How to write an application for the system tray in Linux
1,203,451
<p>How do I write my application so it'll live in the system tray on Linux? In fact, just like <a href="http://checkgmail.sourceforge.net/">CheckGmail</a>.</p> <p>As with CheckGmail, I'd also like some sort of popup box to appear when I hover the tray icon.</p> <p>Is there an API, class or something for doing this? A...
20
2009-07-29T22:31:39Z
1,203,504
<p>The Qt framework contains a <a href="http://doc.qt.io/qt-5/qsystemtrayicon.html" rel="nofollow">QSystemTrayIcon</a> class. This means that you can write an application in C++ or Python (or any other <a href="http://www.qtsoftware.com/products/programming-language-support" rel="nofollow">language with Qt bindings</a>...
24
2009-07-29T22:42:12Z
[ "c++", "python", "c", "linux", "system-tray" ]
How to write an application for the system tray in Linux
1,203,451
<p>How do I write my application so it'll live in the system tray on Linux? In fact, just like <a href="http://checkgmail.sourceforge.net/">CheckGmail</a>.</p> <p>As with CheckGmail, I'd also like some sort of popup box to appear when I hover the tray icon.</p> <p>Is there an API, class or something for doing this? A...
20
2009-07-29T22:31:39Z
30,048,543
<p>From a python prompt try this.</p> <pre><code>import gtk icon = gtk.StatusIcon() icon.set_from_stock(gtk.STOCK_ABOUT) gtk.main() </code></pre> <p>You should see an icon in the system tray.</p> <p>See this <a href="http://eurion.net/python-snippets/snippet/Systray%20icon.html" rel="nofollow">snippet</a> for a bi...
1
2015-05-05T09:03:14Z
[ "c++", "python", "c", "linux", "system-tray" ]
Django equivalent of New Relic RPM for Rails?
1,203,494
<p>Does Django have anything equivalent to the New Relic RPM performance monitoring app for Rails (<a href="http://www.newrelic.com/">http://www.newrelic.com/</a>)?</p> <p>Looking to do an app in Django, but would really like to be able to use something like New Relic for monitoring performance.</p>
7
2009-07-29T22:41:10Z
1,203,543
<p>None that I'm aware. django-debug-toolbar is a fairly popular app which can provide you with performance info for a particular page, but feature-wise it doesn't even come close to what the New Relic demo shows (I have no experience with NR/RoR myself).</p>
3
2009-07-29T22:53:15Z
[ "python", "django" ]
Django equivalent of New Relic RPM for Rails?
1,203,494
<p>Does Django have anything equivalent to the New Relic RPM performance monitoring app for Rails (<a href="http://www.newrelic.com/">http://www.newrelic.com/</a>)?</p> <p>Looking to do an app in Django, but would really like to be able to use something like New Relic for monitoring performance.</p>
7
2009-07-29T22:41:10Z
3,160,780
<p>Sorry that New Relic doesn't support Python web apps (and therefore Django) at this time, but it is definitely something we are looking at for the long term roadmap. It may be too late for your current requirements, but stay tuned as we continue to build out our footprint. Good luck!</p> <p>Lew Cirne Founder and ...
2
2010-07-01T18:50:25Z
[ "python", "django" ]
Django equivalent of New Relic RPM for Rails?
1,203,494
<p>Does Django have anything equivalent to the New Relic RPM performance monitoring app for Rails (<a href="http://www.newrelic.com/">http://www.newrelic.com/</a>)?</p> <p>Looking to do an app in Django, but would really like to be able to use something like New Relic for monitoring performance.</p>
7
2009-07-29T22:41:10Z
7,374,925
<p>YES! We (New Relic) just announced our Python agent at DjangoCon this week. Sign up at newrelic.com and enjoy!</p>
7
2011-09-10T21:49:58Z
[ "python", "django" ]
How do I limit the border size on a matplotlib graph?
1,203,639
<p>I'm making some pretty big graphs, and the whitespace in the border is taking up a lot of pixels that would be better used by data. It seems that the border grows as the graph grows.</p> <p>Here are the guts of my graphing code:</p> <pre><code> import matplotlib from pylab import figure fig...
7
2009-07-29T23:29:21Z
1,204,848
<p>Try the <a href="http://matplotlib.sourceforge.net/api/figure%5Fapi.html#matplotlib.figure.Figure.subplots%5Fadjust"><code>subplots_adjust</code></a> API:</p> <blockquote> <p>subplots_adjust(*args, **kwargs)</p> <p>fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None)</p> <p>...
5
2009-07-30T06:45:10Z
[ "python", "graph", "matplotlib", "plot" ]
How do I limit the border size on a matplotlib graph?
1,203,639
<p>I'm making some pretty big graphs, and the whitespace in the border is taking up a lot of pixels that would be better used by data. It seems that the border grows as the graph grows.</p> <p>Here are the guts of my graphing code:</p> <pre><code> import matplotlib from pylab import figure fig...
7
2009-07-29T23:29:21Z
1,207,711
<p>Since it looks like you're just using a single subplot, you may want to skip <code>add_subplot</code> and go straight to <a href="http://matplotlib.sourceforge.net/api/figure%5Fapi.html#matplotlib.figure.Figure.add%5Faxes"><code>add_axes</code></a>. This will allow you to give the size of the axes (in figure-relati...
6
2009-07-30T16:23:51Z
[ "python", "graph", "matplotlib", "plot" ]
JTIP file format reader for python
1,203,640
<p>I have to work with some image files. They are named as .png and .jpg, but I tried 3 different image viewers, and none of them could open the files. I found out that the first 8 bytes of these files were CF10rUrm, and DROID told me it was a JTIP (JPEG Tiled Image Pyramid).</p> <p>I need to use these from Python. Do...
1
2009-07-29T23:29:31Z
1,203,861
<p>With a fast search I found a <a href="http://adrresources.coalliance.org/wiki/index.php/Tiler_Python_Code" rel="nofollow">Python script</a> that might do what you want.</p>
-1
2009-07-30T00:42:48Z
[ "python", "image", "file", "jpeg" ]
Django and fcgi - logging question
1,203,896
<p>I have a site running in Django. Frontend is lighttpd and is using fcgi to host django.</p> <p>I start my fcgi processes as follows:</p> <pre><code>python2.6 /&lt;snip&gt;/manage.py runfcgi maxrequests=10 host=127.0.0.1 port=8000 pidfile=django.pid </code></pre> <p>For logging, I have a RotatingFileHandler define...
5
2009-07-30T00:52:03Z
1,204,141
<p>In your shoes I'd switch to a <a href="http://docs.python.org/library/logging.handlers.html#timedrotatingfilehandler" rel="nofollow">TimedRotatingFileHandler</a> -- I'm surprised that the size-based rotating file handles is giving this problem (as it should be impervious to what processes are producing the log entri...
2
2009-07-30T02:25:32Z
[ "python", "django", "logging", "fastcgi", "lighttpd" ]
Django and fcgi - logging question
1,203,896
<p>I have a site running in Django. Frontend is lighttpd and is using fcgi to host django.</p> <p>I start my fcgi processes as follows:</p> <pre><code>python2.6 /&lt;snip&gt;/manage.py runfcgi maxrequests=10 host=127.0.0.1 port=8000 pidfile=django.pid </code></pre> <p>For logging, I have a RotatingFileHandler define...
5
2009-07-30T00:52:03Z
1,206,060
<p>As you appear to be using the default file opening mode of append ("a") rather than write ("w"), if a process re-spawns it should append to the existing file, then rollover when the size limit is reached. So I am not sure that what you are seeing is caused by re-spawning CGI processes. (This of course assumes that t...
0
2009-07-30T11:40:40Z
[ "python", "django", "logging", "fastcgi", "lighttpd" ]
Django and fcgi - logging question
1,203,896
<p>I have a site running in Django. Frontend is lighttpd and is using fcgi to host django.</p> <p>I start my fcgi processes as follows:</p> <pre><code>python2.6 /&lt;snip&gt;/manage.py runfcgi maxrequests=10 host=127.0.0.1 port=8000 pidfile=django.pid </code></pre> <p>For logging, I have a RotatingFileHandler define...
5
2009-07-30T00:52:03Z
2,149,920
<p>As Alex stated, logging is thread-safe, but the standard handlers cannot be safely used to log from multiple processes into a single file.</p> <p><a href="http://pypi.python.org/pypi/ConcurrentLogHandler/0.8.2">ConcurrentLogHandler</a> uses file locking to allow for logging from within multiple processes.</p>
6
2010-01-27T20:12:10Z
[ "python", "django", "logging", "fastcgi", "lighttpd" ]
NoReverseMatch Exception help in Django
1,204,138
<p>I'm fairly new to python and following along with part 4 of the tutorial for the Django framework <a href="http://docs.djangoproject.com/en/1.0/intro/tutorial04/#intro-tutorial04">here</a>. I'm trying to implement generic views for the polls app--my code seems correct (as far as I can tell), but when I try to vote, ...
10
2009-07-30T02:24:17Z
1,204,314
<p>Try using:</p> <pre><code>return HttpResponseRedirect(reverse('poll_results', kwargs={'object_id': p.id})) </code></pre>
5
2009-07-30T03:27:37Z
[ "python", "django", "exception", "syntax", "django-generic-views" ]
NoReverseMatch Exception help in Django
1,204,138
<p>I'm fairly new to python and following along with part 4 of the tutorial for the Django framework <a href="http://docs.djangoproject.com/en/1.0/intro/tutorial04/#intro-tutorial04">here</a>. I'm trying to implement generic views for the polls app--my code seems correct (as far as I can tell), but when I try to vote, ...
10
2009-07-30T02:24:17Z
1,204,537
<p>Are you sure that's where your error really is? Based on the error message, it sounds like either in a view or in a template you are trying to reverse <code>'polls/poll_results'</code> (in a template, you may be doing something like <code>{% url polls/poll_results poll.pk %}</code>)</p>
1
2009-07-30T05:03:00Z
[ "python", "django", "exception", "syntax", "django-generic-views" ]
NoReverseMatch Exception help in Django
1,204,138
<p>I'm fairly new to python and following along with part 4 of the tutorial for the Django framework <a href="http://docs.djangoproject.com/en/1.0/intro/tutorial04/#intro-tutorial04">here</a>. I'm trying to implement generic views for the polls app--my code seems correct (as far as I can tell), but when I try to vote, ...
10
2009-07-30T02:24:17Z
8,859,723
<p>I've tried the solution provided as answer and didn't worked for me. In my case i was getting the same error (following the same tutorial) and the problem was that the name of the view in the urls.py file was a bit different that in the views.py (because a typing error).</p>
0
2012-01-14T02:38:46Z
[ "python", "django", "exception", "syntax", "django-generic-views" ]
NoReverseMatch Exception help in Django
1,204,138
<p>I'm fairly new to python and following along with part 4 of the tutorial for the Django framework <a href="http://docs.djangoproject.com/en/1.0/intro/tutorial04/#intro-tutorial04">here</a>. I'm trying to implement generic views for the polls app--my code seems correct (as far as I can tell), but when I try to vote, ...
10
2009-07-30T02:24:17Z
11,946,236
<p>I could not find any explanation that fixed the problem, until I ran across this person's abridged Django tutorial: <a href="http://tony.abou-assaleh.net/web-development/stripped-down-django-tutorial" rel="nofollow">http://tony.abou-assaleh.net/web-development/stripped-down-django-tutorial</a></p> <p>It's basically...
1
2012-08-14T05:29:31Z
[ "python", "django", "exception", "syntax", "django-generic-views" ]
Python: \number Backreference in re.sub
1,204,223
<p>I'm trying to use python's re.sub function to replace some text.</p> <pre><code>&gt;&gt;&gt; import re &gt;&gt;&gt; text = "&lt;hi type=\"italic\"&gt; the&gt;&lt;/hi&gt;" &gt;&gt;&gt; pat_error = re.compile("&gt;(\s*\w*)*&gt;") &gt;&gt;&gt; pat_error.search(text) &lt;_sre.SRE_Match object at 0xb7a3fea0&gt; &gt;&gt;...
1
2009-07-30T03:01:34Z
1,204,239
<pre><code>&gt;&gt;&gt; text.replace("&gt;&lt;", "&lt;") '&lt;hi type="italic"&gt; the&lt;/hi&gt;' </code></pre>
0
2009-07-30T03:05:21Z
[ "python", "regex", "backreference" ]
Python: \number Backreference in re.sub
1,204,223
<p>I'm trying to use python's re.sub function to replace some text.</p> <pre><code>&gt;&gt;&gt; import re &gt;&gt;&gt; text = "&lt;hi type=\"italic\"&gt; the&gt;&lt;/hi&gt;" &gt;&gt;&gt; pat_error = re.compile("&gt;(\s*\w*)*&gt;") &gt;&gt;&gt; pat_error.search(text) &lt;_sre.SRE_Match object at 0xb7a3fea0&gt; &gt;&gt;...
1
2009-07-30T03:01:34Z
1,204,270
<p>Two bugs in your code. First, you're not matching (and specifically, capturing) what you think you're matching and capturing -- insert after your call to <code>.search</code>:</p> <pre><code>&gt;&gt;&gt; _.groups() ('',) </code></pre> <p>The unconstrained repetition of repetitions (star after a capturing group wit...
9
2009-07-30T03:13:55Z
[ "python", "regex", "backreference" ]
\r\n vs \n in python eval function
1,204,376
<p>Why eval function doesn't work with \r\n but with \n. for example eval("for i in range(5):\r\n print 'hello'") doesn't work eval("for i in range(5):\n print 'hello'") works</p> <p>I know there is not a problem cause using replace("\r","") is corrected, but someone knows why happens?</p> <p>--Edit-- Oh! sorry...
4
2009-07-30T03:51:23Z
1,204,403
<p>Do you mean eval or exec? Please post exactly what you ran, plus the full traceback and error message.</p> <p>The problem is probably because the Python grammar says that lines are terminated by newlines ('\n'), not the two-character sequence '\r\n'.</p> <p>In general, it would be safer for you to use replace('\r\...
1
2009-07-30T04:03:51Z
[ "python", "eval" ]
\r\n vs \n in python eval function
1,204,376
<p>Why eval function doesn't work with \r\n but with \n. for example eval("for i in range(5):\r\n print 'hello'") doesn't work eval("for i in range(5):\n print 'hello'") works</p> <p>I know there is not a problem cause using replace("\r","") is corrected, but someone knows why happens?</p> <p>--Edit-- Oh! sorry...
4
2009-07-30T03:51:23Z
1,204,472
<p>You have a strange definition of "work":</p> <pre><code>&gt;&gt;&gt; eval("for i in range(5):\n print 'hello'") Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "&lt;string&gt;", line 1 for i in range(5): ^ SyntaxError: invalid syntax &gt;&gt;&gt; </code></pre> ...
6
2009-07-30T04:37:45Z
[ "python", "eval" ]
Getting total/free RAM from within Python
1,204,378
<p>From within a Python application, how can I get the total amount of RAM of the system and how much of it is currently free, in a cross-platform way?</p> <p>Ideally, the amount of free RAM should consider only physical memory that can actually be allocated to the Python process.</p>
9
2009-07-30T03:52:42Z
1,204,394
<p>You can't do this with just the standard Python library, although there might be some third party package that does it. Barring that, you can use the os package to determine which operating system you're on and use that information to acquire the info you want for that system (and encapsulate that into a single cro...
3
2009-07-30T03:59:07Z
[ "python", "wxpython" ]
Getting total/free RAM from within Python
1,204,378
<p>From within a Python application, how can I get the total amount of RAM of the system and how much of it is currently free, in a cross-platform way?</p> <p>Ideally, the amount of free RAM should consider only physical memory that can actually be allocated to the Python process.</p>
9
2009-07-30T03:52:42Z
1,204,410
<p>Have you tried <a href="http://support.hyperic.com/display/SIGAR/Home">SIGAR - System Information Gatherer And Reporter</a>? After install</p> <pre><code>import os, sigar sg = sigar.open() mem = sg.mem() sg.close() print mem.total() / 1024, mem.free() / 1024 </code></pre> <p>Hope this helps</p>
12
2009-07-30T04:06:21Z
[ "python", "wxpython" ]
Getting total/free RAM from within Python
1,204,378
<p>From within a Python application, how can I get the total amount of RAM of the system and how much of it is currently free, in a cross-platform way?</p> <p>Ideally, the amount of free RAM should consider only physical memory that can actually be allocated to the Python process.</p>
9
2009-07-30T03:52:42Z
1,204,839
<p>For the free memory part, there is a function in the wx library:</p> <pre><code>wx.GetFreeMemory() </code></pre> <p>Unfortunately, this only works on Windows. Linux and Mac ports either return "-1" or raise a <code>NotImplementedError</code>.</p>
6
2009-07-30T06:43:20Z
[ "python", "wxpython" ]
Getting total/free RAM from within Python
1,204,378
<p>From within a Python application, how can I get the total amount of RAM of the system and how much of it is currently free, in a cross-platform way?</p> <p>Ideally, the amount of free RAM should consider only physical memory that can actually be allocated to the Python process.</p>
9
2009-07-30T03:52:42Z
14,371,887
<p><a href="http://code.google.com/p/psutil/">psutil</a> would be another good choice. It also needs a library installed however.</p> <pre><code>&gt;&gt;&gt; import psutil &gt;&gt;&gt; psutil.virtual_memory() vmem(total=8374149120L, available=2081050624L, percent=75.1, used=8074080256L, free=300068864L, active=3...
6
2013-01-17T03:41:47Z
[ "python", "wxpython" ]