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 |
|---|---|---|---|---|---|---|---|---|---|
Python integer division yields float | 1,282,945 | <pre><code>Python 3.1 (r31:73574, Jun 26 2009, 20:21:35) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 2/2
1.0
</code></pre>
<p>Is this intended? I strongly remember earlier versions returning <code>int/int=int</code>? What should I do, is ther... | 101 | 2009-08-15T21:48:39Z | 39,332,574 | <p>The accepted answer already mentions <a href="https://www.python.org/dev/peps/pep-0238/" rel="nofollow">PEP 238</a>. I just want to add a quick look behind the scenes for those interested in what's going on without reading the whole PEP.</p>
<p>Python maps operators like <code>+</code>, <code>-</code>, <code>*</cod... | 1 | 2016-09-05T14:18:11Z | [
"python",
"integer",
"python-3.x",
"division"
] |
Python - capture Popen stdout AND display on console? | 1,283,061 | <p>I want to capture stdout from a long-ish running process started via <code>subprocess.Popen(...)</code> so I'm using <code>stdout=PIPE</code> as an arg.</p>
<p>However, because it's a long running process I also want to send the output to the console (as if I hadn't piped it) to give the user of the script an idea ... | 5 | 2009-08-15T22:48:42Z | 1,283,062 | <p>Can you simply <code>print</code> it as you read it from the pipe?</p>
| 1 | 2009-08-15T22:49:50Z | [
"python",
"pipe",
"popen"
] |
Python - capture Popen stdout AND display on console? | 1,283,061 | <p>I want to capture stdout from a long-ish running process started via <code>subprocess.Popen(...)</code> so I'm using <code>stdout=PIPE</code> as an arg.</p>
<p>However, because it's a long running process I also want to send the output to the console (as if I hadn't piped it) to give the user of the script an idea ... | 5 | 2009-08-15T22:48:42Z | 1,283,066 | <p>The buffering your long-running sub-process is probably performing will make your console output jerky and very bad UX. I suggest you consider instead using <a href="http://pexpect.sourceforge.net/pexpect.html">pexpect</a> (or, on Windows, <a href="http://code.google.com/p/wexpect/">wexpect</a>) to defeat such buffe... | 5 | 2009-08-15T22:52:28Z | [
"python",
"pipe",
"popen"
] |
Python - capture Popen stdout AND display on console? | 1,283,061 | <p>I want to capture stdout from a long-ish running process started via <code>subprocess.Popen(...)</code> so I'm using <code>stdout=PIPE</code> as an arg.</p>
<p>However, because it's a long running process I also want to send the output to the console (as if I hadn't piped it) to give the user of the script an idea ... | 5 | 2009-08-15T22:48:42Z | 1,283,191 | <p>Alternatively, you can pipe your process into tee and capture only one of the streams.
Something along the lines of <code>sh -c 'process interesting stuff' | tee /dev/stderr</code>.</p>
<p>Of course, this only works on Unix-like systems.</p>
| 1 | 2009-08-16T00:22:38Z | [
"python",
"pipe",
"popen"
] |
Python - capture Popen stdout AND display on console? | 1,283,061 | <p>I want to capture stdout from a long-ish running process started via <code>subprocess.Popen(...)</code> so I'm using <code>stdout=PIPE</code> as an arg.</p>
<p>However, because it's a long running process I also want to send the output to the console (as if I hadn't piped it) to give the user of the script an idea ... | 5 | 2009-08-15T22:48:42Z | 1,284,860 | <p>S. Lott's comment points to <a href="http://stackoverflow.com/questions/803265/getting-realtime-output-using-subprocess">http://stackoverflow.com/questions/803265/getting-realtime-output-using-subprocess</a> and <a href="http://stackoverflow.com/questions/1085071/real-time-intercepting-of-stdout-from-another-process... | 2 | 2009-08-16T17:40:02Z | [
"python",
"pipe",
"popen"
] |
Python - capture Popen stdout AND display on console? | 1,283,061 | <p>I want to capture stdout from a long-ish running process started via <code>subprocess.Popen(...)</code> so I'm using <code>stdout=PIPE</code> as an arg.</p>
<p>However, because it's a long running process I also want to send the output to the console (as if I hadn't piped it) to give the user of the script an idea ... | 5 | 2009-08-15T22:48:42Z | 9,172,003 | <p>Inspired by pty.openpty() suggestion somewhere above, tested on python2.6, linux. Publishing since it took a while to make this working properly, w/o buffering...</p>
<pre><code>def call_and_peek_output(cmd, shell=False):
import pty, subprocess
master, slave = pty.openpty()
p = subprocess.Popen(cmd, she... | 1 | 2012-02-07T06:38:04Z | [
"python",
"pipe",
"popen"
] |
Programmatically change font color of text in PDF | 1,283,065 | <p>I'm not familiar with the PDF specification at all. I was wondering if it's possible to directly manipulate a PDF file so that certain blocks of text that I've identified as important are highlighted in colors of my choice. Language of choice would be python. </p>
| 7 | 2009-08-15T22:52:13Z | 1,283,166 | <p>It's possible, but not necessarily easy, because the PDF format is so rich. You can find a document describing it in detail <a href="http://www.adobe.com/devnet/acrobat/pdfs/PDF32000%5F2008.pdf">here</a>. The first elementary example it gives about how PDFs display text is:</p>
<pre><code>BT
/F13 12 Tf
288 720 Td
(... | 11 | 2009-08-16T00:07:21Z | [
"python",
"pdf",
"fonts"
] |
Programmatically change font color of text in PDF | 1,283,065 | <p>I'm not familiar with the PDF specification at all. I was wondering if it's possible to directly manipulate a PDF file so that certain blocks of text that I've identified as important are highlighted in colors of my choice. Language of choice would be python. </p>
| 7 | 2009-08-15T22:52:13Z | 1,285,029 | <p>Highlight is possible in pdf file using PDF annotations but doing it natively is not that easy job. If any of the mentioned library provide such facility is something that you may look for.</p>
| 0 | 2009-08-16T18:49:21Z | [
"python",
"pdf",
"fonts"
] |
A python based PowerShell? | 1,283,198 | <p>I just took a brief look at PowerShell (I knew it as Monad shell). My ignorant eyes see it more or less like a hybrid between regular bash and python. I would consider such integration between the two environments very cool on linux and osx, so I was wondering if it already exists (ipython is not really the same), a... | 9 | 2009-08-16T00:35:10Z | 1,283,259 | <p>As far as PowerShell on Linux or OSX, see <a href="http://igorshare.wordpress.com/2008/04/06/pash-cross-platform-powershell-is-out-in-the-wild-announcement/" rel="nofollow">Pash</a>, a cross-platform version of PowerShell using Mono.</p>
| 1 | 2009-08-16T01:17:51Z | [
"python",
"bash",
"powershell"
] |
A python based PowerShell? | 1,283,198 | <p>I just took a brief look at PowerShell (I knew it as Monad shell). My ignorant eyes see it more or less like a hybrid between regular bash and python. I would consider such integration between the two environments very cool on linux and osx, so I was wondering if it already exists (ipython is not really the same), a... | 9 | 2009-08-16T00:35:10Z | 1,283,300 | <p>I've only dabbled in Powershell, but what distinguishes it for me is the ability to pipe actual objects in the shell. In that respect, the closest I've found is actually using the IPython shell with <code>ipipe</code>:</p>
<ul>
<li><a href="http://wiki.ipython.org/Using_ipipe" rel="nofollow">Using ipipe</a></li>
<... | 10 | 2009-08-16T01:48:06Z | [
"python",
"bash",
"powershell"
] |
A python based PowerShell? | 1,283,198 | <p>I just took a brief look at PowerShell (I knew it as Monad shell). My ignorant eyes see it more or less like a hybrid between regular bash and python. I would consider such integration between the two environments very cool on linux and osx, so I was wondering if it already exists (ipython is not really the same), a... | 9 | 2009-08-16T00:35:10Z | 3,207,044 | <p>I think Hotwire is basically what you're thinking of:</p>
<p><a href="http://code.google.com/p/hotwire-shell/wiki/GettingStarted0700" rel="nofollow">http://code.google.com/p/hotwire-shell/wiki/GettingStarted0700</a></p>
<p>It's a shell-type environment where you can access the outputs as Python objects.</p>
<p>It... | 3 | 2010-07-08T19:08:21Z | [
"python",
"bash",
"powershell"
] |
A python based PowerShell? | 1,283,198 | <p>I just took a brief look at PowerShell (I knew it as Monad shell). My ignorant eyes see it more or less like a hybrid between regular bash and python. I would consider such integration between the two environments very cool on linux and osx, so I was wondering if it already exists (ipython is not really the same), a... | 9 | 2009-08-16T00:35:10Z | 39,823,437 | <p>An open source version of powershell does now exist. It can be found at <a href="https://msdn.microsoft.com/en-us/powershell" rel="nofollow">https://msdn.microsoft.com/en-us/powershell</a>.</p>
| 1 | 2016-10-03T01:30:42Z | [
"python",
"bash",
"powershell"
] |
Recursive generation + filtering. Better non-recursive? | 1,283,266 | <p>I have the following need (in python): </p>
<ul>
<li>generate all possible tuples of length 12 (could be more) containing either 0, 1 or 2 (basically, a ternary number with 12 digits)</li>
<li>filter these tuples according to specific criteria, culling those not good, and keeping the ones I need.</li>
</ul>
<p>As ... | 1 | 2009-08-16T01:23:16Z | 1,283,281 | <p>How about</p>
<pre><code>import itertools
results = []
for x in itertools.product(range(3), repeat=12):
if myfilter(x):
results.append(x)
</code></pre>
<p>where <code>myfilter</code> does the selection. Here, for example, only allowing result with 10 or more 1's,</p>
<pre><code>def myfilter(x): # e... | 4 | 2009-08-16T01:36:16Z | [
"python",
"functional-programming",
"recursion"
] |
Recursive generation + filtering. Better non-recursive? | 1,283,266 | <p>I have the following need (in python): </p>
<ul>
<li>generate all possible tuples of length 12 (could be more) containing either 0, 1 or 2 (basically, a ternary number with 12 digits)</li>
<li>filter these tuples according to specific criteria, culling those not good, and keeping the ones I need.</li>
</ul>
<p>As ... | 1 | 2009-08-16T01:23:16Z | 1,283,285 | <p><code>itertools</code> has functionality for dealing with this. However, here is a (hardcoded) way of handling with a generator:</p>
<pre><code>T = (0,1,2)
GEN = ((a,b,c,d,e,f,g,h,i,j,k,l) for a in T for b in T for c in T for d in T for e in T for f in T for g in T for h in T for i in T for j in T for k in T for ... | 1 | 2009-08-16T01:39:12Z | [
"python",
"functional-programming",
"recursion"
] |
Recursive generation + filtering. Better non-recursive? | 1,283,266 | <p>I have the following need (in python): </p>
<ul>
<li>generate all possible tuples of length 12 (could be more) containing either 0, 1 or 2 (basically, a ternary number with 12 digits)</li>
<li>filter these tuples according to specific criteria, culling those not good, and keeping the ones I need.</li>
</ul>
<p>As ... | 1 | 2009-08-16T01:23:16Z | 1,283,297 | <p>I'd implement an iterative binary adder or hamming code and run that way.</p>
| 0 | 2009-08-16T01:47:57Z | [
"python",
"functional-programming",
"recursion"
] |
Python Data Descriptor With Pass-through __set__ command | 1,283,435 | <p>I'm having a bit of an issue solving a problem I'm looking at. I have a specialized set of functions which are going to be in use across a program, which are basically dynamic callables which can replace functions and methods. Due to the need to have them work properly to emulate the functionality of methods, thes... | 1 | 2009-08-16T04:26:11Z | 1,283,461 | <p>I think the cleanest solution is to leave <code>__set__</code> alone, and set the descriptor on the class -- wrapping the original class if needed. I.e., instead of <code>x.a = Descriptor()</code>, do <code>setdesc(x, 'a', Descriptor()</code> where:</p>
<pre><code>class Wrapper(object): pass
def setdesc(x, name, ... | 1 | 2009-08-16T04:45:30Z | [
"python",
"function",
"methods",
"set",
"descriptor"
] |
Python Data Descriptor With Pass-through __set__ command | 1,283,435 | <p>I'm having a bit of an issue solving a problem I'm looking at. I have a specialized set of functions which are going to be in use across a program, which are basically dynamic callables which can replace functions and methods. Due to the need to have them work properly to emulate the functionality of methods, thes... | 1 | 2009-08-16T04:26:11Z | 1,283,545 | <p>I think I may have one answer to my question, though it's not all that pretty- it does sidestep the issue. My current plan of attack is to do what python does- bind the functions manually. I was already using my unbound function's <strong>get</strong> command to generate bound-type functions. One possible solutio... | 0 | 2009-08-16T05:51:31Z | [
"python",
"function",
"methods",
"set",
"descriptor"
] |
Entity Framwework-like ORM NOT for .NET | 1,283,646 | <p>What I really like about Entity framework is its drag and drop way of making up the whole model layer of your application. You select the tables, it joins them and you're done. If you update the database scheda, right click -> update and you're done again.</p>
<p>This seems to me miles ahead the competiting ORMs, l... | 2 | 2009-08-16T07:03:56Z | 1,284,168 | <p>SQLAlchemy database reflection gets you half way there. You'll still have to declare your classes and relations between them. Actually you could easily autogenerate the classes too, but you'll still need to name the relations somehow so you might as well declare the classes manually.</p>
<p>The code to setup your d... | 2 | 2009-08-16T12:13:09Z | [
"php",
"python",
"entity-framework",
"open-source"
] |
Entity Framwework-like ORM NOT for .NET | 1,283,646 | <p>What I really like about Entity framework is its drag and drop way of making up the whole model layer of your application. You select the tables, it joins them and you're done. If you update the database scheda, right click -> update and you're done again.</p>
<p>This seems to me miles ahead the competiting ORMs, l... | 2 | 2009-08-16T07:03:56Z | 1,321,695 | <p>I do not like âdrag and dropâ create of data access code. </p>
<p>At first sight it seems easy, but then you make a change to the database and have to update the data access code. This is where it becomes hard, as you often have to redo what you have done before, or hand edit the code the drag/drop designer c... | 2 | 2009-08-24T10:54:54Z | [
"php",
"python",
"entity-framework",
"open-source"
] |
Entity Framwework-like ORM NOT for .NET | 1,283,646 | <p>What I really like about Entity framework is its drag and drop way of making up the whole model layer of your application. You select the tables, it joins them and you're done. If you update the database scheda, right click -> update and you're done again.</p>
<p>This seems to me miles ahead the competiting ORMs, l... | 2 | 2009-08-16T07:03:56Z | 1,325,558 | <p>I have heard iBattis is good. A few companies fall back to iBattis when their programmer teams are not capable of understanding Hibernate (time issue).</p>
<p>Personally, I still like <strong>Linq2Sql</strong>. Yes, the first time someone needs to delete and redrag over a table seems like too much work, but it re... | 0 | 2009-08-25T01:06:09Z | [
"php",
"python",
"entity-framework",
"open-source"
] |
Python get wrong value for os.environ["ProgramFiles"] on 64bit vista | 1,283,664 | <p>Python 2.4.3 on a Vista64 machine.</p>
<p>The following 2 variables are in the environment:</p>
<pre><code>ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
</code></pre>
<p>But when I run the following</p>
<pre><code>import os
print os.environ["ProgramFiles"]
print os.environ["ProgramFiles(... | 3 | 2009-08-16T07:11:16Z | 1,283,667 | <p>From the <a href="http://en.wikipedia.org/wiki/Environment%5Fvariable#Examples%5Ffrom%5FMicrosoft%5FWindows">Wikipedia page</a>:</p>
<blockquote>
<p>%ProgramFiles%</p>
<p>This variable points to Program Files directory, which stores all the installed program of Windows and others. The default on English-lang... | 11 | 2009-08-16T07:14:12Z | [
"python",
"windows",
"64bit"
] |
Python get wrong value for os.environ["ProgramFiles"] on 64bit vista | 1,283,664 | <p>Python 2.4.3 on a Vista64 machine.</p>
<p>The following 2 variables are in the environment:</p>
<pre><code>ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
</code></pre>
<p>But when I run the following</p>
<pre><code>import os
print os.environ["ProgramFiles"]
print os.environ["ProgramFiles(... | 3 | 2009-08-16T07:11:16Z | 1,283,711 | <p>Can you install Python 2.5.4 and try again? UPDATE: I meant the x64 release of 2.5.4. AFAIK 2.4 was only available for Windows x86 and IA64, not x64.</p>
<p>I'm running 2.5.4 x64 on Win 7 x64 and I don't get the same result, but I'm not sure if the problem lies with Python or Vista in your case.</p>
<pre><code>Pyt... | 4 | 2009-08-16T07:48:22Z | [
"python",
"windows",
"64bit"
] |
Python get wrong value for os.environ["ProgramFiles"] on 64bit vista | 1,283,664 | <p>Python 2.4.3 on a Vista64 machine.</p>
<p>The following 2 variables are in the environment:</p>
<pre><code>ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
</code></pre>
<p>But when I run the following</p>
<pre><code>import os
print os.environ["ProgramFiles"]
print os.environ["ProgramFiles(... | 3 | 2009-08-16T07:11:16Z | 1,284,548 | <p>You are using the 32-bit version of Python interpreter. When using 32-bit software, WOW64 will create a new environment, with it own folders and substitutions.</p>
<p>You can see what I am talking about just by starting the 64-bit and the 32-bit version of the command prompt:</p>
<p>64-bit cmd.exe:</p>
<pre><code... | 6 | 2009-08-16T15:32:07Z | [
"python",
"windows",
"64bit"
] |
URLconfs in Django | 1,283,811 | <p>I am going through the Django sample application and come across the URLConf.</p>
<p>I thought the import statement on the top resolves the url location, but for 'mysite.polls.urls' I couldn't remove the quotes by including in the import statement.</p>
<p>Why should I use quotes for 'mysite.polls.urls' and not for... | 0 | 2009-08-16T08:50:35Z | 1,283,851 | <p>You've elided a bunch of stuff, but do you have the following statement in there?</p>
<pre><code>from django.contrib import admin
</code></pre>
<p>If so, that would explain why you don't need to quote the latter. See the django documentation for <a href="http://docs.djangoproject.com/en/dev/ref/contrib/admin/#hoo... | 1 | 2009-08-16T09:10:43Z | [
"python",
"django"
] |
Stackless python stopped mod_python/apache from working | 1,283,856 | <p>I installed stackless pyton 2.6.2 after reading several sites that said its fully compatible with vanilla python. After installing i found that my django applications do not work any more.</p>
<p>I did reinstall django (1.1) again and now im kind of lost. The error that i get is 500:</p>
<p>Internal Server Error</... | 0 | 2009-08-16T09:14:18Z | 1,284,586 | <p>When you install a new version of Python (whether stackless or not) you also need to reinstall all of the third party modules you need -- either from sources, which you say you don't want to do, or from packages built for the new version of Python you've just installed. </p>
<p>So, check the repository from which y... | 2 | 2009-08-16T15:46:07Z | [
"python",
"mod-wsgi",
"mod-python",
"stackless",
"python-stackless"
] |
Does one often use libraries outside the standard ones? | 1,283,922 | <p>I am trying to learn Python and referencing the documentation for the standard Python library from the Python website, and I was wondering if this was really the only library and documentation I will need or is there more? I do not plan to program advanced 3d graphics or anything advanced at the moment.</p>
<p>Edi... | 1 | 2009-08-16T09:55:51Z | 1,283,926 | <p>If you're just beginning, all you'll need to know is the stuff you can get from the Python website. Failing that a quick Google is the fastest way to get (most) Python answers these days.</p>
<p>As you develop your skills and become more advanced, you'll start looking for more exciting things to do, at which point ... | 0 | 2009-08-16T10:00:12Z | [
"python",
"libraries"
] |
Does one often use libraries outside the standard ones? | 1,283,922 | <p>I am trying to learn Python and referencing the documentation for the standard Python library from the Python website, and I was wondering if this was really the only library and documentation I will need or is there more? I do not plan to program advanced 3d graphics or anything advanced at the moment.</p>
<p>Edi... | 1 | 2009-08-16T09:55:51Z | 1,283,941 | <p>It's very hard to answer this without knowing what you're planning on using Python for. I recommend <a href="http://www.diveintopython.org/" rel="nofollow" title="Dive Into Python">Dive Into Python</a> as a useful resource for learning Python.</p>
<p>In terms of popular third party frameworks, for web applications ... | 0 | 2009-08-16T10:09:17Z | [
"python",
"libraries"
] |
Does one often use libraries outside the standard ones? | 1,283,922 | <p>I am trying to learn Python and referencing the documentation for the standard Python library from the Python website, and I was wondering if this was really the only library and documentation I will need or is there more? I do not plan to program advanced 3d graphics or anything advanced at the moment.</p>
<p>Edi... | 1 | 2009-08-16T09:55:51Z | 1,283,942 | <p>For the basics, yes, the standard Python library is probably all you'll need. But as you continue programming in Python, eventually you will need some other library for some task -- for instance, I recently needed to generate a tone at a specific, but differing, frequency for an application, and pyAudiere did the j... | 2 | 2009-08-16T10:09:26Z | [
"python",
"libraries"
] |
Does one often use libraries outside the standard ones? | 1,283,922 | <p>I am trying to learn Python and referencing the documentation for the standard Python library from the Python website, and I was wondering if this was really the only library and documentation I will need or is there more? I do not plan to program advanced 3d graphics or anything advanced at the moment.</p>
<p>Edi... | 1 | 2009-08-16T09:55:51Z | 1,283,963 | <p>Assuming that the standard library doesn't provide what we need and we don't have the time, or the knowledge, to implement the code we reuse 3rd party libraries.<br>
<br>
This is a common <em>attitude</em> regardless of the programming language.</p>
| 0 | 2009-08-16T10:20:44Z | [
"python",
"libraries"
] |
Does one often use libraries outside the standard ones? | 1,283,922 | <p>I am trying to learn Python and referencing the documentation for the standard Python library from the Python website, and I was wondering if this was really the only library and documentation I will need or is there more? I do not plan to program advanced 3d graphics or anything advanced at the moment.</p>
<p>Edi... | 1 | 2009-08-16T09:55:51Z | 1,284,028 | <p>As others have said, it depends on what you're into. The package index at <a href="http://pypi.python.org/pypi/" rel="nofollow">http://pypi.python.org/pypi/</a> has categories and summaries that are helpful in seeing what other libraries are available for different purposes. (Select "Browse packages" on the left t... | 2 | 2009-08-16T10:59:44Z | [
"python",
"libraries"
] |
Does one often use libraries outside the standard ones? | 1,283,922 | <p>I am trying to learn Python and referencing the documentation for the standard Python library from the Python website, and I was wondering if this was really the only library and documentation I will need or is there more? I do not plan to program advanced 3d graphics or anything advanced at the moment.</p>
<p>Edi... | 1 | 2009-08-16T09:55:51Z | 1,284,615 | <p>If there's a chance that someone else ever wanted to do what you want to do, there's a chance that someone created a library for it. A few minutes Googling something like "python image library" will find you what you need, or let you know that someone hasn't created a library for your purposes.</p>
| 0 | 2009-08-16T15:55:56Z | [
"python",
"libraries"
] |
Does one often use libraries outside the standard ones? | 1,283,922 | <p>I am trying to learn Python and referencing the documentation for the standard Python library from the Python website, and I was wondering if this was really the only library and documentation I will need or is there more? I do not plan to program advanced 3d graphics or anything advanced at the moment.</p>
<p>Edi... | 1 | 2009-08-16T09:55:51Z | 1,284,647 | <p>One very common library, that should also fit your current needs, is the <a href="http://effbot.org/zone/pil-index.htm" rel="nofollow">Python Image Library</a> (PIL).<br />
Note: the latest version is still in beta, and available only at <a href="http://effbot.org/zone/pil-index.htm" rel="nofollow">Effbot site</a>.<... | 1 | 2009-08-16T16:13:44Z | [
"python",
"libraries"
] |
how can I grab video from usb video capture + dvb device with gstreamer? | 1,284,008 | <p>I own a avermedia volar HX usb stick, I want to capture fromthe composite input , but I can't because I'm unable to select the input. I'm using gstreamer with + python, I think I need to use gsttuner select input but I have no experience using gstreamer's interfaces. Could someone post a simple example?</p>
<p>Than... | 1 | 2009-08-16T10:51:29Z | 2,342,345 | <pre><code>src = gst.element_factory_make("v4l2src", "src")
src.set_state(gst.STATE_PAUSED)
try:
# channel names will be different for each device
channels = src.list_channels()
composite = [x for x in channels if x.label == "Composite1"]
if composite:
self.src.set_channel(composite[0])
except A... | 1 | 2010-02-26T14:43:45Z | [
"python",
"gstreamer"
] |
how can I grab video from usb video capture + dvb device with gstreamer? | 1,284,008 | <p>I own a avermedia volar HX usb stick, I want to capture fromthe composite input , but I can't because I'm unable to select the input. I'm using gstreamer with + python, I think I need to use gsttuner select input but I have no experience using gstreamer's interfaces. Could someone post a simple example?</p>
<p>Than... | 1 | 2009-08-16T10:51:29Z | 2,610,696 | <p>The code shown above seems basically correct, but it will flounder on the rocks of v4l2. The strings you get will depend on what card you have:</p>
<p>On four different cards so far I've encountered:</p>
<ul>
<li>"Composite"</li>
<li>"Composite1"</li>
<li>"composite"</li>
<li>"Composite Video Input"</li>
</ul>
<... | 0 | 2010-04-09T20:29:53Z | [
"python",
"gstreamer"
] |
how can I grab video from usb video capture + dvb device with gstreamer? | 1,284,008 | <p>I own a avermedia volar HX usb stick, I want to capture fromthe composite input , but I can't because I'm unable to select the input. I'm using gstreamer with + python, I think I need to use gsttuner select input but I have no experience using gstreamer's interfaces. Could someone post a simple example?</p>
<p>Than... | 1 | 2009-08-16T10:51:29Z | 4,445,534 | <p>To anyone stumbling on this, some internal gstreamer changes since this was originally posted may require gst.STATE_READY now instead of STATE_PAUSED. Tripped me up as it seems half the capture devices I encounter default to PAL and I need to use the GST_TUNER interface to change it.</p>
| 1 | 2010-12-15T00:02:34Z | [
"python",
"gstreamer"
] |
Piping output of subprocess.call to progress bar | 1,284,196 | <p>I'm using growisofs to burn an iso through my Python application. I have two classes in two different files; GUI() (main.py) and Boxblaze() (core.py). GUI() builds the window and handles all the events and stuff, and Boxblaze() has all the methods that GUI() calls. </p>
<p>Now when the user has selected the device ... | 2 | 2009-08-16T12:28:41Z | 1,284,215 | <p>To get the output you need to use the <a href="http://docs.python.org/library/subprocess.html#subprocess.Popen" rel="nofollow"><code>subprocess.Popen</code></a> call. (<code>stdout = subprocess.PIPE</code>)</p>
<p>(Second Question)</p>
<p>You probably need a separate thread, unless the GUI framework can select on ... | 1 | 2009-08-16T12:37:23Z | [
"python",
"multithreading",
"progress-bar",
"pygtk",
"subprocess"
] |
Piping output of subprocess.call to progress bar | 1,284,196 | <p>I'm using growisofs to burn an iso through my Python application. I have two classes in two different files; GUI() (main.py) and Boxblaze() (core.py). GUI() builds the window and handles all the events and stuff, and Boxblaze() has all the methods that GUI() calls. </p>
<p>Now when the user has selected the device ... | 2 | 2009-08-16T12:28:41Z | 1,284,218 | <p>Can you pass a timeout to reading from subprocess? I guess you can because <a href="http://www.pixelbeat.org/libs/subProcess.py" rel="nofollow">my subProcess module</a> was used as design input for it. You can use that to growiso.read(.1) and then parse and display the percentage from the outdata (or maybe errdata).... | 0 | 2009-08-16T12:38:47Z | [
"python",
"multithreading",
"progress-bar",
"pygtk",
"subprocess"
] |
Piping output of subprocess.call to progress bar | 1,284,196 | <p>I'm using growisofs to burn an iso through my Python application. I have two classes in two different files; GUI() (main.py) and Boxblaze() (core.py). GUI() builds the window and handles all the events and stuff, and Boxblaze() has all the methods that GUI() calls. </p>
<p>Now when the user has selected the device ... | 2 | 2009-08-16T12:28:41Z | 1,320,519 | <p>You need to run the command from a separate thread, and update the gui with gobject.idle_add calls. Right now you have a class "Burning" but you are using it wrong, it should be used like this:</p>
<pre><code>self.burning = core.Burning(self.filechooser.get_filename(), self.listofdevices[self.combobox.get_active()]... | 0 | 2009-08-24T04:44:34Z | [
"python",
"multithreading",
"progress-bar",
"pygtk",
"subprocess"
] |
Piping output of subprocess.call to progress bar | 1,284,196 | <p>I'm using growisofs to burn an iso through my Python application. I have two classes in two different files; GUI() (main.py) and Boxblaze() (core.py). GUI() builds the window and handles all the events and stuff, and Boxblaze() has all the methods that GUI() calls. </p>
<p>Now when the user has selected the device ... | 2 | 2009-08-16T12:28:41Z | 1,485,018 | <p>You can use <code>glib.io_add_watch()</code> to watch for output on the pipes connected to stdout and stderr in the subprocess object.</p>
<pre><code>proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout_id = glib.io_add_watch(proc.stdout, glib.IO_IN|glib.IO_HUP, stdout_cb)
stderr_... | 2 | 2009-09-28T01:28:08Z | [
"python",
"multithreading",
"progress-bar",
"pygtk",
"subprocess"
] |
Debugging multi-threaded Python with Wing IDE | 1,284,382 | <p>I'm debugging a multi-threaded Python program with Wing IDE.</p>
<p>When I press the pause button, it pauses only one thread. I've tried it ten times and it always pauses the same thread, in my case called "ThreadTimer Thread", while the other threads keep on running. I want to pause these other threads so I could ... | 1 | 2009-08-16T14:06:40Z | 1,284,394 | <p>I don't know if multi-thread debugging is possible with Wing IDE. </p>
<p>However you maybe interested in <a href="http://winpdb.org/about/" rel="nofollow">Winpdb</a> which has this capability</p>
| 1 | 2009-08-16T14:16:28Z | [
"python",
"multithreading",
"debugging",
"ide"
] |
Debugging multi-threaded Python with Wing IDE | 1,284,382 | <p>I'm debugging a multi-threaded Python program with Wing IDE.</p>
<p>When I press the pause button, it pauses only one thread. I've tried it ten times and it always pauses the same thread, in my case called "ThreadTimer Thread", while the other threads keep on running. I want to pause these other threads so I could ... | 1 | 2009-08-16T14:06:40Z | 1,284,892 | <p>Per <a href="http://www.wingware.com/doc/debug/threading" rel="nofollow">the docs</a>, all threads that are running Python code are stopped (by default, i.e., unless you're going out of the way to achieve a different effect). Are the threads that you see as not getting stopped running non-Python code (I/O, say: that... | 1 | 2009-08-16T17:53:40Z | [
"python",
"multithreading",
"debugging",
"ide"
] |
Python - Use a Regex to Filter Data | 1,284,789 | <p>Is there a simple way to remove all characters from a given string that match a given regular expression? I know in Ruby I can use <code>gsub</code>:</p>
<pre><code>>> key = "cd baz ; ls -l"
=> "cd baz ; ls -l"
>> newkey = key.gsub(/[^\w\d]/, "")
=> "cdbazlsl"
</code></pre>
<p>What would the equi... | 4 | 2009-08-16T17:08:16Z | 1,284,802 | <pre><code>import re
re.sub(pattern, '', s)
</code></pre>
<p><a href="http://docs.python.org/library/re.html#re.sub">Docs</a></p>
| 13 | 2009-08-16T17:13:31Z | [
"python",
"regex"
] |
Python - Use a Regex to Filter Data | 1,284,789 | <p>Is there a simple way to remove all characters from a given string that match a given regular expression? I know in Ruby I can use <code>gsub</code>:</p>
<pre><code>>> key = "cd baz ; ls -l"
=> "cd baz ; ls -l"
>> newkey = key.gsub(/[^\w\d]/, "")
=> "cdbazlsl"
</code></pre>
<p>What would the equi... | 4 | 2009-08-16T17:08:16Z | 1,284,803 | <p><a href="http://docs.python.org/3.1/library/re.html#re.subn" rel="nofollow">re.subn()</a> is your friend:</p>
<pre><code>>>> import re
>>> key = "cd baz ; ls -l"
>>> re.subn(r'\W', "", key)
('cdbazlsl', 6)
>>> re.subn(r'\W', "", key)[0]
'cdbazlsl'
</code></pre>
<p>Returns a tupl... | 2 | 2009-08-16T17:14:41Z | [
"python",
"regex"
] |
Python - Use a Regex to Filter Data | 1,284,789 | <p>Is there a simple way to remove all characters from a given string that match a given regular expression? I know in Ruby I can use <code>gsub</code>:</p>
<pre><code>>> key = "cd baz ; ls -l"
=> "cd baz ; ls -l"
>> newkey = key.gsub(/[^\w\d]/, "")
=> "cdbazlsl"
</code></pre>
<p>What would the equi... | 4 | 2009-08-16T17:08:16Z | 1,284,807 | <pre><code>import re
old = "cd baz ; ls -l"
regex = r"[^\w\d]" # which is the same as \W btw
pat = re.compile( regex )
new = pat.sub('', old )
</code></pre>
| 2 | 2009-08-16T17:15:54Z | [
"python",
"regex"
] |
Python - Use a Regex to Filter Data | 1,284,789 | <p>Is there a simple way to remove all characters from a given string that match a given regular expression? I know in Ruby I can use <code>gsub</code>:</p>
<pre><code>>> key = "cd baz ; ls -l"
=> "cd baz ; ls -l"
>> newkey = key.gsub(/[^\w\d]/, "")
=> "cdbazlsl"
</code></pre>
<p>What would the equi... | 4 | 2009-08-16T17:08:16Z | 1,284,826 | <p>The answers so far have focused on doing the same thing as your Ruby code, which is exactly the reverse of what you're asking in the English part of your question: the code removes character that DO match, while your text asks for</p>
<blockquote>
<p>a simple way to remove all characters
from a given string tha... | 4 | 2009-08-16T17:23:59Z | [
"python",
"regex"
] |
Python - Use a Regex to Filter Data | 1,284,789 | <p>Is there a simple way to remove all characters from a given string that match a given regular expression? I know in Ruby I can use <code>gsub</code>:</p>
<pre><code>>> key = "cd baz ; ls -l"
=> "cd baz ; ls -l"
>> newkey = key.gsub(/[^\w\d]/, "")
=> "cdbazlsl"
</code></pre>
<p>What would the equi... | 4 | 2009-08-16T17:08:16Z | 39,707,425 | <p>May be the shortest way:</p>
<pre><code>In [32]: pattern='[-0-9.]'
....: price_str="Â¥-607.6B"
....: ''.join(re.findall(pattern,price_str))
Out[32]: '-607.6'
</code></pre>
| 0 | 2016-09-26T16:02:48Z | [
"python",
"regex"
] |
django auto entry generation | 1,284,814 | <p>I am trying to make an automated database entry generation with Django, whenever I trigger it to happen.</p>
<p>For instance, assume I have a such model:</p>
<pre><code>class status_entry(models.Model):
name = models.TextField()
date = models.DateField()
status = models.BooleanField()
</code></pre>
<p... | 0 | 2009-08-16T17:19:06Z | 1,284,971 | <p>You can overwrite <code>save</code> and do the autofill there (<code>daterange</code> function taken from <a href="http://stackoverflow.com/questions/1060279/iterating-through-a-range-of-dates-in-python">here</a>):</p>
<pre><code>from datetime import timedelta
def daterange(start_date, end_date):
for n in rang... | 0 | 2009-08-16T18:22:01Z | [
"python",
"django",
"django-models",
"scripting"
] |
AJAX upload in Python (WSGI) without Flash/Silverlight, with progress bar | 1,284,922 | <p>I am looking for a pure Javascript/Python upload example, that uses server polling instead of client-side SWF to display upload progress (like the one on rapidshare.com for example)</p>
<p>Currently, website is running on the standalone wsgi server included with Werkzeug framework, but may be moved to mod_wsgi if t... | 1 | 2009-08-16T18:03:48Z | 1,844,737 | <p>If you don't have support on the web side to track the size of the temporary file (or in-memory buffer) of the uploading data as it arrives, I don't know how you'll do this. Some of the popular web servers have special support for this, mostly experimental, but it's not widely supported and what you're trying to do... | 0 | 2009-12-04T03:55:09Z | [
"python",
"ajax",
"upload",
"progress",
"werkzeug"
] |
How can I check to see if a Python script was started interactively? | 1,285,024 | <p>I'd like for a script of mine to have 2 behaviours, one when started as a scheduled task, and another if started manually. How could I test for interactiveness?</p>
<p>EDIT: this could either be a cron job, or started by a windows batch file, through the scheduled tasks.</p>
| 2 | 2009-08-16T18:48:54Z | 1,285,045 | <p>If you want to know if you're reading from a terminal (not clear if that is enough of a distinction, please clarify) you can use</p>
<pre><code>sys.stdin.isatty()
</code></pre>
| 7 | 2009-08-16T18:53:11Z | [
"python",
"interactive"
] |
How can I check to see if a Python script was started interactively? | 1,285,024 | <p>I'd like for a script of mine to have 2 behaviours, one when started as a scheduled task, and another if started manually. How could I test for interactiveness?</p>
<p>EDIT: this could either be a cron job, or started by a windows batch file, through the scheduled tasks.</p>
| 2 | 2009-08-16T18:48:54Z | 1,285,056 | <p>You should simply add a command-line switch in the scheduled task, and check for it in your script, modifying the behavior as appropriate. Explicit is better than implicit.</p>
<p>One benefit to this design: you'll be able to test both behaviors, regardless of how you actually invoked the script.</p>
| 11 | 2009-08-16T18:55:54Z | [
"python",
"interactive"
] |
How can I check to see if a Python script was started interactively? | 1,285,024 | <p>I'd like for a script of mine to have 2 behaviours, one when started as a scheduled task, and another if started manually. How could I test for interactiveness?</p>
<p>EDIT: this could either be a cron job, or started by a windows batch file, through the scheduled tasks.</p>
| 2 | 2009-08-16T18:48:54Z | 1,286,066 | <p>I'd just add a command line switch when you're calling it with cron:</p>
<p>python yourscript.py -scheduled</p>
<p>then in your program</p>
<pre><code>import sys
if "-scheduled" in sys.argv:
#--non-interactive code--
else:
#--interactive code--
</code></pre>
| 0 | 2009-08-17T03:41:55Z | [
"python",
"interactive"
] |
How to avoid html-escaping in evoque | 1,285,134 | <p>I try to make my evoque templates color-code a bit,
but the html I get is already escaped with lt-gt's</p>
<p>I read there should be something like a quoted-no-more class
but I haven't been able to find the evoque.quoted package</p>
<p>My aim is to not have escaped html coming out of the template, but 'real'.</p... | 1 | 2009-08-16T19:28:35Z | 1,285,174 | <p>Have you tried it with <code>raw=True</code>? See:</p>
<ul>
<li><a href="http://evoque.gizmojo.org/howto/source/" rel="nofollow">http://evoque.gizmojo.org/howto/source/</a></li>
</ul>
<p>I haven't used Qpy before, but perhaps this note will help:</p>
<blockquote>
<p><a href="http://evoque.gizmojo.org/howto/quo... | 1 | 2009-08-16T19:41:39Z | [
"python"
] |
How to avoid html-escaping in evoque | 1,285,134 | <p>I try to make my evoque templates color-code a bit,
but the html I get is already escaped with lt-gt's</p>
<p>I read there should be something like a quoted-no-more class
but I haven't been able to find the evoque.quoted package</p>
<p>My aim is to not have escaped html coming out of the template, but 'real'.</p... | 1 | 2009-08-16T19:28:35Z | 1,285,281 | <p>Yeps - we got in parallel, ars and I.
The answer is here - snip it into above:</p>
<pre><code>from qpy import xml
def codyfy(src,lang="python"):
return xml(highlight(src,get_lexer_by_name(lang, stripall=True),HtmlFormatter()))
</code></pre>
<p>xml() is apparently sort of a payload making subsequent escapers la... | 1 | 2009-08-16T20:32:12Z | [
"python"
] |
How to avoid html-escaping in evoque | 1,285,134 | <p>I try to make my evoque templates color-code a bit,
but the html I get is already escaped with lt-gt's</p>
<p>I read there should be something like a quoted-no-more class
but I haven't been able to find the evoque.quoted package</p>
<p>My aim is to not have escaped html coming out of the template, but 'real'.</p... | 1 | 2009-08-16T19:28:35Z | 1,386,097 | <p>qpy.xml() is the quoted-no-more class for XML (and HTML) provided by the Qpy package -- in both superfast C and alternative python versions. Evoque looks for this specific class when quoting="xml" (i.e. equivalent to: quoting=qpy.xml) is used on template loading or rendering. </p>
<p>But any custom quoted-no-more t... | 0 | 2009-09-06T16:45:12Z | [
"python"
] |
Implement Comet / Server push in Google App Engine in Python | 1,285,150 | <p>How can I implement Comet / Server push in Google App Engine in Python?</p>
| 25 | 2009-08-16T19:34:16Z | 1,285,251 | <p>At this time, I would rule out doing Comet in App Engine (any language). Comet is based on long-lived HTTP connections, and App Engine will time out any single connection in about 30 seconds or so at most; it's hard to conceive of a worse match!</p>
| 3 | 2009-08-16T20:14:58Z | [
"python",
"google-app-engine",
"comet",
"server-push",
"channel-api"
] |
Implement Comet / Server push in Google App Engine in Python | 1,285,150 | <p>How can I implement Comet / Server push in Google App Engine in Python?</p>
| 25 | 2009-08-16T19:34:16Z | 1,285,914 | <p>Comet (or something like it - XMPP API) is on the google app engine roadmap. For now, stay away.</p>
<p><a href="http://code.google.com/appengine/docs/roadmap.html" rel="nofollow">http://code.google.com/appengine/docs/roadmap.html</a></p>
| 2 | 2009-08-17T02:14:21Z | [
"python",
"google-app-engine",
"comet",
"server-push",
"channel-api"
] |
Implement Comet / Server push in Google App Engine in Python | 1,285,150 | <p>How can I implement Comet / Server push in Google App Engine in Python?</p>
| 25 | 2009-08-16T19:34:16Z | 2,784,805 | <p>30 seconds is more than enough; either way you should return a no-op message when a time passed and no new events occur.</p>
<p>This prevents client timeouts and is done by everybody who does comet.</p>
<p>Just send the request, and on the server make it wait until an event or timeout after 25 seconds.</p>
| 1 | 2010-05-06T21:56:36Z | [
"python",
"google-app-engine",
"comet",
"server-push",
"channel-api"
] |
Implement Comet / Server push in Google App Engine in Python | 1,285,150 | <p>How can I implement Comet / Server push in Google App Engine in Python?</p>
| 25 | 2009-08-16T19:34:16Z | 2,870,191 | <p>We just announced the Channel API to do comet push with App Engine apps: <a href="http://googleappengine.blogspot.com/2010/05/app-engine-at-google-io-2010.html">http://googleappengine.blogspot.com/2010/05/app-engine-at-google-io-2010.html</a></p>
<p>If you're at Google IO, I'll be talking about this at 1pm tomorrow... | 69 | 2010-05-19T23:43:54Z | [
"python",
"google-app-engine",
"comet",
"server-push",
"channel-api"
] |
Implement Comet / Server push in Google App Engine in Python | 1,285,150 | <p>How can I implement Comet / Server push in Google App Engine in Python?</p>
| 25 | 2009-08-16T19:34:16Z | 3,918,651 | <p>Looking inside the App Engine 1.3.8-pre release, I see the Channel API service stub and more code. So it looks like we can start trying it out locally.</p>
| 0 | 2010-10-12T20:19:03Z | [
"python",
"google-app-engine",
"comet",
"server-push",
"channel-api"
] |
Implement Comet / Server push in Google App Engine in Python | 1,285,150 | <p>How can I implement Comet / Server push in Google App Engine in Python?</p>
| 25 | 2009-08-16T19:34:16Z | 4,480,891 | <p>Google App Engine supports server push using the Channel API since 2nd December.</p>
| 0 | 2010-12-19T00:03:00Z | [
"python",
"google-app-engine",
"comet",
"server-push",
"channel-api"
] |
How does one make logging color in Django/Google App Engine? | 1,285,372 | <p>If one iswriting a Django/ Google App Engine application and would like to have logs that are conveniently conspicuous based on color (i.e. errors in red), how does one set that up?</p>
<p>I've copied the helpful solution from <a href="http://stackoverflow.com/questions/384076/how-can-i-make-the-python-logging-outp... | 11 | 2009-08-16T21:20:08Z | 1,287,640 | <p>The reset codes mentioned in the answer you linked to will work on a console in the local development server (but will likely take some tweaking - you'll have to chain it with the existing App Engine logging handler), but won't work in production, since in production log entries are output to an HTML page in your ad... | 2 | 2009-08-17T12:19:02Z | [
"python",
"django",
"google-app-engine",
"logging",
"colors"
] |
How does one make logging color in Django/Google App Engine? | 1,285,372 | <p>If one iswriting a Django/ Google App Engine application and would like to have logs that are conveniently conspicuous based on color (i.e. errors in red), how does one set that up?</p>
<p>I've copied the helpful solution from <a href="http://stackoverflow.com/questions/384076/how-can-i-make-the-python-logging-outp... | 11 | 2009-08-16T21:20:08Z | 1,287,645 | <p>I don't believe that you should create a logger subclass just for this - airmind's answer is fine as far as creating a specialised <code>Formatter</code> and specifying its use on a <code>StreamHandler</code>. But there's no need for a logger subclass. In fact airmind's use of a logger class adds a handler to every ... | 2 | 2009-08-17T12:19:42Z | [
"python",
"django",
"google-app-engine",
"logging",
"colors"
] |
How does one make logging color in Django/Google App Engine? | 1,285,372 | <p>If one iswriting a Django/ Google App Engine application and would like to have logs that are conveniently conspicuous based on color (i.e. errors in red), how does one set that up?</p>
<p>I've copied the helpful solution from <a href="http://stackoverflow.com/questions/384076/how-can-i-make-the-python-logging-outp... | 11 | 2009-08-16T21:20:08Z | 2,998,155 | <p>Here is a sample formater:</p>
<pre><code>class Formatter(logging.Formatter) :
_level_colors = {
"DEBUG": "\033[22;32m", "INFO": "\033[01;34m",
"WARNING": "\033[22;35m", "ERROR": "\033[22;31m",
"CRITICAL": "\033[01;31m"
};
def format(self, record):
if(Formatter._level_co... | 2 | 2010-06-08T14:21:53Z | [
"python",
"django",
"google-app-engine",
"logging",
"colors"
] |
How does one make logging color in Django/Google App Engine? | 1,285,372 | <p>If one iswriting a Django/ Google App Engine application and would like to have logs that are conveniently conspicuous based on color (i.e. errors in red), how does one set that up?</p>
<p>I've copied the helpful solution from <a href="http://stackoverflow.com/questions/384076/how-can-i-make-the-python-logging-outp... | 11 | 2009-08-16T21:20:08Z | 3,080,300 | <p>I also wanted color output for the dev_appserver. I found the solutions here a little OTT (all I wanted was to make my logging.error() calls stand out. I ended up monkeypatching the logging module by dropping this in my main.py as a quick solution:</p>
<pre><code># monkey patch logger to dump ERRORs in red
import o... | 2 | 2010-06-20T17:53:19Z | [
"python",
"django",
"google-app-engine",
"logging",
"colors"
] |
How does one make logging color in Django/Google App Engine? | 1,285,372 | <p>If one iswriting a Django/ Google App Engine application and would like to have logs that are conveniently conspicuous based on color (i.e. errors in red), how does one set that up?</p>
<p>I've copied the helpful solution from <a href="http://stackoverflow.com/questions/384076/how-can-i-make-the-python-logging-outp... | 11 | 2009-08-16T21:20:08Z | 16,349,987 | <p>We use <a href="https://pypi.python.org/pypi/colorlog">colorlog</a> and it does exactly what you expect.</p>
<p>For posterity, the formatter config we use is:</p>
<pre><code>'color': {
'()': 'colorlog.ColoredFormatter',
'format': '%(log_color)s%(levelname)-8s %(message)s',
'log_colors': {
'DEBU... | 13 | 2013-05-03T00:53:38Z | [
"python",
"django",
"google-app-engine",
"logging",
"colors"
] |
How does one make logging color in Django/Google App Engine? | 1,285,372 | <p>If one iswriting a Django/ Google App Engine application and would like to have logs that are conveniently conspicuous based on color (i.e. errors in red), how does one set that up?</p>
<p>I've copied the helpful solution from <a href="http://stackoverflow.com/questions/384076/how-can-i-make-the-python-logging-outp... | 11 | 2009-08-16T21:20:08Z | 16,819,871 | <p>Django already has support for color output through the '<a href="https://docs.djangoproject.com/en/dev/ref/django-admin/#syntax-coloring">DJANGO_COLORS</a>' environment variable used for example when running the built in development server. Some person has noticed this and created a plug-and-play solution <a href="... | 6 | 2013-05-29T17:00:14Z | [
"python",
"django",
"google-app-engine",
"logging",
"colors"
] |
Python filter a list to only leave objects that occur once | 1,285,468 | <p>I would like to filter this list,</p>
<p>l = [0,1,1,2,2]</p>
<p>to only leave,</p>
<p>[0].</p>
<p>I'm struggling to do it in a 'pythonic' way :o) Is it possible without nested loops?</p>
| 5 | 2009-08-16T22:13:05Z | 1,285,475 | <p>You'll need two loops (or equivalently a loop and a listcomp, like below), but not nested ones:</p>
<pre><code>import collections
d = collections.defaultdict(int)
for x in L: d[x] += 1
L[:] = [x for x in L if d[x] == 1]
</code></pre>
<p>This solution assumes that the list items are <em>hashable</em>, that is, that... | 12 | 2009-08-16T22:16:56Z | [
"python",
"list",
"filter"
] |
Python filter a list to only leave objects that occur once | 1,285,468 | <p>I would like to filter this list,</p>
<p>l = [0,1,1,2,2]</p>
<p>to only leave,</p>
<p>[0].</p>
<p>I'm struggling to do it in a 'pythonic' way :o) Is it possible without nested loops?</p>
| 5 | 2009-08-16T22:13:05Z | 1,285,482 | <pre><code>[x for x in the_list if the_list.count(x)==1]
</code></pre>
<p>Though that's still a nested loop behind the scenes.</p>
| 8 | 2009-08-16T22:18:33Z | [
"python",
"list",
"filter"
] |
Python filter a list to only leave objects that occur once | 1,285,468 | <p>I would like to filter this list,</p>
<p>l = [0,1,1,2,2]</p>
<p>to only leave,</p>
<p>[0].</p>
<p>I'm struggling to do it in a 'pythonic' way :o) Is it possible without nested loops?</p>
| 5 | 2009-08-16T22:13:05Z | 1,285,484 | <pre><code>>>> l = [0,1,1,2,2]
>>> [x for x in l if l.count(x) is 1]
[0]
</code></pre>
| 3 | 2009-08-16T22:20:29Z | [
"python",
"list",
"filter"
] |
Python filter a list to only leave objects that occur once | 1,285,468 | <p>I would like to filter this list,</p>
<p>l = [0,1,1,2,2]</p>
<p>to only leave,</p>
<p>[0].</p>
<p>I'm struggling to do it in a 'pythonic' way :o) Is it possible without nested loops?</p>
| 5 | 2009-08-16T22:13:05Z | 1,285,648 | <pre><code>l = [0,1,2,1,2]
def justonce( l ):
once = set()
more = set()
for x in l:
if x not in more:
if x in once:
more.add(x)
once.remove( x )
else:
once.add( x )
return once
print justonce( l )
</code></pre>
| 3 | 2009-08-16T23:37:19Z | [
"python",
"list",
"filter"
] |
Python filter a list to only leave objects that occur once | 1,285,468 | <p>I would like to filter this list,</p>
<p>l = [0,1,1,2,2]</p>
<p>to only leave,</p>
<p>[0].</p>
<p>I'm struggling to do it in a 'pythonic' way :o) Is it possible without nested loops?</p>
| 5 | 2009-08-16T22:13:05Z | 1,285,770 | <p>Here's another dictionary oriented way:</p>
<pre><code>l = [0, 1, 1, 2, 2]
d = {}
for i in l: d[i] = d.has_key(i)
[k for k in d.keys() if not d[k]]
</code></pre>
| 5 | 2009-08-17T00:58:17Z | [
"python",
"list",
"filter"
] |
Python filter a list to only leave objects that occur once | 1,285,468 | <p>I would like to filter this list,</p>
<p>l = [0,1,1,2,2]</p>
<p>to only leave,</p>
<p>[0].</p>
<p>I'm struggling to do it in a 'pythonic' way :o) Is it possible without nested loops?</p>
| 5 | 2009-08-16T22:13:05Z | 1,285,810 | <p>In the same spirit as Alex's solution you can use a <a href="http://code.activestate.com/recipes/576611/" rel="nofollow">Counter</a>/multiset (built in 2.7, recipe compatible from 2.5 and above) to do the same thing:</p>
<pre><code>In [1]: from counter import Counter
In [2]: L = [0, 1, 1, 2, 2]
In [3]: multiset =... | 4 | 2009-08-17T01:18:15Z | [
"python",
"list",
"filter"
] |
Python filter a list to only leave objects that occur once | 1,285,468 | <p>I would like to filter this list,</p>
<p>l = [0,1,1,2,2]</p>
<p>to only leave,</p>
<p>[0].</p>
<p>I'm struggling to do it in a 'pythonic' way :o) Is it possible without nested loops?</p>
| 5 | 2009-08-16T22:13:05Z | 1,285,916 | <p>I think the actual timings are kind of interesting:</p>
<p>Alex' answer:</p>
<pre><code>python -m timeit -s "l = range(1,1000,2) + range(1,1000,3); import collections" "d = collections.defaultdict(int)" "for x in l: d[x] += 1" "l[:] = [x for x in l if d[x] == 1]"
1000 loops, best of 3: 370 usec per loop
</code></p... | 1 | 2009-08-17T02:16:14Z | [
"python",
"list",
"filter"
] |
Python filter a list to only leave objects that occur once | 1,285,468 | <p>I would like to filter this list,</p>
<p>l = [0,1,1,2,2]</p>
<p>to only leave,</p>
<p>[0].</p>
<p>I'm struggling to do it in a 'pythonic' way :o) Is it possible without nested loops?</p>
| 5 | 2009-08-16T22:13:05Z | 1,286,037 | <pre><code>>>> l = [0,1,1,2,2]
>>> [x for x in l if l.count(x) == 1]
[0]
</code></pre>
| 1 | 2009-08-17T03:27:06Z | [
"python",
"list",
"filter"
] |
What would you call a non-persistent data structure that allows persistent operations? | 1,285,657 | <p>I've got a class that is essentially mutable, but allows for some "persistent-like" operations. For example, I can mutate the object like this (in Python):</p>
<pre><code># create an object with y equal to 3 and z equal to "foobar"
x = MyDataStructure(y = 3, z = "foobar")
x.y = 4
</code></pre>
<p>However, in lie... | 4 | 2009-08-16T23:43:37Z | 1,285,668 | <p>I call this kind of data <strong>Persistable</strong> but not sure if it's a word
.</p>
| 2 | 2009-08-16T23:48:39Z | [
"python",
"data-structures",
"functional-programming",
"persistence",
"naming"
] |
What would you call a non-persistent data structure that allows persistent operations? | 1,285,657 | <p>I've got a class that is essentially mutable, but allows for some "persistent-like" operations. For example, I can mutate the object like this (in Python):</p>
<pre><code># create an object with y equal to 3 and z equal to "foobar"
x = MyDataStructure(y = 3, z = "foobar")
x.y = 4
</code></pre>
<p>However, in lie... | 4 | 2009-08-16T23:43:37Z | 1,285,682 | <p>It's just a optimized copy, I'd rather rename the operation to reflect that. </p>
<pre><code>a = x.copy_with(y=4)
</code></pre>
| 2 | 2009-08-16T23:56:42Z | [
"python",
"data-structures",
"functional-programming",
"persistence",
"naming"
] |
Using Python Mechanize like "Tamper Data" | 1,285,895 | <p>I'm writing a web testing script with python (2.6) and mechanize (0.1.11). The page I'm working with has an html form with a select field like this:</p>
<pre><code><select name="field1" size="1">
<option value="A" selected>A</option>
<option value="B">B</option>
<option... | 3 | 2009-08-17T02:05:02Z | 1,286,047 | <p>After poking around with the guts of ClientForm, it looks like you can trick it into adding another item.</p>
<p>For a select field, something like this seems to work:</p>
<pre><code>xitem = ClientForm.Item(browser.form.find_control(name="field1"),
{'contents':'E', 'value':'E', 'label':'E'})
</code></pre>... | 7 | 2009-08-17T03:33:46Z | [
"python",
"forms",
"mechanize",
"tampering"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 1,285,919 | <p>How about this:</p>
<pre><code>if all(key in foo for key in ["foo","bar"]):
# do stuff
pass
</code></pre>
| 8 | 2009-08-17T02:17:41Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 1,285,920 | <p>Well, you could do this:</p>
<pre><code>>>> if all (k in foo for k in ("foo","bar")):
... print "They're there!"
...
They're there!
</code></pre>
| 174 | 2009-08-17T02:18:15Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 1,285,925 | <p>How about using lambda?</p>
<pre><code> if reduce( (lambda x, y: x and foo.has_key(y) ), [ True, "foo", "bar"] ): # do stuff
</code></pre>
| 1 | 2009-08-17T02:20:29Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 1,285,926 | <pre><code>if set(("foo", "bar")) <= set(myDict): ...
</code></pre>
| 67 | 2009-08-17T02:22:13Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 1,285,930 | <p>Using <strong><a href="http://docs.python.org/library/stdtypes.html#set-types-set-frozenset">sets</a></strong>:</p>
<pre><code>if set(("foo", "bar")).issubset(foo):
#do stuff
</code></pre>
<p>Alternatively:</p>
<pre><code>if set(("foo", "bar")) <= set(foo):
#do stuff
</code></pre>
| 17 | 2009-08-17T02:25:15Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 1,285,931 | <p>In case you want to: </p>
<ul>
<li>also get the values for the keys</li>
<li>check more than one dictonary</li>
</ul>
<p>then:</p>
<pre><code>from operator import itemgetter
foo = {'foo':1,'zip':2,'zam':3,'bar':4}
keys = ("foo","bar")
getter = itemgetter(*keys) # returns all values
try:
values = getter(foo)
... | 1 | 2009-08-17T02:25:45Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 1,285,936 | <p>Not to suggest that this isn't something that you haven't thought of, but I find that the simplest thing is usually the best:</p>
<pre><code>if ("foo" in foo) and ("bar" in foo):
# do stuff
</code></pre>
| 0 | 2009-08-17T02:28:47Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 1,286,027 | <pre><code>>>> if 'foo' in foo and 'bar' in foo:
... print 'yes'
...
yes
</code></pre>
<p>Jason, () aren't necessary in Python.</p>
| 1 | 2009-08-17T03:22:50Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 1,286,040 | <p>Alex Martelli's solution <code>set(queries) <= set(my_dict)</code> is the shortest code but may not be the fastest. Assume Q = len(queries) and D = len(my_dict).</p>
<p>This takes O(Q) + O(D) to make the two sets, and then (one hopes!) only O(min(Q,D)) to do the subset test -- assuming of course that Python set ... | 3 | 2009-08-17T03:28:50Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 1,552,005 | <h2>Simple benchmarking rig for 3 of the alternatives. </h2>
<p>Put in your own values for D and Q</p>
<pre><code>
>>> from timeit import Timer
>>> setup='''from random import randint as R;d=dict((str(R(0,1000000)),R(0,1000000)) for i in range(D));q=dict((str(R(0,1000000)),R(0,1000000)) for i in range(Q));print("loo... | 23 | 2009-10-11T22:51:48Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 25,458,648 | <p>You don't have to wrap the left side in a set. You can just do this:</p>
<pre class="lang-py prettyprint-override"><code>if {'foo', 'bar'} <= set(some_dict):
pass
</code></pre>
<p>This also performs better than the <code>all(k in d...)</code> solution.</p>
| 10 | 2014-08-23T05:06:54Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 31,413,508 | <pre><code>>>> ok
{'five': '5', 'two': '2', 'one': '1'}
>>> if ('two' and 'one' and 'five') in ok:
... print "cool"
...
cool
</code></pre>
<p>This seems to work</p>
| -1 | 2015-07-14T17:33:05Z | [
"python",
"dictionary"
] |
python: How do I check that multiple keys are in a dict in one go? | 1,285,911 | <p>I want to do something like:</p>
<pre><code>foo = {'foo':1,'zip':2,'zam':3,'bar':4}
if ("foo","bar") in foo:
#do stuff
</code></pre>
<p>I'm not sure if its possible but would like to know. :-)</p>
| 101 | 2009-08-17T02:12:35Z | 38,833,839 | <p>While I like Alex Martelli's answer, it doesn't seem Pythonic to me. That is, I thought an important part of being Pythonic is to be easily understandable. With that goal, <code><=</code> isn't easy to understand.</p>
<p>While it's more characters, using <code>issubset()</code> as suggested by Karl Voigtland's... | 2 | 2016-08-08T16:04:35Z | [
"python",
"dictionary"
] |
How To Clone/Mutate A Model In Django Without Subclassing | 1,285,977 | <p>'Ello, all. I'm trying to create a model in Django based on - but not subclassing or having a DB relation to - another model. My original model looks something like this: it stores some data with a date/time stamp. </p>
<pre><code>class Entry(Model):
data1 = FloatField()
data2 = FloatField()
enter... | 0 | 2009-08-17T02:53:09Z | 1,285,995 | <p>What if you create a AbstractEntry class with all the data1 stuff and then, two subclasses: Entry and EntryDailyAvg.</p>
<p>Check the docs for info on how to tell django that one class is abstract.</p>
| 2 | 2009-08-17T03:04:09Z | [
"python",
"django",
"django-models",
"dry",
"aggregation"
] |
Is the order of results coming from a list comprehension guaranteed? | 1,286,167 | <p>When using a list comprehension, is the order of the new list guaranteed in any way? As a contrived example, is the following behavior guaranteed by the definition of a list comprehension:</p>
<pre><code>>> a = [x for x in [1,2,3]]
>> a
[1, 2, 3]
</code></pre>
<p>Equally, is the following equality guar... | 14 | 2009-08-17T04:33:24Z | 1,286,180 | <p>Yes, the list comprehension preserves the order of the original iterable (if there is one).
If the original iterable is ordered (list, tuple, file, etc.), that's the order you'll get in the result. If your iterable is unordered (set, dict, etc.), there are no guarantees about the order of the items.</p>
| 20 | 2009-08-17T04:40:01Z | [
"python",
"list-comprehension"
] |
Is the order of results coming from a list comprehension guaranteed? | 1,286,167 | <p>When using a list comprehension, is the order of the new list guaranteed in any way? As a contrived example, is the following behavior guaranteed by the definition of a list comprehension:</p>
<pre><code>>> a = [x for x in [1,2,3]]
>> a
[1, 2, 3]
</code></pre>
<p>Equally, is the following equality guar... | 14 | 2009-08-17T04:33:24Z | 1,286,181 | <p>Yes, a list is a sequence. Sequence order is significant.</p>
| 1 | 2009-08-17T04:40:22Z | [
"python",
"list-comprehension"
] |
Where can i get technical information on how the internals of Django works? | 1,286,176 | <p>Where can i get the technical manuals/details of how django internals work, i.e. i would like to know when a request comes in from a client;</p>
<ul>
<li>which django function receives it? </li>
<li>what middleware get called? </li>
<li>how is the request object created? and what class/function creates it?</li>
<li... | 6 | 2009-08-17T04:38:12Z | 1,286,186 | <p>"Use the source, Luke." The beauty of open source software is that you can view (and modify) the code yourself.</p>
| 8 | 2009-08-17T04:42:23Z | [
"python",
"django"
] |
Where can i get technical information on how the internals of Django works? | 1,286,176 | <p>Where can i get the technical manuals/details of how django internals work, i.e. i would like to know when a request comes in from a client;</p>
<ul>
<li>which django function receives it? </li>
<li>what middleware get called? </li>
<li>how is the request object created? and what class/function creates it?</li>
<li... | 6 | 2009-08-17T04:38:12Z | 1,286,187 | <p>I doubt there are technical manuals on the subject. It might take a bit of digging, but the API documentation and the source code are your best bets for reliable, up-to-date information.</p>
| 1 | 2009-08-17T04:43:43Z | [
"python",
"django"
] |
Where can i get technical information on how the internals of Django works? | 1,286,176 | <p>Where can i get the technical manuals/details of how django internals work, i.e. i would like to know when a request comes in from a client;</p>
<ul>
<li>which django function receives it? </li>
<li>what middleware get called? </li>
<li>how is the request object created? and what class/function creates it?</li>
<li... | 6 | 2009-08-17T04:38:12Z | 1,286,191 | <p>The documentation often goes into detail when it has to in order to explain why things work the way they do. One of Django's design goals is to not rely on "magic" as much as possible. However, whenever Django <em>does</em> assume something (template locations within apps, for example) its clearly explained why in... | 0 | 2009-08-17T04:46:09Z | [
"python",
"django"
] |
Where can i get technical information on how the internals of Django works? | 1,286,176 | <p>Where can i get the technical manuals/details of how django internals work, i.e. i would like to know when a request comes in from a client;</p>
<ul>
<li>which django function receives it? </li>
<li>what middleware get called? </li>
<li>how is the request object created? and what class/function creates it?</li>
<li... | 6 | 2009-08-17T04:38:12Z | 1,286,241 | <p>Besides reading the source, here's a few articles I've tagged and bookmarked from a little while ago:</p>
<ul>
<li><a href="http://www.b-list.org/weblog/2006/jun/13/how-django-processes-request/">How Django processes a request</a></li>
<li><a href="http://uswaretech.com/blog/2009/06/django-request-response-processi... | 10 | 2009-08-17T05:09:40Z | [
"python",
"django"
] |
Where can i get technical information on how the internals of Django works? | 1,286,176 | <p>Where can i get the technical manuals/details of how django internals work, i.e. i would like to know when a request comes in from a client;</p>
<ul>
<li>which django function receives it? </li>
<li>what middleware get called? </li>
<li>how is the request object created? and what class/function creates it?</li>
<li... | 6 | 2009-08-17T04:38:12Z | 1,287,116 | <p>Easiest way to understand the internals of django, is by reading a book specifically written for that.</p>
<p>Read <a href="http://rads.stackoverflow.com/amzn/click/1430210478">Pro Django</a>. It provides you a good in depth understanding of the meta programming first and demonstrates how it is used in django model... | 8 | 2009-08-17T09:57:49Z | [
"python",
"django"
] |
Where can i get technical information on how the internals of Django works? | 1,286,176 | <p>Where can i get the technical manuals/details of how django internals work, i.e. i would like to know when a request comes in from a client;</p>
<ul>
<li>which django function receives it? </li>
<li>what middleware get called? </li>
<li>how is the request object created? and what class/function creates it?</li>
<li... | 6 | 2009-08-17T04:38:12Z | 1,287,730 | <p>Simply reading the source might be a bit overwhelming, especially since the upper-most part is a bit confusing (how the webserver hands off the request to Django code). I find a good way to get started reading the code is to set a debugger breakpoint in your view function:</p>
<pre><code>def time(request):
imp... | 5 | 2009-08-17T12:37:37Z | [
"python",
"django"
] |
Why does this python method gives an error saying global name not defined? | 1,286,235 | <p>I have a single code file for my Google App Engine project. This simple file has one class, and inside it a few methods.
Why does this python method gives an error saying global name not defined?
<br>Erro NameError: global name 'gen_groups' is not defined</p>
<pre><code>import wsgiref.handlers
from google.appengi... | 0 | 2009-08-17T05:07:54Z | 1,286,247 | <p>You need to call it explicitly with an instance:</p>
<pre><code>groups = self.gen_groups(input)
</code></pre>
<p>Similarly for some of the other calls you're making in there, e.g. <code>gen_album</code>.</p>
<p>Also, see <a href="http://diveintopython.net/object_oriented_framework/defining_classes.html#d0e11896" ... | 1 | 2009-08-17T05:11:27Z | [
"python",
"google-app-engine"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.