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 |
|---|---|---|---|---|---|---|---|---|---|
Google App Engine (python): TemplateSyntaxError: 'for' statements with five words should end in 'reversed' | 2,563,365 | <p>This is using the web app framework, not Django. </p>
<p>The following template code is giving me an <strong>TemplateSyntaxError: 'for' statements with five words should end in 'reversed'</strong> error when I try to render a dictionary. I don't understand what's causing this error. Could somebody shed some light o... | 6 | 2010-04-01T20:16:15Z | 2,563,544 | <blockquote>
<p>This is using the web app framework,
not Django.</p>
</blockquote>
<p>But framework apart, you must be using Django's templating -- and apparently in an old version, which does not support the "automatic unpacking" style of <code>for</code> -- probably the <a href="http://www.djangoproject.com/docu... | 13 | 2010-04-01T20:44:12Z | [
"python",
"django",
"google-app-engine",
"django-templates"
] |
Pylons check for cookie on every page load | 2,563,528 | <p>I want to check whether or not a cookie is set with every page load in Pylons. Where's the best place to put this logic? Thanks!</p>
| 1 | 2010-04-01T20:40:56Z | 2,563,615 | <p>You can modify __call__ function in BaseController.</p>
| 1 | 2010-04-01T20:54:25Z | [
"python",
"pylons"
] |
Optimising RSS parsing on App Engine to avoid high CPU warnings | 2,563,568 | <p>I'm pulling some RSS feeds into a datastore in App Engine to serve up to an iPhone app. I use cron to schedule updating the RSS every x minutes. Each task only parses one RSS feed (which has 15-20 items). I frequently get warnings about high CPU usage in the App Engine dashboard, so I'm looking for ways to optimise ... | 5 | 2010-04-01T20:48:16Z | 2,563,723 | <p>I'd try <a href="http://docs.python.org/library/xml.etree.elementtree.html" rel="nofollow">ElementTree</a> or the <a href="http://code.google.com/p/feedparser/" rel="nofollow">Universal Feed Parser</a> and see if they're any better. ElementTree is in the stdlib as of Python 2.5, so it's available on App Engine.</p>... | 1 | 2010-04-01T21:09:38Z | [
"python",
"google-app-engine"
] |
Optimising RSS parsing on App Engine to avoid high CPU warnings | 2,563,568 | <p>I'm pulling some RSS feeds into a datastore in App Engine to serve up to an iPhone app. I use cron to schedule updating the RSS every x minutes. Each task only parses one RSS feed (which has 15-20 items). I frequently get warnings about high CPU usage in the App Engine dashboard, so I'm looking for ways to optimise ... | 5 | 2010-04-01T20:48:16Z | 2,563,892 | <p>You probably should run a profiler to pinpoint where the code is spinning its wheels. It could be waiting on the connections as some RSS feeds are REAL slow. </p>
<p>Also, some RDF/RSS/ATOM libraries build in a governor to keep from beating the cr*p out of the host when retrieving multiple feeds from the same site.... | 0 | 2010-04-01T21:45:36Z | [
"python",
"google-app-engine"
] |
Optimising RSS parsing on App Engine to avoid high CPU warnings | 2,563,568 | <p>I'm pulling some RSS feeds into a datastore in App Engine to serve up to an iPhone app. I use cron to schedule updating the RSS every x minutes. Each task only parses one RSS feed (which has 15-20 items). I frequently get warnings about high CPU usage in the App Engine dashboard, so I'm looking for ways to optimise ... | 5 | 2010-04-01T20:48:16Z | 2,564,144 | <h2>Outsource feed parsing via for example superfeedr</h2>
<p>You could also look into <a href="http://blog.notdot.net/2010/02/Consuming-RSS-feeds-with-PubSubHubbub" rel="nofollow">superfeedr.com</a>. They have a reasonable free quota/paying plans. They will do the polling(within 15 minutes you get updates) for you/et... | 4 | 2010-04-01T22:45:55Z | [
"python",
"google-app-engine"
] |
Optimising RSS parsing on App Engine to avoid high CPU warnings | 2,563,568 | <p>I'm pulling some RSS feeds into a datastore in App Engine to serve up to an iPhone app. I use cron to schedule updating the RSS every x minutes. Each task only parses one RSS feed (which has 15-20 items). I frequently get warnings about high CPU usage in the App Engine dashboard, so I'm looking for ways to optimise ... | 5 | 2010-04-01T20:48:16Z | 2,567,084 | <p>If you have a low amount of traffic coming to your site you might be experiencing spin up times for your app. If an app is idle for a as little as a few minutes app engine will spin down your app to save resources. When the next request comes in the app has to be spun up before it can handle the request and this all... | 1 | 2010-04-02T14:19:46Z | [
"python",
"google-app-engine"
] |
Optimising RSS parsing on App Engine to avoid high CPU warnings | 2,563,568 | <p>I'm pulling some RSS feeds into a datastore in App Engine to serve up to an iPhone app. I use cron to schedule updating the RSS every x minutes. Each task only parses one RSS feed (which has 15-20 items). I frequently get warnings about high CPU usage in the App Engine dashboard, so I'm looking for ways to optimise ... | 5 | 2010-04-01T20:48:16Z | 2,571,099 | <p>In regards to using PubSubHubbub to let someone else do the work for you, you may find my <a href="http://blog.notdot.net/2010/02/Consuming-RSS-feeds-with-PubSubHubbub" rel="nofollow">blog post on using hubbub on App Engine</a> to be useful.</p>
| 1 | 2010-04-03T11:24:52Z | [
"python",
"google-app-engine"
] |
Web-based game in Python + Django and client browser polling | 2,563,742 | <p>I am creating a text-based game that implements a basic model in which multiple (10+) players interact with data and one moderator watches them and sets certain environmental statistics that affect gameplay.</p>
<p>Recently I have begun to familiarize myself with Django. It seems to me that it would be an excellen... | 3 | 2010-04-01T21:12:36Z | 2,563,776 | <p>You could use <a href="http://en.wikipedia.org/wiki/Comet_%28programming%29" rel="nofollow">long polling</a>.</p>
<p>Also, if you're creating a multiplayer game, it might be much easier and more efficient to use a server that's designed for long polling and multi-user interaction instead of using a standard HTTP se... | 0 | 2010-04-01T21:18:53Z | [
"python",
"django"
] |
Web-based game in Python + Django and client browser polling | 2,563,742 | <p>I am creating a text-based game that implements a basic model in which multiple (10+) players interact with data and one moderator watches them and sets certain environmental statistics that affect gameplay.</p>
<p>Recently I have begun to familiarize myself with Django. It seems to me that it would be an excellen... | 3 | 2010-04-01T21:12:36Z | 2,564,803 | <p>In addition to long polling mentioned by Matti, the HTTP server can also stream the data by basically using one really long response and never finishing the response (but continuing to push more data to the client). The client can continue to respond to data as it comes in. As you've concluded polling is probably ... | 0 | 2010-04-02T02:58:29Z | [
"python",
"django"
] |
Better use a tuple or numpy array for storing coordinates | 2,563,773 | <p>I'm porting an C++ scientific application to python, and as I'm new to python, some problems come to my mind:</p>
<p>1) I'm defining a class that will contain the coordinates (x,y). These values will be accessed several times, but they only will be read after the class instantiation. Is it better to use an tuple or... | 7 | 2010-04-01T21:17:57Z | 2,564,787 | <p>A <code>numpy</code> array with an extra dimension is tighter in memory use, and at least as fast!, as a <code>numpy</code> array of tuples; complex numbers are at least as good or even better, including for your third question. BTW, you may have noticed that -- while questions asked later than yours were getting a... | 3 | 2010-04-02T02:50:41Z | [
"python",
"arrays",
"numpy",
"tuples",
"complex-numbers"
] |
Better use a tuple or numpy array for storing coordinates | 2,563,773 | <p>I'm porting an C++ scientific application to python, and as I'm new to python, some problems come to my mind:</p>
<p>1) I'm defining a class that will contain the coordinates (x,y). These values will be accessed several times, but they only will be read after the class instantiation. Is it better to use an tuple or... | 7 | 2010-04-01T21:17:57Z | 2,564,868 | <p>In terms of memory consumption, numpy arrays are more compact than Python tuples.
A numpy array uses a single contiguous block of memory. All elements of the numpy array must be of a declared type (e.g. 32-bit or 64-bit float.) A Python tuple does not necessarily use a contiguous block of memory, and the elements of... | 4 | 2010-04-02T03:37:33Z | [
"python",
"arrays",
"numpy",
"tuples",
"complex-numbers"
] |
Making Noise with Python | 2,563,788 | <p>I am trying to get python to make noise when certain things happen. Preferably, i would like to play music of some kind, however some kind of distinctive beeping would be sufficient, like an electronic timer going off. I have thus far only been able to make the system speaker chime using pywin32's Beep, however this... | 3 | 2010-04-01T21:22:13Z | 2,563,810 | <p>For windows, you can use the <code>winsound</code> standard library: <a href="http://docs.python.org/library/winsound.html" rel="nofollow">http://docs.python.org/library/winsound.html</a></p>
| 2 | 2010-04-01T21:27:16Z | [
"python",
"windows",
"audio",
"pywin32"
] |
Making Noise with Python | 2,563,788 | <p>I am trying to get python to make noise when certain things happen. Preferably, i would like to play music of some kind, however some kind of distinctive beeping would be sufficient, like an electronic timer going off. I have thus far only been able to make the system speaker chime using pywin32's Beep, however this... | 3 | 2010-04-01T21:22:13Z | 2,564,775 | <p>For cross-platform perfection and maximum flexibility, you could use <a href="http://www.pygame.org/docs/ref/mixer.html" rel="nofollow">pygame.mixer</a>.</p>
| 3 | 2010-04-02T02:46:42Z | [
"python",
"windows",
"audio",
"pywin32"
] |
Making Noise with Python | 2,563,788 | <p>I am trying to get python to make noise when certain things happen. Preferably, i would like to play music of some kind, however some kind of distinctive beeping would be sufficient, like an electronic timer going off. I have thus far only been able to make the system speaker chime using pywin32's Beep, however this... | 3 | 2010-04-01T21:22:13Z | 10,114,610 | <p>PyAudiere turns out to be the most convenient. It allows me to simply play an MP3, rather than generate the sound on the fly.</p>
| 0 | 2012-04-11T22:02:30Z | [
"python",
"windows",
"audio",
"pywin32"
] |
How do you composite an image onto another image with PIL in Python? | 2,563,822 | <p>I need to take an image and place it onto a new, generated white background in order for it to be converted into a downloadable desktop wallpaper. So the process would go:</p>
<ol>
<li>Generate new, all white image with 1440x900 dimensions</li>
<li>Place existing image on top, centered</li>
<li>Save as single image... | 26 | 2010-04-01T21:29:45Z | 2,563,876 | <p><code>Image.blend()</code>? [<a href="http://www.pythonware.com/library/pil/handbook/image.htm" rel="nofollow">link</a>]</p>
<p>Or, better yet, <code>Image.paste()</code>, same link.</p>
| 0 | 2010-04-01T21:41:58Z | [
"python",
"image-processing",
"python-imaging-library"
] |
How do you composite an image onto another image with PIL in Python? | 2,563,822 | <p>I need to take an image and place it onto a new, generated white background in order for it to be converted into a downloadable desktop wallpaper. So the process would go:</p>
<ol>
<li>Generate new, all white image with 1440x900 dimensions</li>
<li>Place existing image on top, centered</li>
<li>Save as single image... | 26 | 2010-04-01T21:29:45Z | 2,563,883 | <p>This can be accomplished with an Image instance's <code>paste</code> method:</p>
<pre><code>from PIL import Image
img = Image.open('/pathto/file', 'r')
img_w, img_h = img.size
background = Image.new('RGBA', (1440, 900), (255, 255, 255, 255))
bg_w, bg_h = background.size
offset = ((bg_w - img_w) / 2, (bg_h - img_h) ... | 42 | 2010-04-01T21:42:48Z | [
"python",
"image-processing",
"python-imaging-library"
] |
How do you composite an image onto another image with PIL in Python? | 2,563,822 | <p>I need to take an image and place it onto a new, generated white background in order for it to be converted into a downloadable desktop wallpaper. So the process would go:</p>
<ol>
<li>Generate new, all white image with 1440x900 dimensions</li>
<li>Place existing image on top, centered</li>
<li>Save as single image... | 26 | 2010-04-01T21:29:45Z | 19,678,543 | <p>Maybe too late, but for such image operations, we do use ImageSpecField [<a href="http://django-imagekit.readthedocs.org/en/latest/" rel="nofollow">link</a>] in model with original image.</p>
| 0 | 2013-10-30T09:34:13Z | [
"python",
"image-processing",
"python-imaging-library"
] |
How do you composite an image onto another image with PIL in Python? | 2,563,822 | <p>I need to take an image and place it onto a new, generated white background in order for it to be converted into a downloadable desktop wallpaper. So the process would go:</p>
<ol>
<li>Generate new, all white image with 1440x900 dimensions</li>
<li>Place existing image on top, centered</li>
<li>Save as single image... | 26 | 2010-04-01T21:29:45Z | 27,784,311 | <p>Based on unutbus answer:</p>
<pre><code>#!/usr/bin/env python
from PIL import Image
import math
def resize_canvas(old_image_path="314.jpg", new_image_path="save.jpg",
canvas_width=500, canvas_height=500):
"""Resize the canvas of old_image_path and store the new image in
new_image_pat... | 1 | 2015-01-05T17:01:16Z | [
"python",
"image-processing",
"python-imaging-library"
] |
Python urlparse, correct or incorrect? | 2,563,961 | <p>Python's urlparse function parses an url into six components (scheme, netloc, path and others stuff)</p>
<p>Now I've found that parsing "example.com/path/file.ext" return no netloc but a path "example.com/path/file.ext".</p>
<p>Should't it be netloc = "example.com" and path = "/path/file.ext"?</p>
<p>Do we really... | 3 | 2010-04-01T21:58:57Z | 2,563,999 | <p><code>example.com/path/file.ext</code> is not URL. It's just some string. For example if you put <code><a href="example.com/path/file.ext"></code> into HTML page, it will <em>not</em> link to <code>http://example.com/path/file.ext</code>. It's just a shortcut provided by web browsers that you do not have to pr... | 1 | 2010-04-01T22:05:58Z | [
"python",
"urlparse"
] |
Python urlparse, correct or incorrect? | 2,563,961 | <p>Python's urlparse function parses an url into six components (scheme, netloc, path and others stuff)</p>
<p>Now I've found that parsing "example.com/path/file.ext" return no netloc but a path "example.com/path/file.ext".</p>
<p>Should't it be netloc = "example.com" and path = "/path/file.ext"?</p>
<p>Do we really... | 3 | 2010-04-01T21:58:57Z | 2,564,000 | <p>Without the scheme://, there's no guarantee that example.com is a domain. You could have a directory called example.com. Similarly, you could have a url 'omfgroflmao/path/file.ext', how would you know if 'omfgroflmao' is a machine on the local network (i.e. a netloc) or whether it's meant to be a path component?</p>... | 6 | 2010-04-01T22:06:01Z | [
"python",
"urlparse"
] |
Rewriting Live TCP/IP (Layer 4) (i.e. Socket Layer) Streams | 2,563,978 | <p>I have a simple problem which I'm sure someone here has done before... </p>
<p>I want to rewrite Layer 4 TCP/IP streams (Not lower layer individual packets or frames.) Ettercap's <code>etterfilter</code> command lets you perform simple live replacements of Layer 4 TCP/IP streams based on fixed strings or regexes. E... | 13 | 2010-04-01T22:01:40Z | 2,564,016 | <p>Ettercap is seemingly an open source project, since it is hosted on SourceForge. Perhaps you should look at how it does it.</p>
| 1 | 2010-04-01T22:10:28Z | [
"python",
"c",
"security",
"network-programming",
"sockets"
] |
Rewriting Live TCP/IP (Layer 4) (i.e. Socket Layer) Streams | 2,563,978 | <p>I have a simple problem which I'm sure someone here has done before... </p>
<p>I want to rewrite Layer 4 TCP/IP streams (Not lower layer individual packets or frames.) Ettercap's <code>etterfilter</code> command lets you perform simple live replacements of Layer 4 TCP/IP streams based on fixed strings or regexes. E... | 13 | 2010-04-01T22:01:40Z | 2,564,133 | <p>It looks like you would be able to write an ettercap plugin that loads filters written in python. Or write your custom filter in C instead.</p>
| 0 | 2010-04-01T22:43:26Z | [
"python",
"c",
"security",
"network-programming",
"sockets"
] |
Rewriting Live TCP/IP (Layer 4) (i.e. Socket Layer) Streams | 2,563,978 | <p>I have a simple problem which I'm sure someone here has done before... </p>
<p>I want to rewrite Layer 4 TCP/IP streams (Not lower layer individual packets or frames.) Ettercap's <code>etterfilter</code> command lets you perform simple live replacements of Layer 4 TCP/IP streams based on fixed strings or regexes. E... | 13 | 2010-04-01T22:01:40Z | 2,566,832 | <p>Why not just access DATA.data directly with whatever filters you want?</p>
<p>I don't think you have to use search() you'll just have to build your own analyzer / state machine.</p>
<p>e.g.</p>
<p>for (int i = 0; i < DATA.len; i++) {
if ( DATA.data[i] == 'c' ) {
DATA.data[i] = q
}
}</p>
<p>Fin... | 0 | 2010-04-02T13:25:21Z | [
"python",
"c",
"security",
"network-programming",
"sockets"
] |
Rewriting Live TCP/IP (Layer 4) (i.e. Socket Layer) Streams | 2,563,978 | <p>I have a simple problem which I'm sure someone here has done before... </p>
<p>I want to rewrite Layer 4 TCP/IP streams (Not lower layer individual packets or frames.) Ettercap's <code>etterfilter</code> command lets you perform simple live replacements of Layer 4 TCP/IP streams based on fixed strings or regexes. E... | 13 | 2010-04-01T22:01:40Z | 2,567,099 | <p><a href="http://code.google.com/p/pypcap/" rel="nofollow">PyPCAP</a> is worth checking out since this all hinges around libpcap underneath to begin with. Cut out the middle man!</p>
| 0 | 2010-04-02T14:22:13Z | [
"python",
"c",
"security",
"network-programming",
"sockets"
] |
Rewriting Live TCP/IP (Layer 4) (i.e. Socket Layer) Streams | 2,563,978 | <p>I have a simple problem which I'm sure someone here has done before... </p>
<p>I want to rewrite Layer 4 TCP/IP streams (Not lower layer individual packets or frames.) Ettercap's <code>etterfilter</code> command lets you perform simple live replacements of Layer 4 TCP/IP streams based on fixed strings or regexes. E... | 13 | 2010-04-01T22:01:40Z | 2,588,017 | <p>Since Ettercap is opensource you can change its source code to do what you want. Running your own C code to rewrite a TCP stream should be relatively easy. The hard work has already been done.</p>
<p>Take a look at the <a href="http://www.irongeek.com/i.php?page=backtrack-3-man/etterfilter" rel="nofollow">etterfilt... | 0 | 2010-04-06T20:23:10Z | [
"python",
"c",
"security",
"network-programming",
"sockets"
] |
Rewriting Live TCP/IP (Layer 4) (i.e. Socket Layer) Streams | 2,563,978 | <p>I have a simple problem which I'm sure someone here has done before... </p>
<p>I want to rewrite Layer 4 TCP/IP streams (Not lower layer individual packets or frames.) Ettercap's <code>etterfilter</code> command lets you perform simple live replacements of Layer 4 TCP/IP streams based on fixed strings or regexes. E... | 13 | 2010-04-01T22:01:40Z | 2,605,035 | <p>Take a look on <a href="http://www.secdev.org/projects/scapy/" rel="nofollow">Scapy</a>, or another packet crafting tool. There are not much of this type out there.</p>
| 1 | 2010-04-09T04:09:58Z | [
"python",
"c",
"security",
"network-programming",
"sockets"
] |
Rewriting Live TCP/IP (Layer 4) (i.e. Socket Layer) Streams | 2,563,978 | <p>I have a simple problem which I'm sure someone here has done before... </p>
<p>I want to rewrite Layer 4 TCP/IP streams (Not lower layer individual packets or frames.) Ettercap's <code>etterfilter</code> command lets you perform simple live replacements of Layer 4 TCP/IP streams based on fixed strings or regexes. E... | 13 | 2010-04-01T22:01:40Z | 2,632,176 | <p>At the time I was writing a network traffic analysis tool using libpcap for the capture and libnids for the stream assembly. </p>
<p>I haven't tried reinjecting traffic, but you can use TAP to forward traffic to a user program that will use libnids to assemble the packets, put out streams to a filter code, then tak... | 1 | 2010-04-13T18:34:52Z | [
"python",
"c",
"security",
"network-programming",
"sockets"
] |
Python: Taking an array and break it into subarrays based on some criteria | 2,563,990 | <p>I have an array of files. I'd like to be able to break that array down into one array with multiple subarrays, each subarray contains files that were created on the same day. So right now if the array contains files from March 1 - March 31, I'd like to have an array with 31 subarrays (assuming there is at least > 1 ... | 1 | 2010-04-01T22:04:49Z | 2,564,014 | <p>To get the files with the latest timestamps for each day, use a dict with days as keys and tuples of (filename, timestamp) as the values. Loop through all the files, and update the dict value for that day if the dict timestamp is less than the current file, or if no value for that day exists yet.</p>
| 3 | 2010-04-01T22:09:59Z | [
"python"
] |
Python: Taking an array and break it into subarrays based on some criteria | 2,563,990 | <p>I have an array of files. I'd like to be able to break that array down into one array with multiple subarrays, each subarray contains files that were created on the same day. So right now if the array contains files from March 1 - March 31, I'd like to have an array with 31 subarrays (assuming there is at least > 1 ... | 1 | 2010-04-01T22:04:49Z | 2,564,035 | <p>If you need to split a list into list of lists by some criteria, have a look at <a href="http://docs.python.org/library/itertools.html#itertools.groupby" rel="nofollow">itertools.groupby()</a>.</p>
| 5 | 2010-04-01T22:16:04Z | [
"python"
] |
Python: Taking an array and break it into subarrays based on some criteria | 2,563,990 | <p>I have an array of files. I'd like to be able to break that array down into one array with multiple subarrays, each subarray contains files that were created on the same day. So right now if the array contains files from March 1 - March 31, I'd like to have an array with 31 subarrays (assuming there is at least > 1 ... | 1 | 2010-04-01T22:04:49Z | 2,564,098 | <p>Following up on Messa's answer, if your structure is like:</p>
<pre><code>files=[{'date': datetime(2010, 3, 1, 0, 0, 10), 'file': 'foo'},
{'date': datetime(2010, 3, 1, 12, 0, 10), 'file': 'bar'},
{'date': datetime(2010, 3, 2, 3, 5, 10), 'file': 'baz'},
{'date': datetime(2010, 3, 2, 3, 3, 10)... | 2 | 2010-04-01T22:34:24Z | [
"python"
] |
python: how to terminate a thread when main program ends | 2,564,137 | <p>If have a thread in infinite loop, is there a way to terminate it when main program ends (for example, when I press <code>ctrl+C</code>)?</p>
| 39 | 2010-04-01T22:44:52Z | 2,564,161 | <p>Check this question. The correct answer has great explanation on how to terminate threads the right way:
<a href="http://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python">http://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python</a></p>
<p>To make the thread... | 25 | 2010-04-01T22:51:56Z | [
"python",
"multithreading"
] |
python: how to terminate a thread when main program ends | 2,564,137 | <p>If have a thread in infinite loop, is there a way to terminate it when main program ends (for example, when I press <code>ctrl+C</code>)?</p>
| 39 | 2010-04-01T22:44:52Z | 2,564,282 | <p>If you make your worker threads daemon threads, they will die when all your non-daemon threads (e.g. the main thread) have exited.</p>
<p><a href="http://docs.python.org/library/threading.html#threading.Thread.daemon">http://docs.python.org/library/threading.html#threading.Thread.daemon</a></p>
| 44 | 2010-04-01T23:35:24Z | [
"python",
"multithreading"
] |
python: how to terminate a thread when main program ends | 2,564,137 | <p>If have a thread in infinite loop, is there a way to terminate it when main program ends (for example, when I press <code>ctrl+C</code>)?</p>
| 39 | 2010-04-01T22:44:52Z | 2,564,768 | <p>Use the <a href="http://docs.python.org/library/atexit.html?highlight=atexit#module-atexit">atexit</a> module of Python's standard library to register "termination" functions that get called (on the main thread) on any reasonably "clean" termination of the main thread, including an uncaught exception such as <code>K... | 9 | 2010-04-02T02:43:04Z | [
"python",
"multithreading"
] |
python: how to terminate a thread when main program ends | 2,564,137 | <p>If have a thread in infinite loop, is there a way to terminate it when main program ends (for example, when I press <code>ctrl+C</code>)?</p>
| 39 | 2010-04-01T22:44:52Z | 18,219,516 | <p>If you spawn a Thread like so - <code>myThread = Thread(target = function)</code> - and then do <code>myThread.start(); myThread.join()</code>. When CTRL-C is initiated, the main thread doesn't exit because it is waiting on that blocking <code>myThread.join()</code> call. To fix this, simply put in a timeout on the ... | 2 | 2013-08-13T21:25:50Z | [
"python",
"multithreading"
] |
Dynamic variable name in python | 2,564,140 | <p>I'd like to call a query with a field name filter that I wont know before run time... Not sure how to construct the variable name ...Or maybe I am tired.</p>
<pre><code>field_name = funct()
locations = Locations.objects.filter(field_name__lte=arg1)
</code></pre>
<p>where if funct() returns name would equal to</p>
... | 4 | 2010-04-01T22:45:03Z | 2,564,157 | <p>You can create a dictionary, set the parameters and pass this to the function by <a href="http://docs.python.org/tutorial/controlflow.html#tut-unpacking-arguments">unpacking the dictionary as keyword arguments</a>:</p>
<pre><code>field_name = funct()
params = {field_name + '__lte': arg1, # field_name should s... | 10 | 2010-04-01T22:50:19Z | [
"python",
"django"
] |
Server authorization with MD5 and SQL | 2,564,312 | <p>I currently have a SQL database of passwords stored in MD5. The server needs to generate a unique key, then sends to the client. In the client, it will use the key as a salt then hash together with the password and send back to the server.</p>
<p>The only problem is that the the SQL DB has the passwords in MD5 alre... | 2 | 2010-04-01T23:42:21Z | 2,564,367 | <p>You should use SSL to encrypt the connection, then send the password over plain text from the client. The server will then md5 and compare with the md5 hash in the database to see if they are the same. If so <code>auth = success</code>.</p>
<p>MD5'ing the password on the client buys you nothing because a hacker wit... | 1 | 2010-04-01T23:57:47Z | [
"python",
"sql",
"database",
"authorization",
"md5"
] |
Server authorization with MD5 and SQL | 2,564,312 | <p>I currently have a SQL database of passwords stored in MD5. The server needs to generate a unique key, then sends to the client. In the client, it will use the key as a salt then hash together with the password and send back to the server.</p>
<p>The only problem is that the the SQL DB has the passwords in MD5 alre... | 2 | 2010-04-01T23:42:21Z | 2,564,378 | <p>It is not completely clear to me what are you asking, but python <a href="http://docs.python.org/library/hashlib.html#module-hashlib" rel="nofollow">hashlib</a> (read the FAQ) and <a href="http://en.wikipedia.org/wiki/Authentication" rel="nofollow">wikipedia</a> should get you to where ever you are going.</p>
<p>Fo... | 0 | 2010-04-02T00:01:02Z | [
"python",
"sql",
"database",
"authorization",
"md5"
] |
Matplotlib digit grouping (decimal separator) | 2,564,362 | <p>Basically, when generating plots with matplotlib, The scale on the y-axis goes into the millions. How do I turn on digit grouping (i.e. so that 1000000 displays as 1,000,000) or turn on the decimal separator?</p>
| 3 | 2010-04-01T23:56:01Z | 2,566,805 | <p>I don't think there's a built-in function to do this. (That's what i thought after i read your Q; i just checked and couldn't find one in the Documentation). </p>
<p>In any event, it's easy to roll your own.</p>
<p>(Below is a complete example--ie, it will generate an mpl plot with one axis having commified tick l... | 3 | 2010-04-02T13:18:32Z | [
"python",
"data-visualization",
"matplotlib"
] |
Python mysql check for duplicate before insert | 2,564,568 | <p>here is the table</p>
<pre><code>CREATE TABLE IF NOT EXISTS kompas_url
(
id BIGINT(20) NOT NULL AUTO_INCREMENT,
url VARCHAR(1000),
created_date datetime,
modified_date datetime,
PRIMARY KEY(id)
)
</code></pre>
<p>I am trying to do INSERT to kompas_url table only if url is not exist yet</p>
<p... | 2 | 2010-04-02T01:09:50Z | 2,564,587 | <p>You can either find out whether it's in there first, by <code>SELECT</code>ing by <code>url</code>, or you can make the <code>url</code> field unique:</p>
<pre><code>CREATE TABLE IF NOT EXISTS kompas_url
...
url VARCHAR(1000) UNIQUE,
...
)
</code></pre>
<p>This will stop MySQL from inserting a duplicat... | 8 | 2010-04-02T01:18:13Z | [
"python",
"mysql",
"insert",
"no-duplicates"
] |
Using the groupby method in Python, example included | 2,564,614 | <p>Trying to work with groupby so that I can group together files that were created on the same day. When I say same day in this case, I mean the dd part in mm/dd/yyyy. So if a file was created on March 1 and April 1, they should be grouped together because the "1" matches. Here's the code I have so far:</p>
<pre><cod... | 1 | 2010-04-02T01:36:29Z | 2,564,623 | <p>The list that you're feeding to <code>groupby</code> needs to be sorted whatever it is that you are gouping by, in this case by <code>dd</code>.</p>
| 1 | 2010-04-02T01:40:04Z | [
"python"
] |
Using the groupby method in Python, example included | 2,564,614 | <p>Trying to work with groupby so that I can group together files that were created on the same day. When I say same day in this case, I mean the dd part in mm/dd/yyyy. So if a file was created on March 1 and April 1, they should be grouped together because the "1" matches. Here's the code I have so far:</p>
<pre><cod... | 1 | 2010-04-02T01:36:29Z | 2,564,628 | <p><code>groupby()</code> produces a new group every time the key changes, which means you have to sort your data first in order to group <em>all</em> similar elements together. Try this instead:</p>
<p><code>files = sorted(get_files(), key=(lambda x: x[1]))</code></p>
<p>and then run your <code>for</code> loop.</p>... | 2 | 2010-04-02T01:40:31Z | [
"python"
] |
Using the groupby method in Python, example included | 2,564,614 | <p>Trying to work with groupby so that I can group together files that were created on the same day. When I say same day in this case, I mean the dd part in mm/dd/yyyy. So if a file was created on March 1 and April 1, they should be grouped together because the "1" matches. Here's the code I have so far:</p>
<pre><cod... | 1 | 2010-04-02T01:36:29Z | 2,564,810 | <p>To quote the <a href="http://docs.python.org/library/itertools.html#itertools.groupby" rel="nofollow">docs</a>: "Generally, the iterable needs to already be sorted on the same key function."</p>
<pre><code>grouping = lambda x: x[1]
files.sort(key=grouping)
for key, group in groupby(files, grouping):
...
</code>... | 0 | 2010-04-02T03:02:32Z | [
"python"
] |
Using the groupby method in Python, example included | 2,564,614 | <p>Trying to work with groupby so that I can group together files that were created on the same day. When I say same day in this case, I mean the dd part in mm/dd/yyyy. So if a file was created on March 1 and April 1, they should be grouped together because the "1" matches. Here's the code I have so far:</p>
<pre><cod... | 1 | 2010-04-02T01:36:29Z | 19,625,859 | <p>It sounds like you don't need the streaming nature of the <code>groupby</code> found in standard itertools. A non-streaming <code>groupby</code> is implemented in the <a href="http://toolz.readthedocs.org/" rel="nofollow"><code>toolz</code> library</a>. </p>
<pre><code>$ pip install toolz
$ python
>>> f... | 0 | 2013-10-28T01:23:26Z | [
"python"
] |
Control VLC from Python in Windows | 2,564,815 | <p>I'm running <a href="http://www.videolan.org/vlc/">VLC</a> (a media player) in Windows 7. Is there way to control (as in: play, pause, set volume) a running instance of VLC from Python?</p>
| 7 | 2010-04-02T03:03:58Z | 2,564,839 | <p>Yes, you can control it <a href="http://www.videolan.org/doc/streaming-howto/en/ch05.html">via telnet</a> (with <a href="http://docs.python.org/library/telnetlib.html">telnetlib</a>). There are also <a href="http://wiki.videolan.org/Libvlc">libvlc bindings</a>, but I'm not sure you can use that to control an existin... | 5 | 2010-04-02T03:15:34Z | [
"python",
"windows",
"vlc"
] |
Control VLC from Python in Windows | 2,564,815 | <p>I'm running <a href="http://www.videolan.org/vlc/">VLC</a> (a media player) in Windows 7. Is there way to control (as in: play, pause, set volume) a running instance of VLC from Python?</p>
| 7 | 2010-04-02T03:03:58Z | 2,565,150 | <p>As a general alternative to already mentioned solutions it's good to know about <a href="http://pywinauto.openqa.org/" rel="nofollow">pywinauto</a></p>
<p><strong>UPDATE:</strong></p>
<p>Check out <a href="http://code.google.com/p/swapy/" rel="nofollow">swapy</a> for a way to with pywinauto more easily.</p>
| -1 | 2010-04-02T05:33:32Z | [
"python",
"windows",
"vlc"
] |
Python web devlopment framework for python 3.1 user | 2,564,822 | <p>I have been learning python for some time now. While starting this "learning python" endeavor I decided to learn the latest and greatest 3.1 version of python. I regret this decision now because I wanted to try my hands on some of the python web development frameworks & it looks like many of them do not support ... | 10 | 2010-04-02T03:06:14Z | 2,564,832 | <p>How about trying <a href="http://docs.python.org/dev/whatsnew/2.7.html" rel="nofollow">Python2.7</a>?, many of python 3.x features are backported to 2.7 recently, like OrderedDict, faster io modules, set comprehensions, dict comprehensions, etc...</p>
<p>And Python 2.7 is running no problem at all with django 1.2 t... | 5 | 2010-04-02T03:11:35Z | [
"python",
"web-frameworks"
] |
Python web devlopment framework for python 3.1 user | 2,564,822 | <p>I have been learning python for some time now. While starting this "learning python" endeavor I decided to learn the latest and greatest 3.1 version of python. I regret this decision now because I wanted to try my hands on some of the python web development frameworks & it looks like many of them do not support ... | 10 | 2010-04-02T03:06:14Z | 2,564,833 | <p>Python 2.6 and Python 3.1 are really not all that different, I simply suggest you learn both, especially since both branches of Python are going to coexist for a while... so best to just learn the slight differences. The document "<a href="http://docs.python.org/release/3.0.1/whatsnew/3.0.html" rel="nofollow">What's... | 1 | 2010-04-02T03:11:49Z | [
"python",
"web-frameworks"
] |
Python web devlopment framework for python 3.1 user | 2,564,822 | <p>I have been learning python for some time now. While starting this "learning python" endeavor I decided to learn the latest and greatest 3.1 version of python. I regret this decision now because I wanted to try my hands on some of the python web development frameworks & it looks like many of them do not support ... | 10 | 2010-04-02T03:06:14Z | 2,565,184 | <p>Like the others, I would suggest you start with Python 2.6.x -- Python 2.7 will be released this summer although you can grab an alpha or beta version today.</p>
<p>Although Python 3.x is backwards-incompatible with 2.x, Python syntax isn't going to be unrecognizable... pretty much everything is very similar to 2.x... | 3 | 2010-04-02T05:46:58Z | [
"python",
"web-frameworks"
] |
Python web devlopment framework for python 3.1 user | 2,564,822 | <p>I have been learning python for some time now. While starting this "learning python" endeavor I decided to learn the latest and greatest 3.1 version of python. I regret this decision now because I wanted to try my hands on some of the python web development frameworks & it looks like many of them do not support ... | 10 | 2010-04-02T03:06:14Z | 2,567,002 | <p>There <em>is</em> ( are) actually a Django port to Py3k.</p>
<p><a href="http://bitbucket.org/loewis/django-3k/" rel="nofollow">http://bitbucket.org/loewis/django-3k/</a></p>
<p>I can also remember quite good of having read a thread about a University project of porting Django to py3k, on the django-developers mai... | 1 | 2010-04-02T14:00:20Z | [
"python",
"web-frameworks"
] |
Python web devlopment framework for python 3.1 user | 2,564,822 | <p>I have been learning python for some time now. While starting this "learning python" endeavor I decided to learn the latest and greatest 3.1 version of python. I regret this decision now because I wanted to try my hands on some of the python web development frameworks & it looks like many of them do not support ... | 10 | 2010-04-02T03:06:14Z | 2,567,459 | <p>CherryPy 3.2 (still being worked on) will run on Python 3.x</p>
<p>Bottle can also run on Python 3.x after using 2to3 on it. Easy to do and it does work. However, Bottle is not a 'complete framework' but it is easy to use.</p>
<p>Edit:</p>
<p>I have used Bottle in Python 3.1, stackless python 3.1 to be specific, ... | 2 | 2010-04-02T15:26:21Z | [
"python",
"web-frameworks"
] |
No module named difflib | 2,564,870 | <p>I want to execute python code from C# with following code.</p>
<pre><code> static void Main(string[] args)
{
ScriptEngine engine = Python.CreateEngine();
ScriptSource source = engine.CreateScriptSourceFromFile(@"F:\Script\extracter.py");
source.Execute();
}
</code></pre>
<p>I have... | 1 | 2010-04-02T03:37:41Z | 2,566,949 | <p>This looks like your engine does not have access to Python standard library - it does not see <code>difflib.py</code>. Either fix the <code>sys.path</code> or copy <code>difflib.py</code> from Python 2.6 to <code>f:\script</code> folder.</p>
<p><code>re</code> and <code>itertools</code> modules are written in C# an... | 3 | 2010-04-02T13:48:24Z | [
"c#",
"python",
"ironpython",
"scriptengine"
] |
Best way to find similar items in python | 2,564,896 | <p>I have 1M numbers:N[], and 1 single number n, now I want to find in those 1M numbers that are similar to that single number, say an area of [n-10, n+10].
what's the best way in python to do this? Do I have to sort the 1M number and do an iteration?</p>
| 3 | 2010-04-02T03:46:21Z | 2,564,904 | <p><code>[x for x in N if n - 10 <= x <= n + 10]</code></p>
| 3 | 2010-04-02T03:50:11Z | [
"python",
"sorting"
] |
Best way to find similar items in python | 2,564,896 | <p>I have 1M numbers:N[], and 1 single number n, now I want to find in those 1M numbers that are similar to that single number, say an area of [n-10, n+10].
what's the best way in python to do this? Do I have to sort the 1M number and do an iteration?</p>
| 3 | 2010-04-02T03:46:21Z | 2,564,906 | <pre><code>results=[x for x in numbers if x >= n-10 and x <= n+10]
</code></pre>
| 1 | 2010-04-02T03:51:08Z | [
"python",
"sorting"
] |
Best way to find similar items in python | 2,564,896 | <p>I have 1M numbers:N[], and 1 single number n, now I want to find in those 1M numbers that are similar to that single number, say an area of [n-10, n+10].
what's the best way in python to do this? Do I have to sort the 1M number and do an iteration?</p>
| 3 | 2010-04-02T03:46:21Z | 2,564,927 | <p>Another solution:</p>
<pre><code>is_close_to_n = lambda x: n-10 <= x <= n+10
result = filter(is_close_to_n, N)
</code></pre>
<p>Generalizing a bit:</p>
<pre><code>def is_close_to(n):
f = lambda x: n-10 <= x <= n+10
return f
result12 = filter(is_close_to(12), N)
result123 = filter(is_close_to(... | 1 | 2010-04-02T03:56:31Z | [
"python",
"sorting"
] |
I want all three shapes on the same line...please help...! | 2,564,972 | <pre><code>#Top half of triangle
for rows in range (5):
for row in range (12):
print("-", end='')
print()
for row in range (5):
stars=0
while stars<=row:
print("*", end='')
stars=stars+1
print()
for row in range(5):
star=4
while star>=row:
... | 2 | 2010-04-02T04:10:40Z | 2,565,003 | <pre><code>shape1 = [12*'-' for i in range(5)] # segments of rectangle
shape2 = [i*'*' + (5-i)*' ' for i in range(1,5+1)] # segments of 1st triangle
shape3 = [(5-i)*' ' + i*'*' for i in range(1,5+1)] # segments of 2nd triangle
for line in zip(shape1, shape2, shape3):
print(" ".join(line))
<... | 3 | 2010-04-02T04:26:35Z | [
"python",
"python-3.x",
"nested-loops"
] |
I want all three shapes on the same line...please help...! | 2,564,972 | <pre><code>#Top half of triangle
for rows in range (5):
for row in range (12):
print("-", end='')
print()
for row in range (5):
stars=0
while stars<=row:
print("*", end='')
stars=stars+1
print()
for row in range(5):
star=4
while star>=row:
... | 2 | 2010-04-02T04:10:40Z | 2,565,005 | <p>First of all, your first print statement is syntactically wrong: <code>print("-", end='')</code> will throw a syntax error asking what end='' is.</p>
<p>Nevertheless, if your problem is with the newline, then you can always remedy that with a comma (',') at the end of your print statement to skip the newline, for e... | 0 | 2010-04-02T04:28:56Z | [
"python",
"python-3.x",
"nested-loops"
] |
"AttributeError: fileno" when attemping to import from pyevolve | 2,565,061 | <p>I just installed Pyevolve using easy_install and I am getting errors trying to run my first program. I first tried copy and pasting the source code of the <a href="http://pyevolve.sourceforge.net/getstarted.html#final-source-code" rel="nofollow">first example</a> but this is what I receive when I attempt to run it:... | 1 | 2010-04-02T04:58:26Z | 2,567,043 | <p>Have you tried to check out the Development version ? It's near of the RC1, so it is stable right now:
<code>svn co <a href="https://pyevolve.svn.sourceforge.net/svnroot/pyevolve/trunk" rel="nofollow">https://pyevolve.svn.sourceforge.net/svnroot/pyevolve/trunk</a> pyevolve</code></p>
<p>Your problem seems to be the... | 1 | 2010-04-02T14:10:44Z | [
"python",
"pyevolve"
] |
python RSA implemention with PKCS1 | 2,565,096 | <p>I got the following code in javascript for RSA implemention<a href="http://www-cs-students.stanford.edu/~tjw/jsbn/" rel="nofollow">http://www-cs-students.stanford.edu/~tjw/jsbn/</a>:</p>
<pre><code> // Return the PKCS#1 RSA encryption of "text" as an even-length hex string
function RSAEncrypt(text) {
var m = pk... | 0 | 2010-04-02T05:12:57Z | 6,917,811 | <p>I know it's a bit late, but in a few days I'll release a new version of my Python-RSA package. That version will include PKCS#1 v1.5 padding, so it should be compatible with your JavaScript code ;-)</p>
| 0 | 2011-08-02T19:56:28Z | [
"python",
"rsa",
"jsbn"
] |
WxPython Incompatible With Snow Leopard? | 2,565,201 | <p>Recently I upgraded to Snow Leopard, and now I can't run programs built with wxPython. The errors I get are (from Eclipse + PyDev):</p>
<pre><code> import wx
File "/var/tmp/wxWidgets/wxWidgets-13~231/2.6/DSTROOT/System/Library/Frameworks
/Python.framework/Versions/2.6/Extras/lib/
python/wx-2.8-mac-unicode/w... | 18 | 2010-04-02T05:51:09Z | 2,565,220 | <p>The problem is that WxPython is only available on the Mac in 32-bit mode; however, by default, Python will start up in 64-bit mode. To fix this problem, create the following shell script named <code>python_32</code>:</p>
<pre>
#! /bin/bash
export VERSIONER_PYTHON_PREFER_32_BIT=yes
/usr/bin/python "$@"
</pre>
<p>Ma... | 25 | 2010-04-02T05:59:54Z | [
"python",
"eclipse",
"wxpython",
"pydev"
] |
WxPython Incompatible With Snow Leopard? | 2,565,201 | <p>Recently I upgraded to Snow Leopard, and now I can't run programs built with wxPython. The errors I get are (from Eclipse + PyDev):</p>
<pre><code> import wx
File "/var/tmp/wxWidgets/wxWidgets-13~231/2.6/DSTROOT/System/Library/Frameworks
/Python.framework/Versions/2.6/Extras/lib/
python/wx-2.8-mac-unicode/w... | 18 | 2010-04-02T05:51:09Z | 2,565,658 | <p>Another solution is to download and install Python 2.6 for OS X from <a href="http://www.python.org/download/" rel="nofollow">python.org</a> and install wxPython for OS X from <a href="http://www.wxpython.org/download.php" rel="nofollow">here</a> with it. The python.org 2.6 is newer (2.6.5 as of now) than the Apple... | 1 | 2010-04-02T08:08:14Z | [
"python",
"eclipse",
"wxpython",
"pydev"
] |
WxPython Incompatible With Snow Leopard? | 2,565,201 | <p>Recently I upgraded to Snow Leopard, and now I can't run programs built with wxPython. The errors I get are (from Eclipse + PyDev):</p>
<pre><code> import wx
File "/var/tmp/wxWidgets/wxWidgets-13~231/2.6/DSTROOT/System/Library/Frameworks
/Python.framework/Versions/2.6/Extras/lib/
python/wx-2.8-mac-unicode/w... | 18 | 2010-04-02T05:51:09Z | 2,577,045 | <p>Hm. The script provided didn't work for me-- I changed it as follows:</p>
<pre><code>#! /bin/bash
echo "-----------------Python 2.6 - 32 Bit setup --------------------"
echo "Running" $1
export VERSIONER_PYTHON_PREFER_32_BIT yes
/usr/bin/python2.6 $1
</code></pre>
<p>Still didn't work. I get the same message. R... | 0 | 2010-04-05T05:21:09Z | [
"python",
"eclipse",
"wxpython",
"pydev"
] |
WxPython Incompatible With Snow Leopard? | 2,565,201 | <p>Recently I upgraded to Snow Leopard, and now I can't run programs built with wxPython. The errors I get are (from Eclipse + PyDev):</p>
<pre><code> import wx
File "/var/tmp/wxWidgets/wxWidgets-13~231/2.6/DSTROOT/System/Library/Frameworks
/Python.framework/Versions/2.6/Extras/lib/
python/wx-2.8-mac-unicode/w... | 18 | 2010-04-02T05:51:09Z | 3,908,316 | <p>You might also want to try <strong>arch</strong> command when invoking python:<code>arch -i386 /usr/bin/python2.6</code> if you can't get Python to run with the correct environmental settings. The '-i386' switch makes a universal binary run in Intel 32-bit mode. '-x86_64' makes it run in Intel 64-bit mode. -ppc a... | 2 | 2010-10-11T16:58:45Z | [
"python",
"eclipse",
"wxpython",
"pydev"
] |
WxPython Incompatible With Snow Leopard? | 2,565,201 | <p>Recently I upgraded to Snow Leopard, and now I can't run programs built with wxPython. The errors I get are (from Eclipse + PyDev):</p>
<pre><code> import wx
File "/var/tmp/wxWidgets/wxWidgets-13~231/2.6/DSTROOT/System/Library/Frameworks
/Python.framework/Versions/2.6/Extras/lib/
python/wx-2.8-mac-unicode/w... | 18 | 2010-04-02T05:51:09Z | 4,033,284 | <p>This worked for me (from <a href="http://www.python-forum.de/viewtopic.php?f=19&t=24322&view=previous" rel="nofollow">http://www.python-forum.de/viewtopic.php?f=19&t=24322&view=previous</a>)</p>
<p>In .profile, add the following line
alias py32='arch -i386 /Library/Frameworks/Python.framework/Versio... | 1 | 2010-10-27T12:41:47Z | [
"python",
"eclipse",
"wxpython",
"pydev"
] |
WxPython Incompatible With Snow Leopard? | 2,565,201 | <p>Recently I upgraded to Snow Leopard, and now I can't run programs built with wxPython. The errors I get are (from Eclipse + PyDev):</p>
<pre><code> import wx
File "/var/tmp/wxWidgets/wxWidgets-13~231/2.6/DSTROOT/System/Library/Frameworks
/Python.framework/Versions/2.6/Extras/lib/
python/wx-2.8-mac-unicode/w... | 18 | 2010-04-02T05:51:09Z | 4,036,767 | <p>While I see this is already answered, the answer is slightly wrong. The 2.9 series DOES have a Mac 64-bit build, albeit only for Python 2.7. See <a href="http://wxpython.org/download.php">http://wxpython.org/download.php</a> and look for the Cocoa build. From what I gather on the wxPython mailing list and IRC channe... | 15 | 2010-10-27T19:12:41Z | [
"python",
"eclipse",
"wxpython",
"pydev"
] |
Adjust OSX System Audio Volume in Python | 2,565,204 | <p>I would like to adjust the system audio volume in OSX from a python script. <a href="http://stackoverflow.com/questions/1449543/implementing-keyboard-volume-control-buttons-in-applescript-setting-volume-insi">This question</a> about implementing keyboard shortcuts tells me how to do it in applescript, but I'd reall... | 2 | 2010-04-02T05:51:56Z | 2,565,618 | <p>Use <a href="http://appscript.sourceforge.net/" rel="nofollow">appscript</a> to control the <a href="http://appscript.sourceforge.net/py-appscript/doc/osax-manual/01_introduction.html" rel="nofollow">StandardAdditions scripting addition</a> <code>set volume</code> command:</p>
<pre><code>>>> from osax impo... | 1 | 2010-04-02T07:53:52Z | [
"python",
"osx",
"audio",
"volume"
] |
Apply function to one element of a list in Python | 2,565,249 | <p>I'm looking for a concise and functional style way to apply a function to one element of a tuple and return the new tuple, in Python.</p>
<p>For example, for the following input:</p>
<pre><code>inp = ("hello", "my", "friend")
</code></pre>
<p>I would like to be able to get the following output:</p>
<pre><code>ou... | 1 | 2010-04-02T06:09:20Z | 2,565,321 | <pre><code>>>> inp = "hello", "my", "friend"
>>> index = 1
>>> inp[:index] + ( str.upper(inp[index]),) + inp[index + 1:]
('hello', 'MY', 'friend')
</code></pre>
<p>Seems simple, the only thing you may need to know is that to make a single element tuple, do (elt,)</p>
| 2 | 2010-04-02T06:28:04Z | [
"python",
"list-comprehension"
] |
Apply function to one element of a list in Python | 2,565,249 | <p>I'm looking for a concise and functional style way to apply a function to one element of a tuple and return the new tuple, in Python.</p>
<p>For example, for the following input:</p>
<pre><code>inp = ("hello", "my", "friend")
</code></pre>
<p>I would like to be able to get the following output:</p>
<pre><code>ou... | 1 | 2010-04-02T06:09:20Z | 2,565,341 | <p>Maybe some' like this?</p>
<pre><code>>>>inp = ("hello", "my", "friend")
>>>out = tuple([i == 1 and x.upper() or x for (x,i) in zip(t,range(len(t)))])
>>> out
('hello', 'MY', 'friend')
</code></pre>
<p>Note: rather than <code>(x,i) in zip(t, range(len(t)))</code> I should have thought ... | 2 | 2010-04-02T06:35:02Z | [
"python",
"list-comprehension"
] |
Apply function to one element of a list in Python | 2,565,249 | <p>I'm looking for a concise and functional style way to apply a function to one element of a tuple and return the new tuple, in Python.</p>
<p>For example, for the following input:</p>
<pre><code>inp = ("hello", "my", "friend")
</code></pre>
<p>I would like to be able to get the following output:</p>
<pre><code>ou... | 1 | 2010-04-02T06:09:20Z | 2,565,407 | <p>Here is a version that works on any iterable and returns a generator:</p>
<pre><code>>>> inp = ("hello", "my", "friend")
>>> def apply_nth(fn, n, iterable):
... return (fn(x) if i==n else x for (i,x) in enumerate(iterable))
...
>>> tuple(apply_nth(str.upper, 1, inp))
('hello', 'MY', '... | 6 | 2010-04-02T06:51:12Z | [
"python",
"list-comprehension"
] |
Apply function to one element of a list in Python | 2,565,249 | <p>I'm looking for a concise and functional style way to apply a function to one element of a tuple and return the new tuple, in Python.</p>
<p>For example, for the following input:</p>
<pre><code>inp = ("hello", "my", "friend")
</code></pre>
<p>I would like to be able to get the following output:</p>
<pre><code>ou... | 1 | 2010-04-02T06:09:20Z | 2,565,437 | <p>I don't understand if you want to apply a certain function to every element in the tuple that passes some test, or if you would like it to apply the function to any element present at a certain index of the tuple. So I have coded both algorithms:</p>
<p>This is the algorithm (coded in Python) that I would use to so... | 0 | 2010-04-02T06:59:04Z | [
"python",
"list-comprehension"
] |
Apply function to one element of a list in Python | 2,565,249 | <p>I'm looking for a concise and functional style way to apply a function to one element of a tuple and return the new tuple, in Python.</p>
<p>For example, for the following input:</p>
<pre><code>inp = ("hello", "my", "friend")
</code></pre>
<p>I would like to be able to get the following output:</p>
<pre><code>ou... | 1 | 2010-04-02T06:09:20Z | 2,565,592 | <p>I commented in support of your first snippet, but here are a couple other ways for the record:</p>
<pre><code>(lambda (a,b,c): [a,b.upper(),c])(inp)
</code></pre>
<p>(Won't work in Python 3.x.) And:</p>
<pre><code>[inp[0], inp[1].upper(), inp[1]]
</code></pre>
| 1 | 2010-04-02T07:46:49Z | [
"python",
"list-comprehension"
] |
Apply function to one element of a list in Python | 2,565,249 | <p>I'm looking for a concise and functional style way to apply a function to one element of a tuple and return the new tuple, in Python.</p>
<p>For example, for the following input:</p>
<pre><code>inp = ("hello", "my", "friend")
</code></pre>
<p>I would like to be able to get the following output:</p>
<pre><code>ou... | 1 | 2010-04-02T06:09:20Z | 2,565,800 | <p>i also like the answer that Dave Kirby gave. however, as a public service announcement, i'd like to say that this is not a typical use case for tuples -- these are data structures that originated in Python as a means to move data (parameters, arguments) to and from functions... they were not meant for the programmer... | 0 | 2010-04-02T08:52:53Z | [
"python",
"list-comprehension"
] |
Pylons redirect to 404 error page | 2,565,324 | <p>What function to I use to redirect to the default 404 error page? Sample code appreciated. Thank you!</p>
| 1 | 2010-04-02T06:29:23Z | 2,565,425 | <p><code>abort(404)</code> as mentioned in the <a href="http://pylonshq.com/docs/en/0.9.7/tutorials/quickwiki_tutorial/" rel="nofollow">quickwiki tutorial</a>. See the docs for <a href="http://pylonshq.com/docs/en/0.9.7/modules/controllers_util/#pylons.controllers.util.abort" rel="nofollow">abort</a>.</p>
| 3 | 2010-04-02T06:56:00Z | [
"python",
"pylons"
] |
Pylons redirect to 404 error page | 2,565,324 | <p>What function to I use to redirect to the default 404 error page? Sample code appreciated. Thank you!</p>
| 1 | 2010-04-02T06:29:23Z | 2,565,474 | <p>404 isn't something you redirect to; there's no distinct "404 page" with its own distinct URL. It's a status code that you send back in the HTTP response, instead of 200 (the code for a normal successful response).</p>
<p>Actual redirects are also status codes, such as 301 or 307, that can be used instead of 200 o... | 0 | 2010-04-02T07:11:19Z | [
"python",
"pylons"
] |
Python In-memory table | 2,565,415 | <p>What is the right way to forming in-memory table in python with direct lookups for rows and columns.<br/>I thought of using dict of dicts this way,<br/></p>
<pre><code>class Table(dict):
def __getitem__(self, key):
if key not in self:
self[key]={}
return dict.__getitem__(self, key)
... | 4 | 2010-04-02T06:52:33Z | 2,565,540 | <p>I'd use an <a href="http://www.sqlite.org/inmemorydb.html" rel="nofollow">in-memory database</a> with <a href="http://docs.python.org/library/sqlite3.html" rel="nofollow">SQLite</a> for this. The sqlite module is even in the standard library since Python 2.5, which means this doesn't even add much to your requireme... | 7 | 2010-04-02T07:32:39Z | [
"python",
"table",
"row"
] |
Python In-memory table | 2,565,415 | <p>What is the right way to forming in-memory table in python with direct lookups for rows and columns.<br/>I thought of using dict of dicts this way,<br/></p>
<pre><code>class Table(dict):
def __getitem__(self, key):
if key not in self:
self[key]={}
return dict.__getitem__(self, key)
... | 4 | 2010-04-02T06:52:33Z | 2,565,639 | <p>A nested list should be able to do the job here. I would only use nested dictionaries if elements are spread thin across the grid.</p>
<pre><code>grid = []
for row in height:
grid.append([])
for cell in width:
grid[-1].append(value)
</code></pre>
<p>Checking rows is easy:</p>
<pre><code>def valueInRow... | 0 | 2010-04-02T08:00:29Z | [
"python",
"table",
"row"
] |
Python In-memory table | 2,565,415 | <p>What is the right way to forming in-memory table in python with direct lookups for rows and columns.<br/>I thought of using dict of dicts this way,<br/></p>
<pre><code>class Table(dict):
def __getitem__(self, key):
if key not in self:
self[key]={}
return dict.__getitem__(self, key)
... | 4 | 2010-04-02T06:52:33Z | 2,566,192 | <blockquote>
<p>Now how do I do lookup if 'column1' has 'value11' </p>
</blockquote>
<p>Are you asking about this?</p>
<pre><code>found= False
for r in table:
if table[r]['column1'] == 'value11'
found= True
break
</code></pre>
<p>Is this what you're trying to do?</p>
| 0 | 2010-04-02T10:40:15Z | [
"python",
"table",
"row"
] |
Python In-memory table | 2,565,415 | <p>What is the right way to forming in-memory table in python with direct lookups for rows and columns.<br/>I thought of using dict of dicts this way,<br/></p>
<pre><code>class Table(dict):
def __getitem__(self, key):
if key not in self:
self[key]={}
return dict.__getitem__(self, key)
... | 4 | 2010-04-02T06:52:33Z | 2,567,221 | <blockquote>
<p>Now how do I do lookup if 'column1'
has 'value11'</p>
</blockquote>
<p><code>any(arow['column1'] == 'value11' for arow in table.iteritems())</code></p>
<blockquote>
<p>Is this method of forming tables
wrong?</p>
</blockquote>
<p>No, it's just very "exposed", perhaps too much -- it could usefu... | 7 | 2010-04-02T14:41:43Z | [
"python",
"table",
"row"
] |
Django - Threading in views without hanging the server | 2,565,484 | <p>One of my applications in my Django project require each request/visitor to that instance to have their own thread. This might sound confusing, so I'll describe what I'm looking to accomplish in a case based scenario, with steps:</p>
<ol>
<li>User visits application</li>
<li>Thread starts</li>
<li>Until the thread ... | 0 | 2010-04-02T07:15:46Z | 2,565,806 | <p>But why you need thread? why can't you just do whatever you want to do in django view?</p>
<p>If you are using servers like apache with mod-wsgi you should be able to have good control over number of process and threads , so that part shouldn't be your worry or should not be in django views.</p>
| 2 | 2010-04-02T08:54:48Z | [
"python",
"django",
"multithreading",
"django-models"
] |
Django - Threading in views without hanging the server | 2,565,484 | <p>One of my applications in my Django project require each request/visitor to that instance to have their own thread. This might sound confusing, so I'll describe what I'm looking to accomplish in a case based scenario, with steps:</p>
<ol>
<li>User visits application</li>
<li>Thread starts</li>
<li>Until the thread ... | 0 | 2010-04-02T07:15:46Z | 4,045,424 | <p>I dread to think why you'd want to do that.</p>
<p>Are you sure you're not looking for session variables?</p>
| 0 | 2010-10-28T17:15:58Z | [
"python",
"django",
"multithreading",
"django-models"
] |
algorithm for python itertools.permutations | 2,565,619 | <p>Can someone please explain algorithm for <code>itertools.permutations</code> routine in Python standard lib 2.6? I don't understand why it works.</p>
<p>Code is:</p>
<pre><code>def permutations(iterable, r=None):
# permutations('ABCD', 2) --> AB AC AD BA BC BD CA CB CD DA DB DC
# permutations(range(3)) ... | 18 | 2010-04-02T07:54:06Z | 2,567,451 | <p>You need to understand the mathematical theory of <a href="http://mathworld.wolfram.com/PermutationCycle.html">permutation cycles</a>, also known as "orbits" (it's important to know both "terms of art" since the mathematical subject, the heart of <a href="http://en.wikipedia.org/wiki/Combinatorics">combinatorics</a>... | 19 | 2010-04-02T15:24:45Z | [
"python",
"algorithm",
"permutation"
] |
How use the google maps hand cursor in Python? | 2,565,776 | <p>I want to use the google maps hand cursor in Python but I don't know how to do it.
I've downloaded the cursor but I only get to use the hand open, I also have a event that "closes" the hand when clicked but I don't know how can I change the style cursor on it.</p>
<p>I say this because the google maps hand cursor h... | 0 | 2010-04-02T08:43:06Z | 2,565,790 | <p>Did you try just changing the cursor, i.e:</p>
<pre><code>myFrame.SetCursor(closedCursor)
</code></pre>
<p>In the event handler for mouse-down? Then for mouse-up change it back again. <code>myFrame</code> is your container <code>wx.Frame</code>, and I suppose you already know how to load a cursor from a file.</p>
| 0 | 2010-04-02T08:48:19Z | [
"python",
"wxpython",
"cursor"
] |
How use the google maps hand cursor in Python? | 2,565,776 | <p>I want to use the google maps hand cursor in Python but I don't know how to do it.
I've downloaded the cursor but I only get to use the hand open, I also have a event that "closes" the hand when clicked but I don't know how can I change the style cursor on it.</p>
<p>I say this because the google maps hand cursor h... | 0 | 2010-04-02T08:43:06Z | 2,565,793 | <p>Use two cursors and change them on events as they need to be.</p>
| 0 | 2010-04-02T08:49:13Z | [
"python",
"wxpython",
"cursor"
] |
pyQt4: QWidget subclass not responding to new setStyleSheet() background colour | 2,565,963 | <p>I am having an issue with PyQt4. I want to create a new widget within a window, and I want this widget to have a custom color. </p>
<p>When i create a subclass of the QWidget class, and instantiate it, I am not able to change its background color through the setStyleSheet() function. </p>
<p>When I instantiate a n... | 5 | 2010-04-02T09:40:26Z | 2,566,173 | <p>Well, I discovered a solution, I dont know if its the best one or not, so if anyone else has any suggestions, please leave a comment.</p>
<p>By calling the <strong>show()</strong> and <strong>setAutoFillBackground(True)</strong> methods for the QWidget subclass object, i can get the colors to show up. eg:</p>
<pr... | 5 | 2010-04-02T10:33:30Z | [
"python",
"pyqt",
"stylesheet",
"pyqt4",
"qwidget"
] |
pyQt4: QWidget subclass not responding to new setStyleSheet() background colour | 2,565,963 | <p>I am having an issue with PyQt4. I want to create a new widget within a window, and I want this widget to have a custom color. </p>
<p>When i create a subclass of the QWidget class, and instantiate it, I am not able to change its background color through the setStyleSheet() function. </p>
<p>When I instantiate a n... | 5 | 2010-04-02T09:40:26Z | 26,066,572 | <p>Not in a place to test this right now, but if i remember correctly, i had issues when naming the widget class, and also when using {} grouping when im only adding one stylesheet attribute.</p>
<p>Try running your code, but instead of what you have, use: </p>
<pre><code>self.setStyleSheet("background-color: #00FF00... | 0 | 2014-09-26T19:01:36Z | [
"python",
"pyqt",
"stylesheet",
"pyqt4",
"qwidget"
] |
pyQt4: QWidget subclass not responding to new setStyleSheet() background colour | 2,565,963 | <p>I am having an issue with PyQt4. I want to create a new widget within a window, and I want this widget to have a custom color. </p>
<p>When i create a subclass of the QWidget class, and instantiate it, I am not able to change its background color through the setStyleSheet() function. </p>
<p>When I instantiate a n... | 5 | 2010-04-02T09:40:26Z | 34,300,669 | <p>According to <a href="https://wiki.qt.io/How_to_Change_the_Background_Color_of_QWidget" rel="nofollow">this</a> when you subclass QWidget you have to implement the <em>paintEvent</em> handler.</p>
<pre><code>class CustomWidget(QtGui.QWidget):
def __init__(self, parent):
QtGui.QWidget.__init__(self, pare... | 0 | 2015-12-15T22:29:35Z | [
"python",
"pyqt",
"stylesheet",
"pyqt4",
"qwidget"
] |
MacPorts manual port location | 2,566,357 | <p>I am installing one library for python from MacPorts. But macports version of the library is older than actual development svn version. Is it possible to specify a custom location for a port installation in MacPorts so I could install latest library from the developer's site?</p>
| 2 | 2010-04-02T11:24:53Z | 2,566,581 | <p>If you simply want the latest version, couldn't you just not install the old version?</p>
<p>If you are planning to build and deploy the svn version yourself and want to test it while not removing the old version, you might find virtualenv useful. It allows you to deploy a parallel Python environment with its own i... | 0 | 2010-04-02T12:18:01Z | [
"python",
"macports"
] |
MacPorts manual port location | 2,566,357 | <p>I am installing one library for python from MacPorts. But macports version of the library is older than actual development svn version. Is it possible to specify a custom location for a port installation in MacPorts so I could install latest library from the developer's site?</p>
| 2 | 2010-04-02T11:24:53Z | 2,566,986 | <p><a href="http://guide.macports.org/chunked/development.local-repositories.html" rel="nofollow">Have</a> a look here, you have to install a local portfile repositories.</p>
| 1 | 2010-04-02T13:55:40Z | [
"python",
"macports"
] |
Disco/MapReduce: Using results of previous iteration as input to new iteration | 2,566,402 | <p>Currently am implementing PageRank on Disco. As an iterative algorithm, the results of one iteration are used as input to the next iteration.</p>
<p>I have a large file which represents all the links, with each row representing a page and the values in the row representing the pages to which it links.</p>
<p>For ... | 7 | 2010-04-02T11:36:16Z | 3,701,242 | <p>Looks like you'll want to use an init_map for the first pass and then a iter_map for each subsequent iteration.</p>
<p>See: <a href="http://discoproject.org/doc/faq.html#id7" rel="nofollow">http://discoproject.org/doc/faq.html#id7</a></p>
<p>Can you output python object that include the outlinks, instead of just t... | 1 | 2010-09-13T14:15:10Z | [
"python",
"mapreduce",
"disco"
] |
find nearest value in numpy array | 2,566,412 | <p>is there a numpy-thonic way, e.g. function, to find the 'nearest value' in an array?
example:</p>
<pre><code>np.find_nearest( array, value )
</code></pre>
| 132 | 2010-04-02T11:38:23Z | 2,566,508 | <pre><code>import numpy as np
def find_nearest(array,value):
idx = (np.abs(array-value)).argmin()
return array[idx]
array = np.random.random(10)
print(array)
# [ 0.21069679 0.61290182 0.63425412 0.84635244 0.91599191 0.00213826
# 0.17104965 0.56874386 0.57319379 0.28719469]
value = 0.5
print(find_n... | 214 | 2010-04-02T12:01:01Z | [
"python",
"search",
"numpy"
] |
find nearest value in numpy array | 2,566,412 | <p>is there a numpy-thonic way, e.g. function, to find the 'nearest value' in an array?
example:</p>
<pre><code>np.find_nearest( array, value )
</code></pre>
| 132 | 2010-04-02T11:38:23Z | 10,465,997 | <p>With slight modification, the answer above works with arrays of arbitrary dimension (1d, 2d, 3d, ...):</p>
<pre><code>def find_nearest(a, a0):
"Element in nd array `a` closest to the scalar value `a0`"
idx = np.abs(a - a0).argmin()
return a.flat[idx]
</code></pre>
<p>Or, written as a single line:</p>
... | 20 | 2012-05-05T21:07:59Z | [
"python",
"search",
"numpy"
] |
find nearest value in numpy array | 2,566,412 | <p>is there a numpy-thonic way, e.g. function, to find the 'nearest value' in an array?
example:</p>
<pre><code>np.find_nearest( array, value )
</code></pre>
| 132 | 2010-04-02T11:38:23Z | 14,806,751 | <p>Here's a version that will handle a non-scalar "values" array:</p>
<pre><code>import numpy as np
def find_nearest(array, values):
indices = np.abs(np.subtract.outer(array, values)).argmin(0)
return array[indices]
</code></pre>
<p>Or a version that returns a numeric type (e.g. int, float) if the input is s... | 5 | 2013-02-11T06:04:59Z | [
"python",
"search",
"numpy"
] |
find nearest value in numpy array | 2,566,412 | <p>is there a numpy-thonic way, e.g. function, to find the 'nearest value' in an array?
example:</p>
<pre><code>np.find_nearest( array, value )
</code></pre>
| 132 | 2010-04-02T11:38:23Z | 17,678,303 | <p>Here's an extension to find the nearest vector in an array of vectors. </p>
<pre><code>import numpy as np
def find_nearest_vector(array, value):
idx = np.array([np.linalg.norm(x+y) for (x,y) in array-value]).argmin()
return array[idx]
A = np.random.random((10,2))*100
""" A = array([[ 34.19762933, 43.1453412... | 12 | 2013-07-16T13:47:32Z | [
"python",
"search",
"numpy"
] |
find nearest value in numpy array | 2,566,412 | <p>is there a numpy-thonic way, e.g. function, to find the 'nearest value' in an array?
example:</p>
<pre><code>np.find_nearest( array, value )
</code></pre>
| 132 | 2010-04-02T11:38:23Z | 18,500,089 | <p>If you don't want to use numpy this will do it:</p>
<pre><code>def find_nearest(array, value):
n = [abs(i-value) for i in array]
idx = n.index(min(n))
return array[idx]
</code></pre>
| 2 | 2013-08-28T23:45:03Z | [
"python",
"search",
"numpy"
] |
find nearest value in numpy array | 2,566,412 | <p>is there a numpy-thonic way, e.g. function, to find the 'nearest value' in an array?
example:</p>
<pre><code>np.find_nearest( array, value )
</code></pre>
| 132 | 2010-04-02T11:38:23Z | 26,026,189 | <p><em>IF</em> your array is sorted and is very large, this is a much faster solution:</p>
<pre><code>def find_nearest(array,value):
idx = np.searchsorted(array, value, side="left")
if idx > 0 and (idx == len(array) or math.fabs(value - array[idx-1]) < math.fabs(value - array[idx])):
return array... | 30 | 2014-09-24T20:48:09Z | [
"python",
"search",
"numpy"
] |
find nearest value in numpy array | 2,566,412 | <p>is there a numpy-thonic way, e.g. function, to find the 'nearest value' in an array?
example:</p>
<pre><code>np.find_nearest( array, value )
</code></pre>
| 132 | 2010-04-02T11:38:23Z | 29,518,176 | <p>For large arrays, the (excellent) answer given by @Demitri is far faster than the answer currently marked as best. I've adapted his exact algorithm in the following two ways:</p>
<ol>
<li><p>The function below works whether or not the input array is sorted.</p></li>
<li><p>The function below returns the <em>index</... | 3 | 2015-04-08T14:54:20Z | [
"python",
"search",
"numpy"
] |
find nearest value in numpy array | 2,566,412 | <p>is there a numpy-thonic way, e.g. function, to find the 'nearest value' in an array?
example:</p>
<pre><code>np.find_nearest( array, value )
</code></pre>
| 132 | 2010-04-02T11:38:23Z | 32,740,709 | <p>Here is a version with scipy for @Ari Onasafari, answer "<strong><em>to find the nearest vector in an array of vectors</em></strong>"</p>
<pre><code>In [1]: from scipy import spatial
In [2]: import numpy as np
In [3]: A = np.random.random((10,2))*100
In [4]: A
Out[4]:
array([[ 68.83402637, 38.07632221],
... | 5 | 2015-09-23T13:19:14Z | [
"python",
"search",
"numpy"
] |
How to make a simple cross-platform webbrowser with Python? | 2,566,720 | <p>The <a href="http://code.google.com/p/pywebkitgtk/" rel="nofollow">http://code.google.com/p/pywebkitgtk/</a> looks great but it seems to be running on linux only.</p>
<p>Does anybody know if there is something similar but cross-platform?</p>
<p>If not what can be the alternatives to make with Python a simple web-b... | 4 | 2010-04-02T12:54:48Z | 2,567,752 | <p>If you don't mind modifying code in an open-source project, you can attempt making <a href="http://grail.sourceforge.net/" rel="nofollow">Grail</a> run in a modern version of Python.</p>
| 0 | 2010-04-02T16:20:06Z | [
"python",
"winapi",
"cross-platform",
"webkit"
] |
How to make a simple cross-platform webbrowser with Python? | 2,566,720 | <p>The <a href="http://code.google.com/p/pywebkitgtk/" rel="nofollow">http://code.google.com/p/pywebkitgtk/</a> looks great but it seems to be running on linux only.</p>
<p>Does anybody know if there is something similar but cross-platform?</p>
<p>If not what can be the alternatives to make with Python a simple web-b... | 4 | 2010-04-02T12:54:48Z | 2,568,140 | <p>Qt (which has Python bindings with <a href="http://www.riverbankcomputing.co.uk/software/pyqt/intro">PyQt</a> or <a href="http://www.pyside.org/">PySide</a>) offers <a href="http://webkit.org/">Webkit</a> (the same engine as Safari). Making a simple cross-platform browser is <a href="http://www.rkblog.rk.edu.pl/w/p/... | 9 | 2010-04-02T17:34:12Z | [
"python",
"winapi",
"cross-platform",
"webkit"
] |
How to make a simple cross-platform webbrowser with Python? | 2,566,720 | <p>The <a href="http://code.google.com/p/pywebkitgtk/" rel="nofollow">http://code.google.com/p/pywebkitgtk/</a> looks great but it seems to be running on linux only.</p>
<p>Does anybody know if there is something similar but cross-platform?</p>
<p>If not what can be the alternatives to make with Python a simple web-b... | 4 | 2010-04-02T12:54:48Z | 14,460,887 | <p>Coming back to this question asked 3 years ago, I would like to mention
<a href="http://code.google.com/p/chromiumembedded/" rel="nofollow">Chromium Embdedded Framework</a>. It worths a try.</p>
| 0 | 2013-01-22T14:30:28Z | [
"python",
"winapi",
"cross-platform",
"webkit"
] |
easiest way to setup XEmacs on Gentoo for Python | 2,566,834 | <p>I want to use (X)Emacs on my Gentoo system and wonder about the "correct" (or easiest) way to setup it to be used for Python development (i.e. intelligent auto-completion via tab and all those usual stuff).</p>
<p>I want to avoid installing anything by hand - I want to use my Portage/emerge as far as possible.</p>
... | 1 | 2010-04-02T13:26:01Z | 2,588,379 | <p>I used this tutorial myself at <a href="http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/" rel="nofollow">EnigmaCurry</a>.</p>
<p>You can use easy_install to install rope and ropemacs. And then I believe you only need to copy the autocomplete.el script on that site.</p>
<p>good ... | 0 | 2010-04-06T21:12:28Z | [
"python",
"emacs",
"xemacs"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.