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 list |
|---|---|---|---|---|---|---|---|---|---|
Python underlying analysis books/articles? | 2,193,829 | <p>Does anyone know good books that discuss the underlying architectures, in-depth analysis of CPython implementation. Something like</p>
<ul>
<li>how list / tuple / dict implemented (and performance comparison...)</li>
<li>OOP discussion in Python context</li>
</ul>
<p>Sorry if it sounds like a silly question :(</p>... | 0 | 2010-02-03T17:15:57Z | 2,193,928 | <p>This doesn't directly answer your question but it's useful to know nevertheless:</p>
<p>The source code of CPython is well-written and well-documented, and there are some PEPs that shed light on parts of the implementation. You should really try just reading it.</p>
| 2 | 2010-02-03T17:28:56Z | [
"python",
"performance",
"architecture",
"comparison"
] |
Python underlying analysis books/articles? | 2,193,829 | <p>Does anyone know good books that discuss the underlying architectures, in-depth analysis of CPython implementation. Something like</p>
<ul>
<li>how list / tuple / dict implemented (and performance comparison...)</li>
<li>OOP discussion in Python context</li>
</ul>
<p>Sorry if it sounds like a silly question :(</p>... | 0 | 2010-02-03T17:15:57Z | 2,194,108 | <p><strong>Python features are described and discussed in <a href="http://www.python.org/dev/peps/" rel="nofollow">Python Enhancement Proposals ("PEPs")</a></strong> These describe the implementation, also <strong>PEPs often contain working Python Code to help explain the algorithm</strong> though the final implementat... | 3 | 2010-02-03T17:51:32Z | [
"python",
"performance",
"architecture",
"comparison"
] |
Python underlying analysis books/articles? | 2,193,829 | <p>Does anyone know good books that discuss the underlying architectures, in-depth analysis of CPython implementation. Something like</p>
<ul>
<li>how list / tuple / dict implemented (and performance comparison...)</li>
<li>OOP discussion in Python context</li>
</ul>
<p>Sorry if it sounds like a silly question :(</p>... | 0 | 2010-02-03T17:15:57Z | 2,194,142 | <p>You should absolutely, at some point in your Python career, read every word of the <a href="http://docs.python.org/reference/datamodel.html" rel="nofollow">Python Data Model</a> and the <a href="http://docs.python.org/reference/executionmodel.html" rel="nofollow">Python Execution Model</a>. While not CPython-specif... | 3 | 2010-02-03T17:56:13Z | [
"python",
"performance",
"architecture",
"comparison"
] |
Set the hardware clock in Python? | 2,193,964 | <p>How do I set the hardware clock with Python on embedded Linux systems?</p>
| 5 | 2010-02-03T17:33:14Z | 2,194,029 | <p>Probably no easy way other than doing an os.system() call.</p>
<pre><code>import os
os.system('hwclock --set %s' % date_str)
</code></pre>
<p>or using the 'date' command</p>
<pre><code>import os
os.system('date -s %s' % date_str)
</code></pre>
<p>or if you are dying to do some c coding, wrapping the system calls... | 9 | 2010-02-03T17:40:23Z | [
"python",
"linux",
"hwclock"
] |
Set the hardware clock in Python? | 2,193,964 | <p>How do I set the hardware clock with Python on embedded Linux systems?</p>
| 5 | 2010-02-03T17:33:14Z | 2,194,052 | <p>Use Python's <a href="http://docs.python.org/library/os.html#os.system" rel="nofollow">os.system</a> function to call the <a href="http://linux.die.net/man/8/hwclock" rel="nofollow">hwclock</a> command.</p>
| 1 | 2010-02-03T17:43:19Z | [
"python",
"linux",
"hwclock"
] |
Set the hardware clock in Python? | 2,193,964 | <p>How do I set the hardware clock with Python on embedded Linux systems?</p>
| 5 | 2010-02-03T17:33:14Z | 19,477,201 | <p>An alternative solution is provided by tMC in their answer to <a href="http://stackoverflow.com/q/12081310/562930">Python module to change system date and time</a>.</p>
<p>The Linux-based portion of the answer uses Python's ctypes to dynamically load the rt library and then call the function <code>clock_settime()</... | 1 | 2013-10-20T12:14:40Z | [
"python",
"linux",
"hwclock"
] |
QPushButton FocusIn generates which signal? | 2,194,158 | <p>I am creating a small PyQt application and got stuck up in MouseOver effect.</p>
<p>I have a <code>QMainWindow</code> which has three buttons named <code>createProfileButton</code>, <code>downloadPackagesButton</code> and <code>installPackagesButton</code>. All these are of type <code>QPushButton</code></p>
<p>Now... | 4 | 2010-02-03T17:58:01Z | 2,194,482 | <p>As you stated, no signals exist for this functionality. You have two basic options.</p>
<p><strong>Option 1</strong> - Subclass:</p>
<pre><code>class FocusEmittingButton(QPushButton):
#...
def focusInEvent(self, event):
# emit your signal
</code></pre>
<p>You can then connect to that signal in yo... | 4 | 2010-02-03T18:42:28Z | [
"python",
"qt",
"focus",
"pyqt",
"signals-slots"
] |
QPushButton FocusIn generates which signal? | 2,194,158 | <p>I am creating a small PyQt application and got stuck up in MouseOver effect.</p>
<p>I have a <code>QMainWindow</code> which has three buttons named <code>createProfileButton</code>, <code>downloadPackagesButton</code> and <code>installPackagesButton</code>. All these are of type <code>QPushButton</code></p>
<p>Now... | 4 | 2010-02-03T17:58:01Z | 3,273,516 | <p>There is another way to receive focus signals in a parent widget. You can add an event filter:</p>
<pre><code>class MyParent(QWidget):
def __init__(self):
#...
self.mybutton.installEventFilter()
def eventFilter(self, obj, event):
if obj is self.mybutton and event.type() == QEvent.Fo... | 1 | 2010-07-17T22:25:29Z | [
"python",
"qt",
"focus",
"pyqt",
"signals-slots"
] |
python empty argument | 2,194,163 | <p>how do I print help info if no arguments are passed to python script?</p>
<pre><code>#!/usr/bin/env python
import sys
for arg in sys.argv:
if arg == "do":
do this
if arg == ""
print "usage is bla bla bla"
</code></pre>
<p>what I'm missing is <code>if arg == ""</code> line that I don't kno... | 10 | 2010-02-03T17:58:54Z | 2,194,175 | <pre><code>if len(sys.argv)<2:
</code></pre>
<p>The name of the program is always in sys.argv[0]</p>
| 9 | 2010-02-03T18:00:47Z | [
"python"
] |
python empty argument | 2,194,163 | <p>how do I print help info if no arguments are passed to python script?</p>
<pre><code>#!/usr/bin/env python
import sys
for arg in sys.argv:
if arg == "do":
do this
if arg == ""
print "usage is bla bla bla"
</code></pre>
<p>what I'm missing is <code>if arg == ""</code> line that I don't kno... | 10 | 2010-02-03T17:58:54Z | 2,194,187 | <pre><code>if len(sys.argv) == 1:
# Print usage...
</code></pre>
<p>The first element of sys.argv is always either the name of the script itself, or an empty string. If sys.argv has only one element, then there must have been no arguments.</p>
<p><a href="http://docs.python.org/library/sys.html#sys.argv">http://d... | 15 | 2010-02-03T18:02:36Z | [
"python"
] |
python empty argument | 2,194,163 | <p>how do I print help info if no arguments are passed to python script?</p>
<pre><code>#!/usr/bin/env python
import sys
for arg in sys.argv:
if arg == "do":
do this
if arg == ""
print "usage is bla bla bla"
</code></pre>
<p>what I'm missing is <code>if arg == ""</code> line that I don't kno... | 10 | 2010-02-03T17:58:54Z | 2,194,192 | <pre><code>#!/usr/bin/env python
import sys
args = sys.argv[1:]
if args:
for arg in args:
if arg == "do":
# do this
else:
print "usage is bla bla bla"
</code></pre>
| 1 | 2010-02-03T18:03:01Z | [
"python"
] |
python empty argument | 2,194,163 | <p>how do I print help info if no arguments are passed to python script?</p>
<pre><code>#!/usr/bin/env python
import sys
for arg in sys.argv:
if arg == "do":
do this
if arg == ""
print "usage is bla bla bla"
</code></pre>
<p>what I'm missing is <code>if arg == ""</code> line that I don't kno... | 10 | 2010-02-03T17:58:54Z | 2,194,902 | <p>Based on Noctis Skytower's answer</p>
<pre><code>import sys
args = sys.argv[1:]
for arg in args:
if arg == "do":
# do this
if not args:
print "usage is bla bla bla"
</code></pre>
| 1 | 2010-02-03T19:43:41Z | [
"python"
] |
python empty argument | 2,194,163 | <p>how do I print help info if no arguments are passed to python script?</p>
<pre><code>#!/usr/bin/env python
import sys
for arg in sys.argv:
if arg == "do":
do this
if arg == ""
print "usage is bla bla bla"
</code></pre>
<p>what I'm missing is <code>if arg == ""</code> line that I don't kno... | 10 | 2010-02-03T17:58:54Z | 2,195,299 | <p>As others have said, you can check if any args were passed in by doing:</p>
<pre><code>#!/usr/bin/env python
import sys
args = sys.argv[1:]
if args:
for arg in args:
if arg == "do":
# do this
else:
print "usage is bla bla bla"
</code></pre>
<p>However, there is a Python module called ... | 4 | 2010-02-03T20:43:55Z | [
"python"
] |
python empty argument | 2,194,163 | <p>how do I print help info if no arguments are passed to python script?</p>
<pre><code>#!/usr/bin/env python
import sys
for arg in sys.argv:
if arg == "do":
do this
if arg == ""
print "usage is bla bla bla"
</code></pre>
<p>what I'm missing is <code>if arg == ""</code> line that I don't kno... | 10 | 2010-02-03T17:58:54Z | 2,196,925 | <p>I recommend you use the lib optparse [1], is more elegant :D</p>
<p>[1] More powerful command line option parser < <a href="http://docs.python.org/library/optparse.html" rel="nofollow">http://docs.python.org/library/optparse.html</a> ></p>
| 1 | 2010-02-04T02:10:19Z | [
"python"
] |
python empty argument | 2,194,163 | <p>how do I print help info if no arguments are passed to python script?</p>
<pre><code>#!/usr/bin/env python
import sys
for arg in sys.argv:
if arg == "do":
do this
if arg == ""
print "usage is bla bla bla"
</code></pre>
<p>what I'm missing is <code>if arg == ""</code> line that I don't kno... | 10 | 2010-02-03T17:58:54Z | 11,511,353 | <p>The following is a very Pythonic way of solving your problem, because it deliberately generates an exception within try .. except:</p>
<pre><code>import sys
try:
sys.argv[1:] // do sth with sys,argv[1:]
except IndexError:
print "usage is..."
sys.exit()
</code></pre>
| 3 | 2012-07-16T19:39:41Z | [
"python"
] |
python empty argument | 2,194,163 | <p>how do I print help info if no arguments are passed to python script?</p>
<pre><code>#!/usr/bin/env python
import sys
for arg in sys.argv:
if arg == "do":
do this
if arg == ""
print "usage is bla bla bla"
</code></pre>
<p>what I'm missing is <code>if arg == ""</code> line that I don't kno... | 10 | 2010-02-03T17:58:54Z | 31,854,625 | <pre><code>import argparse
def parse_args():
parser = argparse.ArgumentParser(
add_help=True,
)
# your arguments here
if len(sys.argv) == 1:
parser.print_help()
sys.exit(0)
else:
options = parser.parse_args()
return options
</code></pre>
| 0 | 2015-08-06T11:30:03Z | [
"python"
] |
referencing static methods from class variable | 2,194,185 | <p>I know it's wired to have such a case but somehow I have it:</p>
<pre><code>class foo
#static method
@staticmethod
def test():
pass
# class variable
c = {'name' : <i want to reference test method here.>}
</code></pre>
<p>What's the way to it?</p>
<p><strong>Just for the record:</strong></p>
... | 2 | 2010-02-03T18:02:18Z | 2,194,214 | <pre><code>class Foo:
# static method
@staticmethod
def test():
pass
# class variable
c = {'name' : test }
</code></pre>
| 5 | 2010-02-03T18:05:59Z | [
"python",
"static-methods",
"class-variables"
] |
referencing static methods from class variable | 2,194,185 | <p>I know it's wired to have such a case but somehow I have it:</p>
<pre><code>class foo
#static method
@staticmethod
def test():
pass
# class variable
c = {'name' : <i want to reference test method here.>}
</code></pre>
<p>What's the way to it?</p>
<p><strong>Just for the record:</strong></p>
... | 2 | 2010-02-03T18:02:18Z | 2,199,030 | <p>The problem is static methods in python are descriptor objects. So in the following code:</p>
<pre><code>class Foo:
# static method
@staticmethod
def test():
pass
# class variable
c = {'name' : test }
</code></pre>
<p><code>Foo.c['name']</code> is the descriptor object, thus is not cal... | 3 | 2010-02-04T10:54:24Z | [
"python",
"static-methods",
"class-variables"
] |
In matplotlib, how to draw a bar graphs of multiple datasets to put smallest bars to front? | 2,194,299 | <p>I want to put multiple datasets on a bar graph and stop the smaller bars being obscured by the larger ones, and I don't want to offset them. For example,</p>
<p>bar(0, 1.)</p>
<p>bar(0, 2.) </p>
<p>only shows the second bar of height of 2.0, the first bar is hidden. Is there a way to get matplotlib to draw the ba... | 2 | 2010-02-03T18:18:54Z | 2,194,436 | <p>The bar method will return a matplotlib.patches.Rectangle object. The object has a set_zorder method. Setting the zorder of the first one higher than the second will place it on top.</p>
<p>You could "easily" order the z-order of elements by checking if they are at the same x and zordering based by height.</p>
<... | 3 | 2010-02-03T18:33:02Z | [
"python",
"matplotlib",
"plot"
] |
In matplotlib, how to draw a bar graphs of multiple datasets to put smallest bars to front? | 2,194,299 | <p>I want to put multiple datasets on a bar graph and stop the smaller bars being obscured by the larger ones, and I don't want to offset them. For example,</p>
<p>bar(0, 1.)</p>
<p>bar(0, 2.) </p>
<p>only shows the second bar of height of 2.0, the first bar is hidden. Is there a way to get matplotlib to draw the ba... | 2 | 2010-02-03T18:18:54Z | 2,195,059 | <p>Original:</p>
<pre><code>>>> from matplotlib import pylab
>>> data1 = [0.3, 0.9, 0.1]
>>> data2 = [3.0, 0.2, 0.5]
>>> colors = ['b','magenta','cyan']
>>> data_list = [data1,data2]
>>> num_bars = len(data_list)
>>> for i, d in enumerate(data_list):
... ... | 1 | 2010-02-03T20:07:56Z | [
"python",
"matplotlib",
"plot"
] |
In matplotlib, how to draw a bar graphs of multiple datasets to put smallest bars to front? | 2,194,299 | <p>I want to put multiple datasets on a bar graph and stop the smaller bars being obscured by the larger ones, and I don't want to offset them. For example,</p>
<p>bar(0, 1.)</p>
<p>bar(0, 2.) </p>
<p>only shows the second bar of height of 2.0, the first bar is hidden. Is there a way to get matplotlib to draw the ba... | 2 | 2010-02-03T18:18:54Z | 8,764,575 | <p>I know this is an old question, but I came across it for my own purposes, and since it seemed like something I'd do over and over, I put together a wrapper for the hist function (which is what I'll be using; modification to bar should be trivial):</p>
<pre><code>from matplotlib import pyplot as mpl
from numpy impor... | 3 | 2012-01-06T21:10:06Z | [
"python",
"matplotlib",
"plot"
] |
how to get to various attributes in the same order in python | 2,194,357 | <p>I have a file of lines and this in turn saves information, speed, timing and type of surfaces for each line. I want to do is sort this information in a np.array in the order shown below where the id is the number of the line.</p>
<pre><code>(id) 0 1 2 3 4 5 6 7 8 9
0 t1 t2 t3 t4 t5 t6 t7 t8 ... | 1 | 2010-02-03T18:25:21Z | 2,194,669 | <p>Maybe this will get you started...</p>
<pre><code>data ='''
(id) 0 1 2 3 4 5 6 7 8 9
0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
3 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
4 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
5 t1 t2 t3 t4 t5 t6 ... | 0 | 2010-02-03T19:07:43Z | [
"python",
"numpy"
] |
how to get to various attributes in the same order in python | 2,194,357 | <p>I have a file of lines and this in turn saves information, speed, timing and type of surfaces for each line. I want to do is sort this information in a np.array in the order shown below where the id is the number of the line.</p>
<pre><code>(id) 0 1 2 3 4 5 6 7 8 9
0 t1 t2 t3 t4 t5 t6 t7 t8 ... | 1 | 2010-02-03T18:25:21Z | 2,195,186 | <p>Your may find <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html" rel="nofollow">numpy.loadtxt</a> useful.</p>
<p>For example, suppose you have a file with these contents:</p>
<p>datafile:</p>
<pre><code>(id) 0 1
0 1 smooth
1 11 choppy
2 20 turbulent
3 2 smooth
4 ... | 2 | 2010-02-03T20:28:56Z | [
"python",
"numpy"
] |
Checking for properties' validity in Python classes | 2,194,479 | <p>Where should I write codes for checking validity of class' properties? (For examples: "amount" should be a positive integer, "email" should be a string with correct e-mail formatting) At the setter methods, At somewhere I use that (using try/catch), or others.</p>
<p>If I check validity at setter methods, it may be... | 6 | 2010-02-03T18:41:52Z | 2,194,552 | <p>Definitely do it in the setter, if you need to do it at all.</p>
<p>First, the setter is probably called less often than the getters, so you're doing less work. </p>
<p>Second, you catch the problem earlier.</p>
<p>Third, it keeps the internal state of the object consistent. Keeping out bad data means you know ... | 4 | 2010-02-03T18:52:21Z | [
"python"
] |
Checking for properties' validity in Python classes | 2,194,479 | <p>Where should I write codes for checking validity of class' properties? (For examples: "amount" should be a positive integer, "email" should be a string with correct e-mail formatting) At the setter methods, At somewhere I use that (using try/catch), or others.</p>
<p>If I check validity at setter methods, it may be... | 6 | 2010-02-03T18:41:52Z | 2,194,652 | <p>If it looks like ugly type checking, that may be because it is. If "amount" absolutely needs to be a positive integer, and the rest of the module will fail badly if it is not, then you need to do some type checking.</p>
<p>The python way of doing this, though, is only to check for the actual properties that you req... | 2 | 2010-02-03T19:03:54Z | [
"python"
] |
Is there something similar to python's enumerate for linq | 2,194,684 | <p>In python I can easily get an index when iterating e.g.</p>
<pre><code>>>> letters = ['a', 'b', 'c']
>>> [(char, i) for i, char in enumerate(letters)]
[('a', 0), ('b', 1), ('c', 2)]
</code></pre>
<p>How can I do something similar with linq?</p>
| 3 | 2010-02-03T19:09:37Z | 2,194,703 | <p>Sure. There is an <a href="http://msdn.microsoft.com/en-us/library/bb534869.aspx">overload of <code>Enumerable.Select</code></a> that takes a <code>Func<TSource, int, TResult></code> to project an element together with its index:</p>
<p>For example:</p>
<pre><code>char[] letters = new[] { 'a', 'b', 'c' };
va... | 8 | 2010-02-03T19:12:41Z | [
".net",
"python",
"linq"
] |
Is there something similar to python's enumerate for linq | 2,194,684 | <p>In python I can easily get an index when iterating e.g.</p>
<pre><code>>>> letters = ['a', 'b', 'c']
>>> [(char, i) for i, char in enumerate(letters)]
[('a', 0), ('b', 1), ('c', 2)]
</code></pre>
<p>How can I do something similar with linq?</p>
| 3 | 2010-02-03T19:09:37Z | 2,194,710 | <p>You can do this with the overload of <a href="http://msdn.microsoft.com/en-us/library/bb534869.aspx" rel="nofollow">Enumerable.Select</a> which provides an index variable. This provides access to the index, which you can use to generate a new anonymous type. The following compiles and runs properly:</p>
<pre><cod... | 4 | 2010-02-03T19:13:34Z | [
".net",
"python",
"linq"
] |
In Sphinx, is there a way to document parameters along with declaring them? | 2,194,777 | <p>I prefer to document each parameter (as needed) on the same line where I declare the parameter in order to apply <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">D.R.Y.</a></p>
<p>If I have code like this:</p>
<pre><code>def foo(
flab_nickers, # a series of under garments to process
h... | 11 | 2010-02-03T19:21:39Z | 2,194,814 | <p>I would do this.</p>
<p>Starting with this code.</p>
<pre><code>def foo(
flab_nickers, # a series of under garments to process
has_polka_dots=False,
needs_pressing=False # Whether the list of garments should all be pressed
):
...
</code></pre>
<p>I would write a parser that grabs t... | 8 | 2010-02-03T19:27:46Z | [
"python",
"restructuredtext",
"python-sphinx"
] |
In Sphinx, is there a way to document parameters along with declaring them? | 2,194,777 | <p>I prefer to document each parameter (as needed) on the same line where I declare the parameter in order to apply <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">D.R.Y.</a></p>
<p>If I have code like this:</p>
<pre><code>def foo(
flab_nickers, # a series of under garments to process
h... | 11 | 2010-02-03T19:21:39Z | 2,194,837 | <p>You can't do that without a preprocessor, as comments don't exist for Python once the source has been compiled. To avoid repeating yourself, remove the comments and document the parameters only in the docstring, this is the standard way to document your arguments.</p>
| 1 | 2010-02-03T19:31:45Z | [
"python",
"restructuredtext",
"python-sphinx"
] |
In Sphinx, is there a way to document parameters along with declaring them? | 2,194,777 | <p>I prefer to document each parameter (as needed) on the same line where I declare the parameter in order to apply <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">D.R.Y.</a></p>
<p>If I have code like this:</p>
<pre><code>def foo(
flab_nickers, # a series of under garments to process
h... | 11 | 2010-02-03T19:21:39Z | 18,452,035 | <p>Annotations are meant to partly address this problem in Python 3:</p>
<p><a href="http://www.python.org/dev/peps/pep-3107/" rel="nofollow">http://www.python.org/dev/peps/pep-3107/</a></p>
<p>I'm not sure if there has been any work in applying these to Sphinx yet.</p>
| 4 | 2013-08-26T19:57:50Z | [
"python",
"restructuredtext",
"python-sphinx"
] |
How to swap the QGraphicsScene from a QGraphicsView? | 2,194,829 | <p><code>QGraphicsView</code> is often hooked up to a <code>QGraphicsScene</code>. What if I want to swap that <code>QGraphicsScene</code> for a new one? How can I accomplish this? Doing it right now is just drawing over the old one.</p>
| 1 | 2010-02-03T19:31:05Z | 2,194,899 | <p>To swap the scene just call your view's <code>setScene()</code> again with a different <code>QGraphicsScene</code> object.</p>
| 0 | 2010-02-03T19:43:21Z | [
"python",
"pyqt"
] |
Where can I download the Django documentation? | 2,195,089 | <p>Django's website seems good but for some reason I couldn't find where to download the documentation:</p>
<p><a href="http://docs.djangoproject.com/en/1.1/">http://docs.djangoproject.com/en/1.1/</a></p>
<p>(Yes, I need the docs for 1.1)</p>
<p>Does anyone know?</p>
| 13 | 2010-02-03T20:13:11Z | 2,195,098 | <p>Django's documentation is built using <a href="http://sphinx.pocoo.org/index.html">Sphinx</a> and <a href="http://code.djangoproject.com/browser/django/trunk/docs">included in their source tree</a>.</p>
<p>From a checked-out copy of Django's source, just run <code>make</code> in the docs directory. You can find in... | 12 | 2010-02-03T20:15:22Z | [
"python",
"django",
"documentation"
] |
Where can I download the Django documentation? | 2,195,089 | <p>Django's website seems good but for some reason I couldn't find where to download the documentation:</p>
<p><a href="http://docs.djangoproject.com/en/1.1/">http://docs.djangoproject.com/en/1.1/</a></p>
<p>(Yes, I need the docs for 1.1)</p>
<p>Does anyone know?</p>
| 13 | 2010-02-03T20:13:11Z | 3,465,362 | <p><em>"Okay, I just did it manually using sphinx-build. It was a pretty bad experience."</em></p>
<p>Hmm. I just tried and it was a pretty smooth experience (and I have never done this before). Here's the Linux recipe: </p>
<ol>
<li>"cd" to the directory where your Django 1.2.x download has been extracted (in my ca... | 1 | 2010-08-12T06:55:58Z | [
"python",
"django",
"documentation"
] |
Where can I download the Django documentation? | 2,195,089 | <p>Django's website seems good but for some reason I couldn't find where to download the documentation:</p>
<p><a href="http://docs.djangoproject.com/en/1.1/">http://docs.djangoproject.com/en/1.1/</a></p>
<p>(Yes, I need the docs for 1.1)</p>
<p>Does anyone know?</p>
| 13 | 2010-02-03T20:13:11Z | 6,588,530 | <p>You can download offline documentation for Django 1.1, 1.2 and 1.3 in both PDF and HTML from <a href="http://sramana.github.com/dod/">http://sramana.github.com/dod/</a>.</p>
| 9 | 2011-07-05T20:32:55Z | [
"python",
"django",
"documentation"
] |
Where can I download the Django documentation? | 2,195,089 | <p>Django's website seems good but for some reason I couldn't find where to download the documentation:</p>
<p><a href="http://docs.djangoproject.com/en/1.1/">http://docs.djangoproject.com/en/1.1/</a></p>
<p>(Yes, I need the docs for 1.1)</p>
<p>Does anyone know?</p>
| 13 | 2010-02-03T20:13:11Z | 10,561,273 | <p>To generate PDF version in Ubuntu, you need to download 700-900 MB of Latex packages.
Even if you are not in a developing country, keeping a local copy of docs is useful. Just in case the Django site is down or when you need to refer to something while traveling.Django docs are written in ReStructuredText (RST) and ... | 0 | 2012-05-12T05:17:21Z | [
"python",
"django",
"documentation"
] |
Where can I download the Django documentation? | 2,195,089 | <p>Django's website seems good but for some reason I couldn't find where to download the documentation:</p>
<p><a href="http://docs.djangoproject.com/en/1.1/">http://docs.djangoproject.com/en/1.1/</a></p>
<p>(Yes, I need the docs for 1.1)</p>
<p>Does anyone know?</p>
| 13 | 2010-02-03T20:13:11Z | 12,428,868 | <p>Offline Documentation for Django <strong>1.2</strong>, <strong>1.3</strong> and <strong>1.4</strong> in various formats:</p>
<p><a href="http://readthedocs.org/projects/django/downloads/">http://readthedocs.org/projects/django/downloads/</a></p>
| 11 | 2012-09-14T16:56:38Z | [
"python",
"django",
"documentation"
] |
Where can I download the Django documentation? | 2,195,089 | <p>Django's website seems good but for some reason I couldn't find where to download the documentation:</p>
<p><a href="http://docs.djangoproject.com/en/1.1/">http://docs.djangoproject.com/en/1.1/</a></p>
<p>(Yes, I need the docs for 1.1)</p>
<p>Does anyone know?</p>
| 13 | 2010-02-03T20:13:11Z | 39,823,615 | <p>In the bottom of right sidebar there are links to zipped HTML version, PDF version and ePub version.</p>
<p><a href="https://docs.djangoproject.com/en/stable/" rel="nofollow">https://docs.djangoproject.com/en/stable/</a></p>
| 0 | 2016-10-03T01:57:06Z | [
"python",
"django",
"documentation"
] |
Need help using M2Crypto.Engine to access USB Token | 2,195,179 | <p>I am using M2Crypto-0.20.2. I want to use engine_pkcs11 from the OpenSC project and the Aladdin PKI client for token based authentication making xmlrpc calls over ssl.</p>
<pre><code>from M2Crypto import Engine
Engine.load_dynamic()
dynamic = Engine.Engine('dynamic')
# Load the engine_pkcs from the OpenSC project
... | 2 | 2010-02-03T20:28:11Z | 2,196,140 | <p>Looking at the <a href="http://fronted.pastebin.ca/549820" rel="nofollow">pastebin link</a> Becky provided, I believe it translates to something like this in the new API:</p>
<pre><code>from M2Crypto import Engine, m2
dynamic = Engine.load_dynamic_engine("pkcs11", "/Users/martin/prefix/lib/engines/engine_pkcs11.so... | 0 | 2010-02-03T22:54:51Z | [
"python",
"m2crypto"
] |
Need help using M2Crypto.Engine to access USB Token | 2,195,179 | <p>I am using M2Crypto-0.20.2. I want to use engine_pkcs11 from the OpenSC project and the Aladdin PKI client for token based authentication making xmlrpc calls over ssl.</p>
<pre><code>from M2Crypto import Engine
Engine.load_dynamic()
dynamic = Engine.Engine('dynamic')
# Load the engine_pkcs from the OpenSC project
... | 2 | 2010-02-03T20:28:11Z | 2,199,194 | <p>That is exactly the code I've tried. But It ended with the following error:</p>
<pre><code>Traceback (most recent call last):
File "prog9.py", line 13, in <module>
key = pkcs11.load_private_key("id_45")
File "/usr/lib/pymodules/python2.5/M2Crypto/Engine.py", line 70, in load_private_key
return sel... | 0 | 2010-02-04T11:22:24Z | [
"python",
"m2crypto"
] |
Need help using M2Crypto.Engine to access USB Token | 2,195,179 | <p>I am using M2Crypto-0.20.2. I want to use engine_pkcs11 from the OpenSC project and the Aladdin PKI client for token based authentication making xmlrpc calls over ssl.</p>
<pre><code>from M2Crypto import Engine
Engine.load_dynamic()
dynamic = Engine.Engine('dynamic')
# Load the engine_pkcs from the OpenSC project
... | 2 | 2010-02-03T20:28:11Z | 2,200,311 | <p>I tried the code that Heikki suggested (minus one line) and got the same error as Erlo. For load_private_key(), how do I know what to put in for the argument? </p>
<pre><code>dynamic = Engine.load_dynamic_engine("pkcs11", "/usr/local/ssl/lib/engines/engine_pkcs11.so")
# m2.engine_free(dynamic) this line gave me ... | 0 | 2010-02-04T14:23:42Z | [
"python",
"m2crypto"
] |
Need help using M2Crypto.Engine to access USB Token | 2,195,179 | <p>I am using M2Crypto-0.20.2. I want to use engine_pkcs11 from the OpenSC project and the Aladdin PKI client for token based authentication making xmlrpc calls over ssl.</p>
<pre><code>from M2Crypto import Engine
Engine.load_dynamic()
dynamic = Engine.Engine('dynamic')
# Load the engine_pkcs from the OpenSC project
... | 2 | 2010-02-03T20:28:11Z | 2,200,665 | <p>I think the problem is not really the "load_private_key()". It's like something is missing between "MODULE_PATH" definition and the load_private_key() call. What happen if you remplace "/usr/lib/libeTPkcs11.so" by a wrong path ? In my case I have no error related to this.</p>
<p>I've run "pcscd" in foreground with ... | 0 | 2010-02-04T15:06:29Z | [
"python",
"m2crypto"
] |
Need help using M2Crypto.Engine to access USB Token | 2,195,179 | <p>I am using M2Crypto-0.20.2. I want to use engine_pkcs11 from the OpenSC project and the Aladdin PKI client for token based authentication making xmlrpc calls over ssl.</p>
<pre><code>from M2Crypto import Engine
Engine.load_dynamic()
dynamic = Engine.Engine('dynamic')
# Load the engine_pkcs from the OpenSC project
... | 2 | 2010-02-03T20:28:11Z | 2,201,893 | <p>Found !!!!</p>
<p>Yes, exactly the way where I came from.</p>
<p>So, actually the ENGINE_init() is not implemented in M2Crypto.Engine. So, only one solution: patching!!! (very small...) so I've created a new Engine method (in Engine.py)</p>
<pre><code>def engine_initz(self):
"""Return engine name"""
... | 2 | 2010-02-04T17:47:13Z | [
"python",
"m2crypto"
] |
Need help using M2Crypto.Engine to access USB Token | 2,195,179 | <p>I am using M2Crypto-0.20.2. I want to use engine_pkcs11 from the OpenSC project and the Aladdin PKI client for token based authentication making xmlrpc calls over ssl.</p>
<pre><code>from M2Crypto import Engine
Engine.load_dynamic()
dynamic = Engine.Engine('dynamic')
# Load the engine_pkcs from the OpenSC project
... | 2 | 2010-02-03T20:28:11Z | 2,206,945 | <p>I don't know what and why the engine_init code present in current M2Crypto is supposed to do. Exposing ENGINE_init() as engine_init2 with the following patch to M2Crypto helps:</p>
<pre><code>Index: SWIG/_engine.i
===================================================================
--- SWIG/_engine.i (revision 719)... | 1 | 2010-02-05T11:51:46Z | [
"python",
"m2crypto"
] |
Linux development/minimal smtp and pop3 server | 2,195,203 | <p>I use python based as well as rails applications on ubuntu linux. We have functionalities like register, forgot password, reset password, email alerts etc features based on emails. Since now a days, we go on offline development, we want to run a local smtp & pop3 server to send and receive emails.</p>
<p>Emails... | 1 | 2010-02-03T20:31:55Z | 2,195,237 | <p>Why does it need to be a simple mail server?<br>
Can't you just use something like postfix which is very easy for simple configurations</p>
| 2 | 2010-02-03T20:35:14Z | [
"python",
"ruby-on-rails",
"linux",
"email"
] |
Determining the unmatched portion of a string using a regex in Python | 2,195,340 | <p>Suppose I have a string "a foobar" and I use "^a\s*" to match "a ".</p>
<p>Is there a way to easily get "foobar" returned? (What was NOT matched)</p>
<p>I want to use a regex to look for a <i>command word</i> and also use the regex to remove the command word from the string.</p>
<p>I know how to do this using som... | 3 | 2010-02-03T20:48:26Z | 2,195,354 | <p>Use <code>re.sub</code>:</p>
<pre><code>import re
s = "87 foo 87 bar"
r = re.compile(r"87\s*")
s = r.sub('', s)
print s
</code></pre>
<p>Result:</p>
<pre><code>foo bar
</code></pre>
| 4 | 2010-02-03T20:51:50Z | [
"python",
"regex"
] |
Determining the unmatched portion of a string using a regex in Python | 2,195,340 | <p>Suppose I have a string "a foobar" and I use "^a\s*" to match "a ".</p>
<p>Is there a way to easily get "foobar" returned? (What was NOT matched)</p>
<p>I want to use a regex to look for a <i>command word</i> and also use the regex to remove the command word from the string.</p>
<p>I know how to do this using som... | 3 | 2010-02-03T20:48:26Z | 2,195,436 | <pre><code>>>> import re
>>> re.sub("87\s*", "", "87 foo 87 bar")
'foo bar'
</code></pre>
| 1 | 2010-02-03T21:05:19Z | [
"python",
"regex"
] |
Determining the unmatched portion of a string using a regex in Python | 2,195,340 | <p>Suppose I have a string "a foobar" and I use "^a\s*" to match "a ".</p>
<p>Is there a way to easily get "foobar" returned? (What was NOT matched)</p>
<p>I want to use a regex to look for a <i>command word</i> and also use the regex to remove the command word from the string.</p>
<p>I know how to do this using som... | 3 | 2010-02-03T20:48:26Z | 2,195,437 | <p>Instead of splitting or separating, maybe you can use re.sub and substitute a blank, empty string ("") whenever you find the pattern. For example...</p>
<pre><code>>>> import re
>>> re.sub("^a\s*", "","a foobar")
'foobar''
>>> re.sub("a\s*", "","a foobar a foobar")
'foobr foobr'
>>&... | 1 | 2010-02-03T21:05:29Z | [
"python",
"regex"
] |
Determining the unmatched portion of a string using a regex in Python | 2,195,340 | <p>Suppose I have a string "a foobar" and I use "^a\s*" to match "a ".</p>
<p>Is there a way to easily get "foobar" returned? (What was NOT matched)</p>
<p>I want to use a regex to look for a <i>command word</i> and also use the regex to remove the command word from the string.</p>
<p>I know how to do this using som... | 3 | 2010-02-03T20:48:26Z | 2,195,504 | <p>from <a href="http://docs.python.org/library/re.html#re.split" rel="nofollow">http://docs.python.org/library/re.html#re.split</a></p>
<pre><code>>>> re.split('(\W+)', 'Words, words, words.')
['Words', ', ', 'words', ', ', 'words', '.', '']
</code></pre>
<p>so your example would be</p>
<pre><code>>>... | 2 | 2010-02-03T21:14:13Z | [
"python",
"regex"
] |
how do I know if a remote user is connected in django? | 2,195,386 | <p>how do I know if a remote user is connected in django?, like gmail chat, or facebook chat... I need that in the templates system. Sorry for my english</p>
| 0 | 2010-02-03T20:57:14Z | 2,195,461 | <p>Comet is probably what you want. Look at <a href="http://www.rkblog.rk.edu.pl/w/p/django-and-comet/" rel="nofollow">Orbited</a>, <a href="http://github.com/ericflo/hurricane" rel="nofollow">Hurricane</a> or <a href="http://www.tornadoweb.org/" rel="nofollow">Tornado</a>.</p>
| 1 | 2010-02-03T21:10:08Z | [
"python",
"django",
"programming-languages",
"django-templates"
] |
how do I know if a remote user is connected in django? | 2,195,386 | <p>how do I know if a remote user is connected in django?, like gmail chat, or facebook chat... I need that in the templates system. Sorry for my english</p>
| 0 | 2010-02-03T20:57:14Z | 2,195,517 | <p>If you need just a general idea of who is currently visiting your website, which includes anonymous visitors, use <a href="http://code.google.com/p/django-tracking/" rel="nofollow">django-tracking</a> app.</p>
<p>If you need a chat application, or need to know <strong>exactly</strong> who is logged in at any time, ... | 2 | 2010-02-03T21:16:22Z | [
"python",
"django",
"programming-languages",
"django-templates"
] |
OpenCV 2.0 and Python | 2,195,441 | <p>I cannot get the example Python programs to run. When executing the Python command "from opencv import cv" I get the message "ImportError: No module named _cv". There is a stale _cv.pyd in the site-packages directory, but no _cv.py anywhere. See step 5 below.</p>
<p>MS Windows XP, VC++ 2008, Python 2.6, OpenCV 2.... | 6 | 2010-02-03T21:07:04Z | 2,195,460 | <p>You should install opencv using python dist utils. This can be accomplished by going to the opencv directory, and typing:</p>
<pre><code>python setup.py install
</code></pre>
<p><strong>Edit:</strong></p>
<p>openCV uses distutils, but somewhat indirectly. On UNIX the installation is more along the lines of: </p>
... | 4 | 2010-02-03T21:10:00Z | [
"python",
"opencv"
] |
OpenCV 2.0 and Python | 2,195,441 | <p>I cannot get the example Python programs to run. When executing the Python command "from opencv import cv" I get the message "ImportError: No module named _cv". There is a stale _cv.pyd in the site-packages directory, but no _cv.py anywhere. See step 5 below.</p>
<p>MS Windows XP, VC++ 2008, Python 2.6, OpenCV 2.... | 6 | 2010-02-03T21:07:04Z | 2,405,587 | <p>After Step 1 (Installer) just copy the content of <code>C:\OpenCV2.0\Python2.6\Lib\site-packages</code> to <code>C:\Python26\Lib\site-packages</code> (standard installation path assumed).
That's all.</p>
<p>If you have a webcam installed you can try the camshift.demo in <code>C:\OpenCV2.0\samples\python</code></p>
... | 3 | 2010-03-08T23:28:32Z | [
"python",
"opencv"
] |
OpenCV 2.0 and Python | 2,195,441 | <p>I cannot get the example Python programs to run. When executing the Python command "from opencv import cv" I get the message "ImportError: No module named _cv". There is a stale _cv.pyd in the site-packages directory, but no _cv.py anywhere. See step 5 below.</p>
<p>MS Windows XP, VC++ 2008, Python 2.6, OpenCV 2.... | 6 | 2010-02-03T21:07:04Z | 4,334,645 | <p>As Roger already explained, the situation was quite confusing for a while. The reason was that opencv moved from a C only implementation to a mixed C and C++ implementation in opencv2. This causes headaches for all wrappers, including the python ones. So please don't complain that the python guys "keep breaking t... | 1 | 2010-12-02T11:50:30Z | [
"python",
"opencv"
] |
OpenCV 2.0 and Python | 2,195,441 | <p>I cannot get the example Python programs to run. When executing the Python command "from opencv import cv" I get the message "ImportError: No module named _cv". There is a stale _cv.pyd in the site-packages directory, but no _cv.py anywhere. See step 5 below.</p>
<p>MS Windows XP, VC++ 2008, Python 2.6, OpenCV 2.... | 6 | 2010-02-03T21:07:04Z | 5,131,425 | <p>I have posted a entry to setup OpenCV for Python in Windows: <a href="http://luugiathuy.com/2011/02/setup-opencv-for-python/" rel="nofollow">http://luugiathuy.com/2011/02/setup-opencv-for-python/</a>
It is for OpenCV 2.2 but I think it wors for previous version also.</p>
| 0 | 2011-02-27T04:21:07Z | [
"python",
"opencv"
] |
How do I write a Django template custom tag that adds a slash before a single quote? | 2,195,588 | <p>Am I doing this right? (probably not...someone correct? thanks)</p>
<pre><code>@register.filter('addslashes')
@stringfilter
def addslashes(text, arg):
return text.replace('\'','\\'')
{{ query|addslashes }}
</code></pre>
| 0 | 2010-02-03T21:27:49Z | 2,195,698 | <p>There is a builtin filter with the exact same name: <a href="http://docs.djangoproject.com/en/dev/ref/templates/builtins/#addslashes" rel="nofollow">addslashes</a></p>
<p>It also escapes double quotes, and double slashes. If you only want single quotes, you will have to adapt it and name it differently.</p>
<p>Her... | 4 | 2010-02-03T21:44:26Z | [
"python",
"django",
"templates"
] |
Override all operators in python | 2,195,601 | <p>I have a wrapper class for an object. I want it to apply all operations applied to it on the wrapped object, e.g <code>wrapper+=a</code> would yield the same result as <code>wrapped+=a</code>, for instance. I want to apply this for all operators. Any simple way to override all operators without overriding each one e... | 1 | 2010-02-03T21:29:42Z | 2,195,622 | <p><a href="http://code.activestate.com/recipes/496741/" rel="nofollow">ActiveState Code: Recipe 496741: Object Proxying</a></p>
| 6 | 2010-02-03T21:32:10Z | [
"python",
"operators",
"override"
] |
Override all operators in python | 2,195,601 | <p>I have a wrapper class for an object. I want it to apply all operations applied to it on the wrapped object, e.g <code>wrapper+=a</code> would yield the same result as <code>wrapped+=a</code>, for instance. I want to apply this for all operators. Any simple way to override all operators without overriding each one e... | 1 | 2010-02-03T21:29:42Z | 2,195,625 | <p>No, sorry. Though you could write an interface (probably as a decorator or base class) that makes this easy, if you need to do it more than once. Or use one <a href="http://stackoverflow.com/questions/2195601/override-all-operators-in-python/2195622#2195622">provided</a> already. (Guess I was 40s too late.)</p>
| 1 | 2010-02-03T21:32:50Z | [
"python",
"operators",
"override"
] |
VLC/Python bindings? | 2,195,631 | <p>Does anyone know how to implement the VLC Python bindings? I downloaded vlc.py and vlcwidget.py from the VLC wiki (<a href="http://wiki.videolan.org/Python_bindings" rel="nofollow">http://wiki.videolan.org/Python_bindings</a>) and tried to run vlcwidget. Other than having vlc installed, do I need to do anything el... | 2 | 2010-02-03T21:33:51Z | 2,196,283 | <pre>
$ git clone git://git.videolan.org/vlc.git && cd vlc
$ git log -Slibvlc_media_player_new
...
commit bf1292e44390c6469483cea3817d6c2a3dbd811c
Author: Pierre d'Herbemont <pdherbemont@videolan.org>
Date: Sun Mar 30 03:59:32 2008 +0200
libvlc: rename libvlc_media_descriptor to libvlc_media and libvlc_med... | 2 | 2010-02-03T23:21:29Z | [
"python",
"binding",
"vlc",
"libvlc"
] |
How do I do "or" in Django template code? | 2,195,726 | <pre><code>{% if is_loggedin OR is_anonymous %}
test message
{% endif %}
</code></pre>
| 0 | 2010-02-03T21:48:25Z | 2,195,739 | <pre><code>{% if is_loggedin or is_anonymous %}
test message
{% endif %}
</code></pre>
<p>Like that.</p>
| 4 | 2010-02-03T21:50:42Z | [
"python",
"django"
] |
How do I do "or" in Django template code? | 2,195,726 | <pre><code>{% if is_loggedin OR is_anonymous %}
test message
{% endif %}
</code></pre>
| 0 | 2010-02-03T21:48:25Z | 2,195,748 | <blockquote>
<p>if tags may use and, or or not to test a number of variables or to negate a given variable:</p>
</blockquote>
<p><a href="http://docs.djangoproject.com/en/dev/ref/templates/builtins/#if" rel="nofollow">http://docs.djangoproject.com/en/dev/ref/templates/builtins/#if</a></p>
<p>The way you're doing it... | 1 | 2010-02-03T21:51:46Z | [
"python",
"django"
] |
Python class has method "set", how to reference builtin set type? | 2,195,755 | <p>If you have a method called "set" in a class and want to create a standard builtin "set" object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin "set", not the method "set"? More specifically, set() is being created... | 1 | 2010-02-03T21:52:53Z | 2,195,786 | <p>Usually method names are disambiguated from global names because you have to prefix <code>self.</code>.</p>
<p>So <code>self.set()</code> invokes your class method and <code>set()</code> invokes the global <code>set</code>.</p>
<p>If this doesn't help, perhaps post the code you're having trouble with.</p>
| 2 | 2010-02-03T21:57:18Z | [
"python"
] |
Python class has method "set", how to reference builtin set type? | 2,195,755 | <p>If you have a method called "set" in a class and want to create a standard builtin "set" object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin "set", not the method "set"? More specifically, set() is being created... | 1 | 2010-02-03T21:52:53Z | 2,195,789 | <p>Object attributes are <em>always</em> accessed via a reference, so there is no way for an object attribute to shadow a builtin.</p>
| 3 | 2010-02-03T21:57:51Z | [
"python"
] |
Python class has method "set", how to reference builtin set type? | 2,195,755 | <p>If you have a method called "set" in a class and want to create a standard builtin "set" object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin "set", not the method "set"? More specifically, set() is being created... | 1 | 2010-02-03T21:52:53Z | 2,195,807 | <p>You can refer to built-in <code>set</code> as <code>__builtins__.set</code>.</p>
| 2 | 2010-02-03T22:00:25Z | [
"python"
] |
Python class has method "set", how to reference builtin set type? | 2,195,755 | <p>If you have a method called "set" in a class and want to create a standard builtin "set" object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin "set", not the method "set"? More specifically, set() is being created... | 1 | 2010-02-03T21:52:53Z | 2,195,847 | <p>If you run the code below you will notice that the <code>set</code> method of the <code>UsesSet</code> class does not obscure the built-in set type.</p>
<pre><code>class UsesSet(object):
def set(self):
pass
def other(self):
my_set = set([1, 2])
print type(my_set), my_set
obj = UsesS... | 1 | 2010-02-03T22:07:08Z | [
"python"
] |
Python class has method "set", how to reference builtin set type? | 2,195,755 | <p>If you have a method called "set" in a class and want to create a standard builtin "set" object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin "set", not the method "set"? More specifically, set() is being created... | 1 | 2010-02-03T21:52:53Z | 2,195,849 | <p>I think I know what's going on here. Are you doing something like this?</p>
<pre><code>>>> class A(object):
... def set(self):
... pass
... def test(self, x=set):
... return x
...
>>> set
<type 'set'>
>>> A().test()
<function set at 0x64270>
<... | 10 | 2010-02-03T22:07:21Z | [
"python"
] |
DB Permissions with Django unit testing | 2,195,791 | <p>Disclaimer:</p>
<p>I'm very new to Django. I must say that so far I really like it. :)</p>
<p>(now for the "but"...)</p>
<p>But, there seems to be something I'm missing related to unit testing. I'm working on a new project with an Oracle backend. When you run the unit tests, it immediately gives a permissions... | 2 | 2010-02-03T21:58:07Z | 2,195,868 | <p>Generally speaking, when unit tests depend on test data to be present, they also depend on it to be in a specific format/state. As such, your framework's policy is to not only execute DML (delete/insert test data records), but it also executes DDL (drop/create tables) to ensure that everything is in working order p... | 0 | 2010-02-03T22:11:36Z | [
"python",
"database",
"django",
"unit-testing"
] |
DB Permissions with Django unit testing | 2,195,791 | <p>Disclaimer:</p>
<p>I'm very new to Django. I must say that so far I really like it. :)</p>
<p>(now for the "but"...)</p>
<p>But, there seems to be something I'm missing related to unit testing. I'm working on a new project with an Oracle backend. When you run the unit tests, it immediately gives a permissions... | 2 | 2010-02-03T21:58:07Z | 2,195,979 | <p>Don't force Django to do something unnatural.</p>
<ol>
<li><p>Allow it to create the test schema. It's a good thing.</p></li>
<li><p>From your existing schema, do an <code>unload</code> to create .JSON dump files of the data. These files are your "fixtures". These fixtures are used by Django to populate the test... | 2 | 2010-02-03T22:30:02Z | [
"python",
"database",
"django",
"unit-testing"
] |
DB Permissions with Django unit testing | 2,195,791 | <p>Disclaimer:</p>
<p>I'm very new to Django. I must say that so far I really like it. :)</p>
<p>(now for the "but"...)</p>
<p>But, there seems to be something I'm missing related to unit testing. I'm working on a new project with an Oracle backend. When you run the unit tests, it immediately gives a permissions... | 2 | 2010-02-03T21:58:07Z | 2,196,256 | <p>As you've discovered, Django's default test runner makes quite a few assumptions, including that it'll be able to create a new test database to run the tests against.</p>
<p>If you need to override this or any of these default assumptions, you probably want to <a href="http://docs.djangoproject.com/en/1.1/topics/te... | 3 | 2010-02-03T23:15:52Z | [
"python",
"database",
"django",
"unit-testing"
] |
DB Permissions with Django unit testing | 2,195,791 | <p>Disclaimer:</p>
<p>I'm very new to Django. I must say that so far I really like it. :)</p>
<p>(now for the "but"...)</p>
<p>But, there seems to be something I'm missing related to unit testing. I'm working on a new project with an Oracle backend. When you run the unit tests, it immediately gives a permissions... | 2 | 2010-02-03T21:58:07Z | 2,197,772 | <p>After I read David's (OP) question, I was curious about this too, but I don't see the answer I was hoping to see. So let me try to rephrase what I think at least part of what David is asking. In a production environment, I'm sure his Django models probably will not have access to create or drop tables. His DBA wil... | 2 | 2010-02-04T06:27:12Z | [
"python",
"database",
"django",
"unit-testing"
] |
DB Permissions with Django unit testing | 2,195,791 | <p>Disclaimer:</p>
<p>I'm very new to Django. I must say that so far I really like it. :)</p>
<p>(now for the "but"...)</p>
<p>But, there seems to be something I'm missing related to unit testing. I'm working on a new project with an Oracle backend. When you run the unit tests, it immediately gives a permissions... | 2 | 2010-02-03T21:58:07Z | 7,675,487 | <p>What you can do, is creating separate test settings.
As I've learned at <a href="http://mindlesstechnology.wordpress.com/2008/08/16/faster-django-unit-tests/" rel="nofollow">http://mindlesstechnology.wordpress.com/2008/08/16/faster-django-unit-tests/</a> you can use the <code>sqlite3</code> backend, which is created... | 0 | 2011-10-06T14:08:00Z | [
"python",
"database",
"django",
"unit-testing"
] |
Saving an image of what a device context drew, wxPython | 2,195,792 | <p>I need to be able to save an image (format doesn't matter) of the state of the device context canvas. I tried <a href="http://www.wxpython.org/docs/api/wx.DC-class.html#GetAsBitmap" rel="nofollow"><code>dc.GetAsBitmap</code></a> but it returns invalid bitmaps. How can I do it?</p>
| 3 | 2010-02-03T21:58:11Z | 2,196,455 | <p>Yo can probably figure something out of <a href="http://wiki.wxpython.org/WorkingWithImages" rel="nofollow">this</a> (working with images and wxPython)</p>
| 1 | 2010-02-04T00:05:54Z | [
"python",
"wxpython",
"wx"
] |
Saving an image of what a device context drew, wxPython | 2,195,792 | <p>I need to be able to save an image (format doesn't matter) of the state of the device context canvas. I tried <a href="http://www.wxpython.org/docs/api/wx.DC-class.html#GetAsBitmap" rel="nofollow"><code>dc.GetAsBitmap</code></a> but it returns invalid bitmaps. How can I do it?</p>
| 3 | 2010-02-03T21:58:11Z | 2,196,912 | <p>I believe this should do the trick:</p>
<pre><code>def saveSnapshot(dcSource):
# based largely on code posted to wxpython-users by Andrea Gavana 2006-11-08
size = dcSource.Size
# Create a Bitmap that will later on hold the screenshot image
# Note that the Bitmap must have a size big enough to hold ... | 2 | 2010-02-04T02:07:28Z | [
"python",
"wxpython",
"wx"
] |
Python's layout of low-value ints in memory | 2,195,964 | <p>My question is: where do these patterns (below) originate?</p>
<p>I learned (somewhere) that Python has unique "copies", if that's the right word, for small integers. For example:</p>
<pre><code>>>> x = y = 0
>>> id(0)
4297074752
>>> id(x)
4297074752
>>> id(y)
4297074752
>&... | 4 | 2010-02-03T22:28:41Z | 2,195,998 | <p>In CPython, <a href="http://docs.python.org/library/functions.html#id" rel="nofollow">IDs are the address of the objects</a>.</p>
| 0 | 2010-02-03T22:32:23Z | [
"python",
"memory"
] |
Python's layout of low-value ints in memory | 2,195,964 | <p>My question is: where do these patterns (below) originate?</p>
<p>I learned (somewhere) that Python has unique "copies", if that's the right word, for small integers. For example:</p>
<pre><code>>>> x = y = 0
>>> id(0)
4297074752
>>> id(x)
4297074752
>>> id(y)
4297074752
>&... | 4 | 2010-02-03T22:28:41Z | 2,196,000 | <p>The first 256 ints are preallocated</p>
<pre><code>>>> for n in range(1000):
>>> if id(n) != id(n+0):
>>> print n
>>> break
257
</code></pre>
| 2 | 2010-02-03T22:32:34Z | [
"python",
"memory"
] |
Python's layout of low-value ints in memory | 2,195,964 | <p>My question is: where do these patterns (below) originate?</p>
<p>I learned (somewhere) that Python has unique "copies", if that's the right word, for small integers. For example:</p>
<pre><code>>>> x = y = 0
>>> id(0)
4297074752
>>> id(x)
4297074752
>>> id(y)
4297074752
>&... | 4 | 2010-02-03T22:28:41Z | 2,196,014 | <p>Low-value integers are preallocated, high value integers are allocated whenever they are computed. Integers that appear in source code are the same object. On my system,</p>
<pre><code>>>> id(2) == id(1+1)
True
>>> id(1000) == id(1000+0)
False
>>> id(1000) == id(1000)
True
</code></pre>... | 7 | 2010-02-03T22:34:03Z | [
"python",
"memory"
] |
Python's layout of low-value ints in memory | 2,195,964 | <p>My question is: where do these patterns (below) originate?</p>
<p>I learned (somewhere) that Python has unique "copies", if that's the right word, for small integers. For example:</p>
<pre><code>>>> x = y = 0
>>> id(0)
4297074752
>>> id(x)
4297074752
>>> id(y)
4297074752
>&... | 4 | 2010-02-03T22:28:41Z | 2,196,019 | <p>integers up to 256 are interned, that's why you see a "pattern" there. All other integers are created during execution and as such allocated random <code>id</code>.</p>
| 1 | 2010-02-03T22:35:08Z | [
"python",
"memory"
] |
Python's layout of low-value ints in memory | 2,195,964 | <p>My question is: where do these patterns (below) originate?</p>
<p>I learned (somewhere) that Python has unique "copies", if that's the right word, for small integers. For example:</p>
<pre><code>>>> x = y = 0
>>> id(0)
4297074752
>>> id(x)
4297074752
>>> id(y)
4297074752
>&... | 4 | 2010-02-03T22:28:41Z | 2,196,028 | <p>I seem to recall that Python internally caches copies of ints < 256 to save having to create new Python objects for commonly-used cases. So once you go over 256 you're getting newly created objects each time which may appear to be 'randomly' laid out in memory (obviously their locations would make sense to Python... | 2 | 2010-02-03T22:36:08Z | [
"python",
"memory"
] |
Python's layout of low-value ints in memory | 2,195,964 | <p>My question is: where do these patterns (below) originate?</p>
<p>I learned (somewhere) that Python has unique "copies", if that's the right word, for small integers. For example:</p>
<pre><code>>>> x = y = 0
>>> id(0)
4297074752
>>> id(x)
4297074752
>>> id(y)
4297074752
>&... | 4 | 2010-02-03T22:28:41Z | 2,198,084 | <p>Since others have fully answered why ids have a distinct pattern up to 256, I thought I would answer your addendum instead: 24 is the size in bytes of an integer object in python. When the first 256 integers are allocated they are done so contiguously in memory, leading to a difference of 24 between each memory addr... | 2 | 2010-02-04T07:50:51Z | [
"python",
"memory"
] |
Matplotlib: Formatting dates on the x-axis in a 3D Bar graph | 2,195,983 | <p>Given this <a href="http://matplotlib.sourceforge.net/examples/mplot3d/bars3d_demo.html">3D bar graph sample code</a>, how would you convert the numerical data in the x-axis to formatted date/time strings? I've attempted using the ax.xaxis_date() function without success. I also tried using plot_date(), which doesn'... | 10 | 2010-02-03T22:30:52Z | 2,215,733 | <p>There might be some confusion here, the Axes3D has the properties w_xaxis, w_yaxis and w_zaxis for the axises instead of the usual xaxix, yaxis, etc..</p>
<p><strong>UPDATE</strong> Now uses function to format labels.</p>
<pre><code>from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import num... | 9 | 2010-02-07T03:07:32Z | [
"python",
"numpy",
"graph",
"matplotlib",
"data-analysis"
] |
Installing PySide - OSX | 2,196,300 | <p>Anyone had success installing and using PySide on OSX? I am following the install instructions on the PySide site, though I'm running into issues building the API Extractor. I run <code>cmake</code> on the CMakeLists.txt file inside the api extractor dir and: </p>
<p>This error is thrown-</p>
<pre><code>CMake Erro... | 2 | 2010-02-03T23:24:43Z | 2,196,359 | <p>It's a set of quite widespread C++ libraries, they're probably needed by PySide, even though I've never tried it.</p>
<p>Download them from there:
<a href="http://sourceforge.net/projects/boost/files/boost/1.42.0/" rel="nofollow">http://sourceforge.net/projects/boost/files/boost/1.42.0/</a></p>
<p>Otherwise, you c... | 2 | 2010-02-03T23:39:09Z | [
"c++",
"python",
"cmake",
"pyside"
] |
Installing PySide - OSX | 2,196,300 | <p>Anyone had success installing and using PySide on OSX? I am following the install instructions on the PySide site, though I'm running into issues building the API Extractor. I run <code>cmake</code> on the CMakeLists.txt file inside the api extractor dir and: </p>
<p>This error is thrown-</p>
<pre><code>CMake Erro... | 2 | 2010-02-03T23:24:43Z | 2,796,716 | <p>You may want to check the newest release of PySide, out very recently, I believe the dependency on the Boost libraries has been removed.</p>
| 4 | 2010-05-09T05:30:21Z | [
"c++",
"python",
"cmake",
"pyside"
] |
How to write a unit-test where each test case has different input but does the same? | 2,196,376 | <p>I need to create a unit-test for some python class. I have a database of inputs and expected results which should be generated by the UUT for those inputs.</p>
<p>Here is the psuedo-code of what i want to do:</p>
<pre><code>for i=1 to NUM_TEST_CASES:
Load input for test case i
execute UUT on the input and ... | 6 | 2010-02-03T23:44:39Z | 2,196,675 | <p>The way you describe testing is an odd match for Unit Testing in general. Unit testing does not -- typically -- load test data or rest results from external files. Generally, it's simply hard-coded in the unit test. </p>
<p>That's not to say that your plan won't work. It's just to say that it's atypical.</p>
... | 4 | 2010-02-04T00:57:58Z | [
"python",
"unit-testing"
] |
How to write a unit-test where each test case has different input but does the same? | 2,196,376 | <p>I need to create a unit-test for some python class. I have a database of inputs and expected results which should be generated by the UUT for those inputs.</p>
<p>Here is the psuedo-code of what i want to do:</p>
<pre><code>for i=1 to NUM_TEST_CASES:
Load input for test case i
execute UUT on the input and ... | 6 | 2010-02-03T23:44:39Z | 2,196,804 | <p>Maybe you could use <a href="http://docs.python.org/library/doctest.html" rel="nofollow"><code>doctest</code></a> for this. Knowing your inputs and outputs (and being able to map the case number to a function name) you should be able to produce a text file like this:</p>
<pre><code>>>> from XXX import func... | 0 | 2010-02-04T01:32:02Z | [
"python",
"unit-testing"
] |
How to write a unit-test where each test case has different input but does the same? | 2,196,376 | <p>I need to create a unit-test for some python class. I have a database of inputs and expected results which should be generated by the UUT for those inputs.</p>
<p>Here is the psuedo-code of what i want to do:</p>
<pre><code>for i=1 to NUM_TEST_CASES:
Load input for test case i
execute UUT on the input and ... | 6 | 2010-02-03T23:44:39Z | 2,197,302 | <p>We do something like this in order to run what are actually <em>integration</em> (regression) tests within the <code>unittest</code> framework (actually an in-house customization thereof which gives us enormous benefits such as running the tests in parallel on a cluster of machines, etc, etc -- the great added value... | 2 | 2010-02-04T04:20:24Z | [
"python",
"unit-testing"
] |
How to write a unit-test where each test case has different input but does the same? | 2,196,376 | <p>I need to create a unit-test for some python class. I have a database of inputs and expected results which should be generated by the UUT for those inputs.</p>
<p>Here is the psuedo-code of what i want to do:</p>
<pre><code>for i=1 to NUM_TEST_CASES:
Load input for test case i
execute UUT on the input and ... | 6 | 2010-02-03T23:44:39Z | 5,389,920 | <p>You might also want to take a look at <a href="http://stackoverflow.com/questions/5336626/giving-parameters-into-testcase-from-suite-in-python/5381422#5381422">my answer</a> to <a href="http://stackoverflow.com/questions/5336626/giving-parameters-into-testcase-from-suite-in-python">this question</a>. Again I'm tryin... | 0 | 2011-03-22T10:38:01Z | [
"python",
"unit-testing"
] |
how to extract formatted text content from PDF | 2,196,621 | <p>How can I extract the text content (not images) from a PDF while (roughly) maintaining the style and layout like Google Docs can?</p>
| 14 | 2010-02-04T00:48:28Z | 2,196,709 | <p>Have you tried <a href="http://pybrary.net/pyPdf/">pyPDF</a> or <a href="http://www.reportlab.com">ReportLab</a> PDF libraries? I personally have not used them but you can have a go at them. <a href="http://vermeulen.ca/python-pdf.html">here</a> is useful too</p>
| 6 | 2010-02-04T01:04:06Z | [
"python",
"pdf",
"text",
"extract",
"google-docs"
] |
how to extract formatted text content from PDF | 2,196,621 | <p>How can I extract the text content (not images) from a PDF while (roughly) maintaining the style and layout like Google Docs can?</p>
| 14 | 2010-02-04T00:48:28Z | 2,196,778 | <p>If you don't have your heart set on doing this with python, <a href="http://www.ghostscript.com/" rel="nofollow">Ghostscript</a> can do this for you. Check out pdf2ascii (a script that comes with GS) to get the plain text. Styles are more complicated as they can be specified in a few different ways. </p>
| 3 | 2010-02-04T01:23:43Z | [
"python",
"pdf",
"text",
"extract",
"google-docs"
] |
how to extract formatted text content from PDF | 2,196,621 | <p>How can I extract the text content (not images) from a PDF while (roughly) maintaining the style and layout like Google Docs can?</p>
| 14 | 2010-02-04T00:48:28Z | 2,196,783 | <p>If you want to do it just like Google:</p>
<p>Google converts the PDF to an image, and then overlays the image, where text used to be, with JavaScript highlightable areas (which is about like Voodoo magic). The areas appear to be text when you scroll over them with your cursor, but they're not. This might not help ... | 4 | 2010-02-04T01:25:54Z | [
"python",
"pdf",
"text",
"extract",
"google-docs"
] |
how to extract formatted text content from PDF | 2,196,621 | <p>How can I extract the text content (not images) from a PDF while (roughly) maintaining the style and layout like Google Docs can?</p>
| 14 | 2010-02-04T00:48:28Z | 2,196,933 | <p>To extract the text from the PDF AND get it's position you can use <a href="http://www.unixuser.org/~euske/python/pdfminer/index.html">PDFMiner</a>. PDFMiner can also export the PDF directly in HTML keeping the text at the good position.</p>
<p>I don't know your use case, but there's a lot of problems you can encou... | 9 | 2010-02-04T02:13:20Z | [
"python",
"pdf",
"text",
"extract",
"google-docs"
] |
how to extract formatted text content from PDF | 2,196,621 | <p>How can I extract the text content (not images) from a PDF while (roughly) maintaining the style and layout like Google Docs can?</p>
| 14 | 2010-02-04T00:48:28Z | 6,586,448 | <p>Xpdf has a utility call PDFtoText that does a great job. <a href="http://foolabs.com/xpdf/download.html" rel="nofollow">http://foolabs.com/xpdf/download.html</a></p>
| 4 | 2011-07-05T17:21:56Z | [
"python",
"pdf",
"text",
"extract",
"google-docs"
] |
how to extract formatted text content from PDF | 2,196,621 | <p>How can I extract the text content (not images) from a PDF while (roughly) maintaining the style and layout like Google Docs can?</p>
| 14 | 2010-02-04T00:48:28Z | 13,056,489 | <p>Acrobat Professional can do the job. In the "File" menu, choose export. Then, choose Text.</p>
| 3 | 2012-10-24T19:39:41Z | [
"python",
"pdf",
"text",
"extract",
"google-docs"
] |
Improving Numpy Performance | 2,196,693 | <p>I'd like to improve the performance of convolution using python, and was hoping for some insight on how to best go about improving performance. </p>
<p>I am currently using scipy to perform the convolution, using code somewhat like the snippet below:</p>
<pre><code>import numpy
import scipy
import scipy.signal
imp... | 17 | 2010-02-04T01:00:42Z | 2,196,759 | <p>A typical optimization for convolution is to use the FFT of your signal. The reason is: the convolution in real space is a product in FFT space. It is often faster to compute the FFT, then the product, and the iFFT of the result than convolve the usual way.</p>
| 0 | 2010-02-04T01:18:44Z | [
"python",
"math",
"numpy",
"scipy",
"convolution"
] |
Improving Numpy Performance | 2,196,693 | <p>I'd like to improve the performance of convolution using python, and was hoping for some insight on how to best go about improving performance. </p>
<p>I am currently using scipy to perform the convolution, using code somewhat like the snippet below:</p>
<pre><code>import numpy
import scipy
import scipy.signal
imp... | 17 | 2010-02-04T01:00:42Z | 2,198,047 | <p>For the particular example 3x3 kernel, I'd observe that</p>
<pre><code>1 1 1
1 -8 1
1 1 1
1 1 1 0 0 0
= 1 1 1 + 0 -9 0
1 1 1 0 0 0
</code></pre>
<p>and that the first of these is factorable - it can be convoluted by convolving (1 1 1) for each row, and then again for each column. The... | 2 | 2010-02-04T07:37:02Z | [
"python",
"math",
"numpy",
"scipy",
"convolution"
] |
Improving Numpy Performance | 2,196,693 | <p>I'd like to improve the performance of convolution using python, and was hoping for some insight on how to best go about improving performance. </p>
<p>I am currently using scipy to perform the convolution, using code somewhat like the snippet below:</p>
<pre><code>import numpy
import scipy
import scipy.signal
imp... | 17 | 2010-02-04T01:00:42Z | 2,205,095 | <p>The code in scipy for doing 2d convolutions is a bit messy and unoptimized. See <a href="http://svn.scipy.org/svn/scipy/trunk/scipy/signal/firfilter.c" rel="nofollow">http://svn.scipy.org/svn/scipy/trunk/scipy/signal/firfilter.c</a> if you want a glimpse into the low-level functioning of scipy. </p>
<p>If all you w... | 8 | 2010-02-05T04:42:23Z | [
"python",
"math",
"numpy",
"scipy",
"convolution"
] |
Improving Numpy Performance | 2,196,693 | <p>I'd like to improve the performance of convolution using python, and was hoping for some insight on how to best go about improving performance. </p>
<p>I am currently using scipy to perform the convolution, using code somewhat like the snippet below:</p>
<pre><code>import numpy
import scipy
import scipy.signal
imp... | 17 | 2010-02-04T01:00:42Z | 2,209,434 | <p>Before going to say C with ctypes, I'd suggest running a standalone convolve in C, to see where the limit is.<br>
Similarly for CUDA, cython, scipy.weave ...</p>
<p>Added 7feb: convolve33 8-bit data with clipping takes ~ 20 clock cycles per point,
2 clock cycles per mem access, on my mac g4 pcc with gcc 4.2. Your m... | 1 | 2010-02-05T18:30:04Z | [
"python",
"math",
"numpy",
"scipy",
"convolution"
] |
django input element error css class | 2,196,797 | <p>I'd like to know how can I add .error class to input elements (<a href="http://django-registration.googlecode.com/svn/trunk/registration/">to registration app</a>) when the form validation fails. </p>
| 8 | 2010-02-04T01:30:26Z | 2,242,528 | <p>This can be done completely through your template.</p>
<p>You build the form template for each form field that you want to test you can use the following example construct</p>
<pre><code><input type="text" class="reg-txt{% if form.fieldname.errors %} errors{% endif %}"/>
</code></pre>
<p>This lets you provi... | 7 | 2010-02-11T05:43:24Z | [
"python",
"django",
"validation",
"django-forms"
] |
django input element error css class | 2,196,797 | <p>I'd like to know how can I add .error class to input elements (<a href="http://django-registration.googlecode.com/svn/trunk/registration/">to registration app</a>) when the form validation fails. </p>
| 8 | 2010-02-04T01:30:26Z | 3,943,983 | <p>(Better late than never)</p>
<p>You should be able to do this with <a href="http://github.com/pydanny/django-uni-form" rel="nofollow">Django Uni Form</a></p>
| 0 | 2010-10-15T16:03:35Z | [
"python",
"django",
"validation",
"django-forms"
] |
django input element error css class | 2,196,797 | <p>I'd like to know how can I add .error class to input elements (<a href="http://django-registration.googlecode.com/svn/trunk/registration/">to registration app</a>) when the form validation fails. </p>
| 8 | 2010-02-04T01:30:26Z | 4,171,771 | <p>It's now easy -- new feature in Django 1.2</p>
<p>Just add an attribute on the form class & you're good to go. This feature is mentioned in the docs under a "new in 1.2" note, but you can find the magic at <code>django.forms.forms.BoundField.css_classes</code> Here's the <a href="http://docs.djangoproject.com/e... | 26 | 2010-11-13T09:05:37Z | [
"python",
"django",
"validation",
"django-forms"
] |
django input element error css class | 2,196,797 | <p>I'd like to know how can I add .error class to input elements (<a href="http://django-registration.googlecode.com/svn/trunk/registration/">to registration app</a>) when the form validation fails. </p>
| 8 | 2010-02-04T01:30:26Z | 8,256,041 | <p>If you want to place your error CSS class to form input widgets (not their containers), you can derive your form class from the following one:</p>
<pre><code>class StyledErrorForm(forms.Form):
def is_valid(self):
ret = forms.Form.is_valid(self)
for f in self.errors:
self.fields[f].wi... | 22 | 2011-11-24T11:06:34Z | [
"python",
"django",
"validation",
"django-forms"
] |
django input element error css class | 2,196,797 | <p>I'd like to know how can I add .error class to input elements (<a href="http://django-registration.googlecode.com/svn/trunk/registration/">to registration app</a>) when the form validation fails. </p>
| 8 | 2010-02-04T01:30:26Z | 15,722,212 | <p>Using a Custom Template...</p>
<p>Personally never had much luck using the built in Django error classing solutions, and besides, I like to use the built in 'striptags' template filter on the errors, to get rid of all the html list stuff which I cant figure out how to render nicely anyway.</p>
<p>I use the followi... | 1 | 2013-03-30T18:54:28Z | [
"python",
"django",
"validation",
"django-forms"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.