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 |
|---|---|---|---|---|---|---|---|---|---|
How can I unpack binary hex formatted data in Python? | 200,738 | <p>Using the PHP <a href="http://www.php.net/pack" rel="nofollow">pack()</a> function, I have converted a string into a binary hex representation:</p>
<pre><code>$string = md5(time); // 32 character length
$packed = pack('H*', $string);
</code></pre>
<p>The H* formatting means "Hex string, high nibble first".</p>
<p... | 5 | 2008-10-14T11:08:07Z | 200,861 | <p>There's no corresponding "hex nibble" code for struct.pack, so you'll either need to manually pack into bytes first, like:</p>
<pre><code>hex_string = 'abcdef12'
hexdigits = [int(x, 16) for x in hex_string]
data = ''.join(struct.pack('B', (high <<4) + low)
for high, low in zip(hexdigits[::2],... | 10 | 2008-10-14T11:59:32Z | [
"php",
"python",
"binary",
"hex"
] |
How can I unpack binary hex formatted data in Python? | 200,738 | <p>Using the PHP <a href="http://www.php.net/pack" rel="nofollow">pack()</a> function, I have converted a string into a binary hex representation:</p>
<pre><code>$string = md5(time); // 32 character length
$packed = pack('H*', $string);
</code></pre>
<p>The H* formatting means "Hex string, high nibble first".</p>
<p... | 5 | 2008-10-14T11:08:07Z | 201,325 | <p>There's an easy way to do this with the <code>binascii</code> module:</p>
<pre><code>>>> import binascii
>>> print binascii.hexlify("ABCZ")
'4142435a'
</code></pre>
<p>Unless I'm misunderstanding something about the nibble ordering (high-nibble first is the default), that should be perfectly suff... | 10 | 2008-10-14T14:15:26Z | [
"php",
"python",
"binary",
"hex"
] |
Shortest Sudoku Solver in Python - How does it work? | 201,461 | <p>I was playing around with my own Sudoku solver and was looking for some pointers to good and fast design when I came across this:</p>
<pre><code>def r(a):i=a.find('0');~i or exit(a);[m
in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for
j in range(81)]or r(a[:i]+m+a[i+1:])for m in'%d'%5**18]
from sys import*;r(a... | 70 | 2008-10-14T14:46:15Z | 201,496 | <p>A lot of the short sudoku solvers just recursively try every possible legal number left until they have successfully filled the cells. I haven't taken this apart, but just skimming it, it looks like that's what it does.</p>
| 4 | 2008-10-14T14:54:14Z | [
"python",
"algorithm"
] |
Shortest Sudoku Solver in Python - How does it work? | 201,461 | <p>I was playing around with my own Sudoku solver and was looking for some pointers to good and fast design when I came across this:</p>
<pre><code>def r(a):i=a.find('0');~i or exit(a);[m
in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for
j in range(81)]or r(a[:i]+m+a[i+1:])for m in'%d'%5**18]
from sys import*;r(a... | 70 | 2008-10-14T14:46:15Z | 201,550 | <p>unobfuscating it:</p>
<pre><code>def r(a):
i = a.find('0') # returns -1 on fail, index otherwise
~i or exit(a) # ~(-1) == 0, anthing else is not 0
# thus: if i == -1: exit(a)
inner_lexp = [ (i-j)%9*(i/9 ^ j/9)*(i/27 ^ j/27 | i%9/3 ^ j%9/3) or a[j]
for j in range(81)... | 8 | 2008-10-14T15:05:37Z | [
"python",
"algorithm"
] |
Shortest Sudoku Solver in Python - How does it work? | 201,461 | <p>I was playing around with my own Sudoku solver and was looking for some pointers to good and fast design when I came across this:</p>
<pre><code>def r(a):i=a.find('0');~i or exit(a);[m
in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for
j in range(81)]or r(a[:i]+m+a[i+1:])for m in'%d'%5**18]
from sys import*;r(a... | 70 | 2008-10-14T14:46:15Z | 201,566 | <p><code>r(a)</code> is a recursive function which attempts to fill in a <code>0</code> in the board in each step.</p>
<p><code>i=a.find('0');~i or exit(a)</code> is the on-success termination. If no more <code>0</code> values exist in the board, we're done.</p>
<p><code>m</code> is the current value we will try to ... | 5 | 2008-10-14T15:07:20Z | [
"python",
"algorithm"
] |
Shortest Sudoku Solver in Python - How does it work? | 201,461 | <p>I was playing around with my own Sudoku solver and was looking for some pointers to good and fast design when I came across this:</p>
<pre><code>def r(a):i=a.find('0');~i or exit(a);[m
in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for
j in range(81)]or r(a[:i]+m+a[i+1:])for m in'%d'%5**18]
from sys import*;r(a... | 70 | 2008-10-14T14:46:15Z | 201,771 | <p>Well, you can make things a little easier by fixing up the syntax:</p>
<pre><code>def r(a):
i = a.find('0')
~i or exit(a)
[m in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for j in range(81)] or r(a[:i]+m+a[i+1:])for m in'%d'%5**18]
from sys import *
r(argv[1])
</code></pre>
<p>Cleaning up a little:</p>
... | 205 | 2008-10-14T16:00:21Z | [
"python",
"algorithm"
] |
Shortest Sudoku Solver in Python - How does it work? | 201,461 | <p>I was playing around with my own Sudoku solver and was looking for some pointers to good and fast design when I came across this:</p>
<pre><code>def r(a):i=a.find('0');~i or exit(a);[m
in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for
j in range(81)]or r(a[:i]+m+a[i+1:])for m in'%d'%5**18]
from sys import*;r(a... | 70 | 2008-10-14T14:46:15Z | 21,995,076 | <p>The code doesn't actually work. You can test it yourself. Here is a sample unsolved sudoku puzzle:</p>
<p>807000003602080000000200900040005001000798000200100070004003000000040108300000506</p>
<p>You can use this website (<a href="http://www.sudokuwiki.org/sudoku.htm" rel="nofollow">http://www.sudokuwiki.org/sudoku... | 2 | 2014-02-24T17:46:49Z | [
"python",
"algorithm"
] |
urllib.urlopen works but urllib2.urlopen doesn't | 201,515 | <p>I have a simple website I'm testing. It's running on localhost and I can access it in my web browser. The index page is simply the word "running". <code>urllib.urlopen</code> will successfully read the page but <code>urllib2.urlopen</code> will not. Here's a script which demonstrates the problem (this is the act... | 10 | 2008-10-14T14:57:41Z | 201,556 | <p>Does calling urlib2.open first followed by urllib.open have the same results? Just wondering if the first call to open is causing the http server to get busy causing the timeout?</p>
| 1 | 2008-10-14T15:06:05Z | [
"python",
"urllib2",
"urllib"
] |
urllib.urlopen works but urllib2.urlopen doesn't | 201,515 | <p>I have a simple website I'm testing. It's running on localhost and I can access it in my web browser. The index page is simply the word "running". <code>urllib.urlopen</code> will successfully read the page but <code>urllib2.urlopen</code> will not. Here's a script which demonstrates the problem (this is the act... | 10 | 2008-10-14T14:57:41Z | 201,712 | <p>I know this answer sucks, but "it works fine on my machine"
(WinXP with Python 2.5.2)</p>
| 1 | 2008-10-14T15:45:02Z | [
"python",
"urllib2",
"urllib"
] |
urllib.urlopen works but urllib2.urlopen doesn't | 201,515 | <p>I have a simple website I'm testing. It's running on localhost and I can access it in my web browser. The index page is simply the word "running". <code>urllib.urlopen</code> will successfully read the page but <code>urllib2.urlopen</code> will not. Here's a script which demonstrates the problem (this is the act... | 10 | 2008-10-14T14:57:41Z | 201,737 | <p>Sounds like you have proxy settings defined that urllib2 is picking up on. When it tries to proxy "127.0.0.01/", the proxy gives up and returns a 504 error.</p>
<p>From <a href="http://kember.net/articles/obscure-python-urllib2-proxy-gotcha" rel="nofollow">Obscure python urllib2 proxy gotcha</a>:</p>
<pre><code>pr... | 16 | 2008-10-14T15:49:47Z | [
"python",
"urllib2",
"urllib"
] |
urllib.urlopen works but urllib2.urlopen doesn't | 201,515 | <p>I have a simple website I'm testing. It's running on localhost and I can access it in my web browser. The index page is simply the word "running". <code>urllib.urlopen</code> will successfully read the page but <code>urllib2.urlopen</code> will not. Here's a script which demonstrates the problem (this is the act... | 10 | 2008-10-14T14:57:41Z | 201,754 | <p>I don't know what's going on, but you may find this helpful in figuring it out:</p>
<pre><code>>>> import urllib2
>>> urllib2.urlopen('http://mit.edu').read()[:10]
'<!DOCTYPE '
>>> urllib2._opener.handlers[1].set_http_debuglevel(100)
>>> urllib2.urlopen('http://mit.edu').read(... | 1 | 2008-10-14T15:53:19Z | [
"python",
"urllib2",
"urllib"
] |
urllib.urlopen works but urllib2.urlopen doesn't | 201,515 | <p>I have a simple website I'm testing. It's running on localhost and I can access it in my web browser. The index page is simply the word "running". <code>urllib.urlopen</code> will successfully read the page but <code>urllib2.urlopen</code> will not. Here's a script which demonstrates the problem (this is the act... | 10 | 2008-10-14T14:57:41Z | 201,756 | <p>urllib.urlopen() throws the following request at the server:</p>
<pre><code>GET / HTTP/1.0
Host: 127.0.0.1
User-Agent: Python-urllib/1.17
</code></pre>
<p>while urllib2.urlopen() throws this:</p>
<pre><code>GET / HTTP/1.1
Accept-Encoding: identity
Host: 127.0.0.1
Connection: close
User-Agent: Python-urllib/2.5
</... | 1 | 2008-10-14T15:54:10Z | [
"python",
"urllib2",
"urllib"
] |
python name a file same as a lib | 201,846 | <p>i have the following script</p>
<pre><code>import getopt, sys
opts, args = getopt.getopt(sys.argv[1:], "h:s")
for key,value in opts:
print key, "=>", value
</code></pre>
<p>if i name this getopt.py and run it doesn't work as it tries to import itself</p>
<p>is there a way around this, so i can keep this fi... | 2 | 2008-10-14T16:17:23Z | 201,862 | <pre><code>import getopt as bettername
</code></pre>
<p>This should allow you to call getopt as bettername.</p>
| -1 | 2008-10-14T16:20:56Z | [
"python"
] |
python name a file same as a lib | 201,846 | <p>i have the following script</p>
<pre><code>import getopt, sys
opts, args = getopt.getopt(sys.argv[1:], "h:s")
for key,value in opts:
print key, "=>", value
</code></pre>
<p>if i name this getopt.py and run it doesn't work as it tries to import itself</p>
<p>is there a way around this, so i can keep this fi... | 2 | 2008-10-14T16:17:23Z | 201,881 | <p>You should avoid naming your python files with standard library module names.</p>
| 4 | 2008-10-14T16:27:16Z | [
"python"
] |
python name a file same as a lib | 201,846 | <p>i have the following script</p>
<pre><code>import getopt, sys
opts, args = getopt.getopt(sys.argv[1:], "h:s")
for key,value in opts:
print key, "=>", value
</code></pre>
<p>if i name this getopt.py and run it doesn't work as it tries to import itself</p>
<p>is there a way around this, so i can keep this fi... | 2 | 2008-10-14T16:17:23Z | 201,891 | <p>You shouldn't name your scripts like existing modules. Especially if standard. </p>
<p>That said, you can touch sys.path to modify the library loading order</p>
<pre><code>~# cat getopt.py
print "HI"
~# python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help... | 7 | 2008-10-14T16:30:44Z | [
"python"
] |
python name a file same as a lib | 201,846 | <p>i have the following script</p>
<pre><code>import getopt, sys
opts, args = getopt.getopt(sys.argv[1:], "h:s")
for key,value in opts:
print key, "=>", value
</code></pre>
<p>if i name this getopt.py and run it doesn't work as it tries to import itself</p>
<p>is there a way around this, so i can keep this fi... | 2 | 2008-10-14T16:17:23Z | 201,907 | <p>Python doesn't give you a way to qualify modules. You might be able to accomplish this by removing the '' entry from sys.path or by moving it to the end. I wouldn't recommend it.</p>
| 0 | 2008-10-14T16:36:34Z | [
"python"
] |
python name a file same as a lib | 201,846 | <p>i have the following script</p>
<pre><code>import getopt, sys
opts, args = getopt.getopt(sys.argv[1:], "h:s")
for key,value in opts:
print key, "=>", value
</code></pre>
<p>if i name this getopt.py and run it doesn't work as it tries to import itself</p>
<p>is there a way around this, so i can keep this fi... | 2 | 2008-10-14T16:17:23Z | 201,916 | <p>Well, you could (re)move the current diretory from sys.path, which contains the modifiable search path for libraries to make it work, if you really need that.</p>
| 0 | 2008-10-14T16:39:36Z | [
"python"
] |
which python framework to use? | 202,939 | <p>I'm looking for a framework which is appropriate for beginners (in Python and web development).</p>
<p>I already found out about Django and web.py.
I think that one of the most important things for me is good documentation.</p>
<p>Thanks for the help,
Dan</p>
| 9 | 2008-10-14T21:35:15Z | 202,941 | <p>I think Django has some of the best documentation of any project I've worked on. That's the reason we chose it over Turbogears two years ago, and it's been the best technology choice we've made.</p>
| 10 | 2008-10-14T21:37:55Z | [
"python",
"frameworks",
"web-frameworks"
] |
which python framework to use? | 202,939 | <p>I'm looking for a framework which is appropriate for beginners (in Python and web development).</p>
<p>I already found out about Django and web.py.
I think that one of the most important things for me is good documentation.</p>
<p>Thanks for the help,
Dan</p>
| 9 | 2008-10-14T21:35:15Z | 203,148 | <p>Django is amazingly good. Guido uses it (working at Google). It's the main reason why i find myself working more in Python than in Lua.</p>
| 3 | 2008-10-14T22:51:17Z | [
"python",
"frameworks",
"web-frameworks"
] |
which python framework to use? | 202,939 | <p>I'm looking for a framework which is appropriate for beginners (in Python and web development).</p>
<p>I already found out about Django and web.py.
I think that one of the most important things for me is good documentation.</p>
<p>Thanks for the help,
Dan</p>
| 9 | 2008-10-14T21:35:15Z | 203,266 | <p>DanJ, here's a pretty good list of all the known Python frameworks: <a href="http://wiki.python.org/moin/WebFrameworks" rel="nofollow">http://wiki.python.org/moin/WebFrameworks</a></p>
<p>I would recommend looking at the wikipedia articles for <a href="http://en.wikipedia.org/wiki/Django_(web_framework)" rel="nofol... | 3 | 2008-10-14T23:58:40Z | [
"python",
"frameworks",
"web-frameworks"
] |
which python framework to use? | 202,939 | <p>I'm looking for a framework which is appropriate for beginners (in Python and web development).</p>
<p>I already found out about Django and web.py.
I think that one of the most important things for me is good documentation.</p>
<p>Thanks for the help,
Dan</p>
| 9 | 2008-10-14T21:35:15Z | 203,332 | <p>You should also take a look at <a href="http://mdp.cti.depaul.edu/" rel="nofollow">web2py</a> which has good docs and is a very nice framework for building wep apps.</p>
| 1 | 2008-10-15T00:31:10Z | [
"python",
"frameworks",
"web-frameworks"
] |
which python framework to use? | 202,939 | <p>I'm looking for a framework which is appropriate for beginners (in Python and web development).</p>
<p>I already found out about Django and web.py.
I think that one of the most important things for me is good documentation.</p>
<p>Thanks for the help,
Dan</p>
| 9 | 2008-10-14T21:35:15Z | 203,679 | <p>You might want to look at <a href="http://karrigell.sourceforge.net/" rel="nofollow">Karrigell</a>. It has multiple options for programming syntax, e.g. pure Python, pure HTML w/ Python scripts, combination, etc. I don't know how well it scales because I haven't used it for several years but it's good for getting yo... | 1 | 2008-10-15T03:54:29Z | [
"python",
"frameworks",
"web-frameworks"
] |
which python framework to use? | 202,939 | <p>I'm looking for a framework which is appropriate for beginners (in Python and web development).</p>
<p>I already found out about Django and web.py.
I think that one of the most important things for me is good documentation.</p>
<p>Thanks for the help,
Dan</p>
| 9 | 2008-10-14T21:35:15Z | 203,974 | <p>Echoing the answer of few, I suggest Django. for some simple reasons:</p>
<ol>
<li>It follows standard MVC architecture.</li>
<li>You can modularise your entire application right from db modeling.</li>
<li>Extensive documentation and free online example/project based books available.</li>
<li>Many open source web b... | 1 | 2008-10-15T07:56:47Z | [
"python",
"frameworks",
"web-frameworks"
] |
which python framework to use? | 202,939 | <p>I'm looking for a framework which is appropriate for beginners (in Python and web development).</p>
<p>I already found out about Django and web.py.
I think that one of the most important things for me is good documentation.</p>
<p>Thanks for the help,
Dan</p>
| 9 | 2008-10-14T21:35:15Z | 204,618 | <p>I assume you are talking about a web framework. I have used <a href="http://cherrypy.org" rel="nofollow">CherryPy</a>, and found it quite useful. Try using each one to code a simple solution, and see how much it lines up with your style of programming.</p>
| 0 | 2008-10-15T13:03:17Z | [
"python",
"frameworks",
"web-frameworks"
] |
which python framework to use? | 202,939 | <p>I'm looking for a framework which is appropriate for beginners (in Python and web development).</p>
<p>I already found out about Django and web.py.
I think that one of the most important things for me is good documentation.</p>
<p>Thanks for the help,
Dan</p>
| 9 | 2008-10-14T21:35:15Z | 204,778 | <p><a href="http://webpy.org/">web.py</a>?</p>
<p>It's extremely simple, and Python'y. A basic hello-world web-application is..</p>
<pre><code>import web
urls = (
'/(.*)', 'hello'
)
class hello:
def GET(self, name):
i = web.input(times=1)
if not name: name = 'world'
for c... | 10 | 2008-10-15T13:51:45Z | [
"python",
"frameworks",
"web-frameworks"
] |
which python framework to use? | 202,939 | <p>I'm looking for a framework which is appropriate for beginners (in Python and web development).</p>
<p>I already found out about Django and web.py.
I think that one of the most important things for me is good documentation.</p>
<p>Thanks for the help,
Dan</p>
| 9 | 2008-10-14T21:35:15Z | 207,675 | <p>I've written web-apps with raw wsgi. Perhaps rolling out my own library at some point. I don't just like about large frameworks and such. I learned to hate http while writing in raw wsgi. You don't really like it after you realise how much stupid parsing and interpretation you need to upload a file.</p>
<p>Because ... | 0 | 2008-10-16T07:21:43Z | [
"python",
"frameworks",
"web-frameworks"
] |
which python framework to use? | 202,939 | <p>I'm looking for a framework which is appropriate for beginners (in Python and web development).</p>
<p>I already found out about Django and web.py.
I think that one of the most important things for me is good documentation.</p>
<p>Thanks for the help,
Dan</p>
| 9 | 2008-10-14T21:35:15Z | 977,510 | <p><a href="http://werkzeug.pocoo.org/" rel="nofollow">Wekrzeug</a> is worth mentioning as well. It's not a full stack web framework. It is a low level WSGI framework. (<a href="http://werkzeug.pocoo.org/wiki30/" rel="nofollow">30 Minute Wiki Screencast</a>)</p>
| 1 | 2009-06-10T18:54:29Z | [
"python",
"frameworks",
"web-frameworks"
] |
Creating self-contained python applications | 203,487 | <p>I'm trying to create a self-contained version of <a href="http://www.htmltopdf.org/">pisa</a> (html to pdf converter, <a href="http://pypi.python.org/pypi/pisa/3.0.27">latest version</a>), but I can't succeed due to several errors. I've tried <code>py2exe</code>, <code>bb-freeze</code> and <code>cxfreeze</code>.</p>... | 19 | 2008-10-15T02:00:27Z | 203,514 | <p>Check out <a href="http://www.pyinstaller.org/">pyinstaller</a>, it makes standalone executables (as in one .EXE file, and that's it).</p>
| 20 | 2008-10-15T02:17:35Z | [
"python",
"windows",
"executable",
"self-contained"
] |
Receive socket size limits good? | 203,758 | <p>I am writing a program in Python that will act as a server and accept data from a client, is it a good idea to impose a hard limit as to the amount of data, if so why?</p>
<p>More info:
So certain chat programs limit the amount of text one can send per send (i.e. per time user presses send) so the question comes do... | 2 | 2008-10-15T04:55:33Z | 203,769 | <p>What is your question exactly? </p>
<p>What happens when you do receive on a socket is that the current available data in the socket buffer is immediately returned. If you give receive (or read, I guess), a huge buffer size, such as 40000, it'll likely never return that much data at once. If you give it a tiny buff... | 1 | 2008-10-15T05:00:04Z | [
"python",
"sockets"
] |
Receive socket size limits good? | 203,758 | <p>I am writing a program in Python that will act as a server and accept data from a client, is it a good idea to impose a hard limit as to the amount of data, if so why?</p>
<p>More info:
So certain chat programs limit the amount of text one can send per send (i.e. per time user presses send) so the question comes do... | 2 | 2008-10-15T04:55:33Z | 203,933 | <p>Most likely you've seen code which protects against "extra" incoming data. This is often due to the possibility of buffer overruns, where the extra data being copied into memory overruns the pre-allocated array and overwrites executable code with attacker code. Code written in languages like C typically has a lot of... | 2 | 2008-10-15T07:17:11Z | [
"python",
"sockets"
] |
Receive socket size limits good? | 203,758 | <p>I am writing a program in Python that will act as a server and accept data from a client, is it a good idea to impose a hard limit as to the amount of data, if so why?</p>
<p>More info:
So certain chat programs limit the amount of text one can send per send (i.e. per time user presses send) so the question comes do... | 2 | 2008-10-15T04:55:33Z | 207,096 | <p>I don't know what your actual application is, however, setting a hard limit on the total amount of data that a client can send could be useful in reducing your exposure to denial of service attacks, e.g. client connects and sends 100MB of data which could load your application unacceptably.</p>
<p>But it really dep... | 0 | 2008-10-16T01:10:57Z | [
"python",
"sockets"
] |
How do I get python-markdown to additionally "urlify" links when formatting plain text? | 203,859 | <p>Markdown is a great tool for formatting plain text into pretty html, but it doesn't turn plain-text links into URLs automatically. Like this one:</p>
<p><a href="http://www.google.com/" rel="nofollow">http://www.google.com/</a></p>
<p>How do I get markdown to add tags to URLs when I format a block of text?</p>
| 2 | 2008-10-15T06:22:22Z | 203,870 | <p>This isn't a feature of Markdown -- what you should do is run a post-processor against the text looking for a URL-like pattern. There's a good example in the <a href="http://google-app-engine-samples.googlecode.com/svn/trunk/cccwiki/wiki.py" rel="nofollow">Google app engine example code</a> -- see the <code>AutoLink... | 2 | 2008-10-15T06:28:50Z | [
"python",
"django",
"markdown"
] |
How do I get python-markdown to additionally "urlify" links when formatting plain text? | 203,859 | <p>Markdown is a great tool for formatting plain text into pretty html, but it doesn't turn plain-text links into URLs automatically. Like this one:</p>
<p><a href="http://www.google.com/" rel="nofollow">http://www.google.com/</a></p>
<p>How do I get markdown to add tags to URLs when I format a block of text?</p>
| 2 | 2008-10-15T06:22:22Z | 203,973 | <p>There's an extra for this in python-markdown2:</p>
<p><a href="http://code.google.com/p/python-markdown2/wiki/LinkPatterns" rel="nofollow">http://code.google.com/p/python-markdown2/wiki/LinkPatterns</a></p>
| 1 | 2008-10-15T07:55:15Z | [
"python",
"django",
"markdown"
] |
How do I get python-markdown to additionally "urlify" links when formatting plain text? | 203,859 | <p>Markdown is a great tool for formatting plain text into pretty html, but it doesn't turn plain-text links into URLs automatically. Like this one:</p>
<p><a href="http://www.google.com/" rel="nofollow">http://www.google.com/</a></p>
<p>How do I get markdown to add tags to URLs when I format a block of text?</p>
| 2 | 2008-10-15T06:22:22Z | 206,486 | <p>I was using the <a href="http://www.djangoproject.com/" rel="nofollow">Django framework</a>, which has a filter called urlize, which does exactly what I wanted. However, it only works on plain text, so I couldn't pass is through the output of markdown. I followed <a href="https://docs.djangoproject.com/en/dev/howto/... | 1 | 2008-10-15T21:05:13Z | [
"python",
"django",
"markdown"
] |
How do I get python-markdown to additionally "urlify" links when formatting plain text? | 203,859 | <p>Markdown is a great tool for formatting plain text into pretty html, but it doesn't turn plain-text links into URLs automatically. Like this one:</p>
<p><a href="http://www.google.com/" rel="nofollow">http://www.google.com/</a></p>
<p>How do I get markdown to add tags to URLs when I format a block of text?</p>
| 2 | 2008-10-15T06:22:22Z | 215,721 | <p>Best case scenario, edit the markdown and just put < > around the URLs. This will make the link clickable. Only problem is it requires educating your users, or whoever writes the markdown.</p>
| 2 | 2008-10-18T23:35:33Z | [
"python",
"django",
"markdown"
] |
How do I get python-markdown to additionally "urlify" links when formatting plain text? | 203,859 | <p>Markdown is a great tool for formatting plain text into pretty html, but it doesn't turn plain-text links into URLs automatically. Like this one:</p>
<p><a href="http://www.google.com/" rel="nofollow">http://www.google.com/</a></p>
<p>How do I get markdown to add tags to URLs when I format a block of text?</p>
| 2 | 2008-10-15T06:22:22Z | 828,458 | <p>I couldn't get superjoe30's regular expression to compile, so I adapted his solution to convert plain URLs (within Markdown text) to be Markdown compatible.</p>
<p>The modified filter:</p>
<pre><code>urlfinder = re.compile('^(http:\/\/\S+)')
urlfinder2 = re.compile('\s(http:\/\/\S+)')
@register.filter('urlify_mark... | 2 | 2009-05-06T07:42:34Z | [
"python",
"django",
"markdown"
] |
How do I get python-markdown to additionally "urlify" links when formatting plain text? | 203,859 | <p>Markdown is a great tool for formatting plain text into pretty html, but it doesn't turn plain-text links into URLs automatically. Like this one:</p>
<p><a href="http://www.google.com/" rel="nofollow">http://www.google.com/</a></p>
<p>How do I get markdown to add tags to URLs when I format a block of text?</p>
| 2 | 2008-10-15T06:22:22Z | 1,665,440 | <p>You could write an extension to markdown. Save this code as mdx_autolink.py</p>
<pre><code>import markdown
from markdown.inlinepatterns import Pattern
EXTRA_AUTOLINK_RE = r'(?<!"|>)((https?://|www)[-\w./#?%=&]+)'
class AutoLinkPattern(Pattern):
def handleMatch(self, m):
el = markdown.etree.... | 5 | 2009-11-03T05:36:24Z | [
"python",
"django",
"markdown"
] |
Does python support multiprocessor/multicore programming? | 203,912 | <p>What is the difference between multiprocessor programming and multicore programming?
preferably show examples in python how to write a small program for multiprogramming & multicore programming</p>
| 60 | 2008-10-15T06:59:50Z | 203,916 | <p>You can read about multithreading in python, and threading in general</p>
<p>Multithreading in Python:
<a href="http://www.devshed.com/c/a/Python/Basic-Threading-in-Python/" rel="nofollow">http://www.devshed.com/c/a/Python/Basic-Threading-in-Python/</a></p>
| 2 | 2008-10-15T07:03:00Z | [
"python",
"multicore"
] |
Does python support multiprocessor/multicore programming? | 203,912 | <p>What is the difference between multiprocessor programming and multicore programming?
preferably show examples in python how to write a small program for multiprogramming & multicore programming</p>
| 60 | 2008-10-15T06:59:50Z | 203,921 | <p>If I understand things correctly, Python has something called the GIL (Global Interpreter Lock) that effectively makes it impossible to take advantage of multicores when doing multiple threads in Python.</p>
<p>See eg Guido van Rossum's <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=214235" rel="nofollo... | 2 | 2008-10-15T07:07:18Z | [
"python",
"multicore"
] |
Does python support multiprocessor/multicore programming? | 203,912 | <p>What is the difference between multiprocessor programming and multicore programming?
preferably show examples in python how to write a small program for multiprogramming & multicore programming</p>
| 60 | 2008-10-15T06:59:50Z | 203,923 | <p>The main difference is how you organize and distribute data. Multicore typically has higher bandwidths between the different cores in a cpu, and multiprocessor needs to involve the bus between the cpus more.</p>
<p>Python 2.6 has gotten multiprocess (process, as in program running) and more synchronization and comm... | 1 | 2008-10-15T07:08:24Z | [
"python",
"multicore"
] |
Does python support multiprocessor/multicore programming? | 203,912 | <p>What is the difference between multiprocessor programming and multicore programming?
preferably show examples in python how to write a small program for multiprogramming & multicore programming</p>
| 60 | 2008-10-15T06:59:50Z | 203,943 | <p>As mentioned in another post Python 2.6 has the <a href="http://docs.python.org/library/multiprocessing.html">multiprocessing</a> module, which can take advantage of multiple cores/processors (it gets around GIL by starting multiple processes transparently). It offers some primitives similar to the threading module.... | 23 | 2008-10-15T07:26:44Z | [
"python",
"multicore"
] |
Does python support multiprocessor/multicore programming? | 203,912 | <p>What is the difference between multiprocessor programming and multicore programming?
preferably show examples in python how to write a small program for multiprogramming & multicore programming</p>
| 60 | 2008-10-15T06:59:50Z | 204,150 | <p>There is no such thing as "multiprocessor" or "multicore" programming. The distinction between "multiprocessor" and "multicore" <em>computers</em> is probably not relevant to you as an application programmer; it has to do with subtleties of how the cores share access to memory.</p>
<p>In order to take advantage of... | 84 | 2008-10-15T09:24:52Z | [
"python",
"multicore"
] |
Does python support multiprocessor/multicore programming? | 203,912 | <p>What is the difference between multiprocessor programming and multicore programming?
preferably show examples in python how to write a small program for multiprogramming & multicore programming</p>
| 60 | 2008-10-15T06:59:50Z | 204,210 | <p>You can actually write programs which will use multiple processors. You cannot do it with threads because of the GIL lock, but you can do it with different process.
Either:</p>
<ul>
<li>use the <a href="http://www.python.org/doc/2.5.2/lib/module-subprocess.html">subprocess</a> module, and divide your code to execut... | 5 | 2008-10-15T09:58:37Z | [
"python",
"multicore"
] |
Does python support multiprocessor/multicore programming? | 203,912 | <p>What is the difference between multiprocessor programming and multicore programming?
preferably show examples in python how to write a small program for multiprogramming & multicore programming</p>
| 60 | 2008-10-15T06:59:50Z | 435,021 | <p>Always remember, however, that if you also care about performance, using Python is a problem. It's really slow compared for instance to either Java or C#, because it's still interpreted and not JIT-compiled, and the interpreter is not very efficient.
To make it fast, most popular recommendations (ranging from manual... | -2 | 2009-01-12T10:24:28Z | [
"python",
"multicore"
] |
Does python support multiprocessor/multicore programming? | 203,912 | <p>What is the difference between multiprocessor programming and multicore programming?
preferably show examples in python how to write a small program for multiprogramming & multicore programming</p>
| 60 | 2008-10-15T06:59:50Z | 545,905 | <p>If you don't have Python 2.6 (which you don't if you're using Ubuntu Edgy or Intrepid for example), you can use the <a href="http://code.google.com/p/python-multiprocessing/" rel="nofollow">Google code backported</a> version of multiprocessing. It is part of PyPI, which means you can easily install it using EasyInst... | 0 | 2009-02-13T13:22:51Z | [
"python",
"multicore"
] |
How do I execute a program from python? os.system fails due to spaces in path | 204,017 | <p>I have a python script that needs to execute an external program, but for some reason fails.</p>
<p>If I have the following script:</p>
<pre><code>import os;
os.system("C:\\Temp\\a b c\\Notepad.exe");
raw_input();
</code></pre>
<p>Then it fails with the following error:</p>
<pre><code>'C:\Temp\a' is not recogniz... | 206 | 2008-10-15T08:24:28Z | 204,024 | <p>I suspect it's the same problem as when you use shortcuts in Windows... Try this:</p>
<pre><code>import os;
os.system("\"C:\\Temp\\a b c\\Notepad.exe\" C:\\test.txt");
</code></pre>
| 4 | 2008-10-15T08:27:05Z | [
"python",
"shellexecute"
] |
How do I execute a program from python? os.system fails due to spaces in path | 204,017 | <p>I have a python script that needs to execute an external program, but for some reason fails.</p>
<p>If I have the following script:</p>
<pre><code>import os;
os.system("C:\\Temp\\a b c\\Notepad.exe");
raw_input();
</code></pre>
<p>Then it fails with the following error:</p>
<pre><code>'C:\Temp\a' is not recogniz... | 206 | 2008-10-15T08:24:28Z | 204,049 | <p><a href="http://docs.python.org/2/library/subprocess.html#using-the-subprocess-module"><code>subprocess.call</code></a> will avoid problems with having to deal with quoting conventions of various shells. It accepts a list, rather than a string, so arguments are more easily delimited. i.e.</p>
<pre><code>import subp... | 209 | 2008-10-15T08:37:39Z | [
"python",
"shellexecute"
] |
How do I execute a program from python? os.system fails due to spaces in path | 204,017 | <p>I have a python script that needs to execute an external program, but for some reason fails.</p>
<p>If I have the following script:</p>
<pre><code>import os;
os.system("C:\\Temp\\a b c\\Notepad.exe");
raw_input();
</code></pre>
<p>Then it fails with the following error:</p>
<pre><code>'C:\Temp\a' is not recogniz... | 206 | 2008-10-15T08:24:28Z | 206,215 | <p>Here's a different way of doing it.</p>
<p>If you're using windows the following acts like double-clicking the file in Explorer, or giving the file name as an argument to the DOS "start" command: the file is opened with whatever application (if any) its extension is associated.</p>
<pre><code>filepath = 'textfile... | 50 | 2008-10-15T20:09:37Z | [
"python",
"shellexecute"
] |
How do I execute a program from python? os.system fails due to spaces in path | 204,017 | <p>I have a python script that needs to execute an external program, but for some reason fails.</p>
<p>If I have the following script:</p>
<pre><code>import os;
os.system("C:\\Temp\\a b c\\Notepad.exe");
raw_input();
</code></pre>
<p>Then it fails with the following error:</p>
<pre><code>'C:\Temp\a' is not recogniz... | 206 | 2008-10-15T08:24:28Z | 911,976 | <p>The outermost quotes are consumed by Python itself, and the Windows shell doesn't see it. As mentioned above, Windows only understands double-quotes.
Python will convert forward-slashed to backslashes on Windows, so you can use</p>
<pre><code>os.system('"C://Temp/a b c/Notepad.exe"')
</code></pre>
<p>The ' is con... | 26 | 2009-05-26T18:13:51Z | [
"python",
"shellexecute"
] |
How do I execute a program from python? os.system fails due to spaces in path | 204,017 | <p>I have a python script that needs to execute an external program, but for some reason fails.</p>
<p>If I have the following script:</p>
<pre><code>import os;
os.system("C:\\Temp\\a b c\\Notepad.exe");
raw_input();
</code></pre>
<p>Then it fails with the following error:</p>
<pre><code>'C:\Temp\a' is not recogniz... | 206 | 2008-10-15T08:24:28Z | 1,622,730 | <p>At least in Windows 7 and Python 3.1, os.system in Windows wants the command line <em>double-quoted</em> if there are spaces in path to the command. For example:</p>
<pre><code> TheCommand = '\"\"C:\\Temp\\a b c\\Notepad.exe\"\"'
os.system(TheCommand)
</code></pre>
<p>A real-world example that was stumping me w... | 14 | 2009-10-26T01:33:47Z | [
"python",
"shellexecute"
] |
How do I execute a program from python? os.system fails due to spaces in path | 204,017 | <p>I have a python script that needs to execute an external program, but for some reason fails.</p>
<p>If I have the following script:</p>
<pre><code>import os;
os.system("C:\\Temp\\a b c\\Notepad.exe");
raw_input();
</code></pre>
<p>Then it fails with the following error:</p>
<pre><code>'C:\Temp\a' is not recogniz... | 206 | 2008-10-15T08:24:28Z | 2,742,855 | <pre><code>import win32api # if active state python is installed or install pywin32 package seperately
try: win32api.WinExec('NOTEPAD.exe') # Works seamlessly
except: pass
</code></pre>
| 6 | 2010-04-30T07:08:44Z | [
"python",
"shellexecute"
] |
Alert Popups from service in Python | 204,062 | <p>I have been using win32api.MessageBox to do alerts, and this works for apps running from the interactive prompt and normally executed code, however when I built a Python service when a MessageBox is triggered I can hear the 'beep' but the box does not display. Is it possible to display alerts from services?</p>
| 3 | 2008-10-15T08:42:43Z | 204,082 | <p>No, Windows services run on a completely separate hidden desktop and have no access to the logged-on user's desktop. There is no way around this from a service developer's perspective.</p>
<p>In previous versions of Windows, it was possible for a service to be marked as "allowed to interact with the user desktop", ... | 5 | 2008-10-15T08:48:06Z | [
"python",
"winapi",
"service",
"alerts"
] |
Checking for member existence in Python | 204,308 | <p>I regularly want to check if an object has a member or not. An example is the creation of a singleton in a function. For that purpose, you can use <code>hasattr</code> like this:</p>
<pre><code>class Foo(object):
@classmethod
def singleton(self):
if not hasattr(self, 'instance'):
self.in... | 23 | 2008-10-15T10:54:18Z | 204,318 | <p>It depends on which case is "typical", because exceptions should model, well, atypical conditions. So, if the typical case is that the <code>instance</code> attribute should exist, then use the second code style. If not having <code>instance</code> is as typical as having <code>instance</code>, then use the first st... | 5 | 2008-10-15T10:59:22Z | [
"python",
"exception",
"introspection",
"hasattr"
] |
Checking for member existence in Python | 204,308 | <p>I regularly want to check if an object has a member or not. An example is the creation of a singleton in a function. For that purpose, you can use <code>hasattr</code> like this:</p>
<pre><code>class Foo(object):
@classmethod
def singleton(self):
if not hasattr(self, 'instance'):
self.in... | 23 | 2008-10-15T10:54:18Z | 204,481 | <p>I just tried to measure times:</p>
<pre><code>class Foo(object):
@classmethod
def singleton(self):
if not hasattr(self, 'instance'):
self.instance = Foo()
return self.instance
class Bar(object):
@classmethod
def singleton(self):
try:
return self.ins... | 10 | 2008-10-15T12:15:54Z | [
"python",
"exception",
"introspection",
"hasattr"
] |
Checking for member existence in Python | 204,308 | <p>I regularly want to check if an object has a member or not. An example is the creation of a singleton in a function. For that purpose, you can use <code>hasattr</code> like this:</p>
<pre><code>class Foo(object):
@classmethod
def singleton(self):
if not hasattr(self, 'instance'):
self.in... | 23 | 2008-10-15T10:54:18Z | 204,520 | <p>I have to agree with Chris. Remember, don't optimize until you actually need to do so. I really doubt checking for existence is going to be a bottleneck in any reasonable program.</p>
<p>I did see <a href="http://code.activestate.com/recipes/52558/" rel="nofollow">http://code.activestate.com/recipes/52558/</a> as... | 0 | 2008-10-15T12:27:14Z | [
"python",
"exception",
"introspection",
"hasattr"
] |
Checking for member existence in Python | 204,308 | <p>I regularly want to check if an object has a member or not. An example is the creation of a singleton in a function. For that purpose, you can use <code>hasattr</code> like this:</p>
<pre><code>class Foo(object):
@classmethod
def singleton(self):
if not hasattr(self, 'instance'):
self.in... | 23 | 2008-10-15T10:54:18Z | 204,523 | <p>These are two different methodologies: â1 is LBYL (look before you leap) and â2 is EAFP (easier to ask forgiveness than permission).</p>
<p>Pythonistas typically suggest that EAFP is better, with arguments in style of "what if a process creates the file between the time you test for it and the time you try to c... | 21 | 2008-10-15T12:28:11Z | [
"python",
"exception",
"introspection",
"hasattr"
] |
Checking for member existence in Python | 204,308 | <p>I regularly want to check if an object has a member or not. An example is the creation of a singleton in a function. For that purpose, you can use <code>hasattr</code> like this:</p>
<pre><code>class Foo(object):
@classmethod
def singleton(self):
if not hasattr(self, 'instance'):
self.in... | 23 | 2008-10-15T10:54:18Z | 204,561 | <p>A little off-topic in the way of using it. Singletons are overrated, and a "shared-state" method is as effective, and mostly, very clean in python, for example:</p>
<pre><code>class Borg:
__shared_state = {}
def __init__(self):
self.__dict__ = self.__shared_state
# and whatever else you want in ... | 1 | 2008-10-15T12:45:28Z | [
"python",
"exception",
"introspection",
"hasattr"
] |
Failed to get separate instances of a class under mod_python | 204,427 | <p>I'm trying to run some python code under Apache 2.2 / mod_python 3.2.8. Eventually the code does os.fork() and spawns 2 separate long-run processes. Each of those processes has to create a separate instance of a class in order to avoid any possible collision in the parallel flow. </p>
<pre><code>class Foo(object):
... | 2 | 2008-10-15T11:47:27Z | 204,460 | <p>The memory location given by the <code>repr()</code> function is an address in virtual memory, not an address in the system's global memory. Each of your processes returned by fork() has its own virtual memory space which is completely distinct from other processes. They do not share memory.</p>
<p><strong>Edit:<... | 3 | 2008-10-15T12:05:04Z | [
"python",
"apache",
"mod-python"
] |
Any experience with the Deliverance system? | 204,570 | <p>My new boss went to a speech where Deliverance, a kind of proxy allowing to add skin to any html output on the fly, was presented. He decided to use it right after that, no matter how young it is.</p>
<p>More here :</p>
<p><a href="http://www.openplans.org/projects/deliverance/introduction" rel="nofollow">http://w... | 0 | 2008-10-15T12:48:02Z | 204,602 | <p>I will start answering this question here while we perform tests but I'd love to have feedback from other users.</p>
<h2>Install</h2>
<p>We have spent a small afternoon from tuto to "how to" to finally install and run the thing on a virtual machine.</p>
<p>This one is ok : <a href="http://www.openplans.org/projec... | 0 | 2008-10-15T12:58:03Z | [
"python",
"html",
"deliverance"
] |
Any experience with the Deliverance system? | 204,570 | <p>My new boss went to a speech where Deliverance, a kind of proxy allowing to add skin to any html output on the fly, was presented. He decided to use it right after that, no matter how young it is.</p>
<p>More here :</p>
<p><a href="http://www.openplans.org/projects/deliverance/introduction" rel="nofollow">http://w... | 0 | 2008-10-15T12:48:02Z | 803,552 | <p>The plone website itself (<a href="http://plone.org/" rel="nofollow">http://plone.org</a>) is themed using deliverance. So far as I know, it is the first large-scale production plone site using deliverance. </p>
| 1 | 2009-04-29T18:05:38Z | [
"python",
"html",
"deliverance"
] |
Any experience with the Deliverance system? | 204,570 | <p>My new boss went to a speech where Deliverance, a kind of proxy allowing to add skin to any html output on the fly, was presented. He decided to use it right after that, no matter how young it is.</p>
<p>More here :</p>
<p><a href="http://www.openplans.org/projects/deliverance/introduction" rel="nofollow">http://w... | 0 | 2008-10-15T12:48:02Z | 855,035 | <p>Note, plone.org uses xdv, a version of deliverance that compiles down to xslt. The simplest way to try it is with <a href="http://pypi.python.org/pypi/collective.xdv" rel="nofollow">http://pypi.python.org/pypi/collective.xdv</a> though plone.org runs the xslt in a (patched) Nginx.</p>
| 2 | 2009-05-12T21:47:04Z | [
"python",
"html",
"deliverance"
] |
Any experience with the Deliverance system? | 204,570 | <p>My new boss went to a speech where Deliverance, a kind of proxy allowing to add skin to any html output on the fly, was presented. He decided to use it right after that, no matter how young it is.</p>
<p>More here :</p>
<p><a href="http://www.openplans.org/projects/deliverance/introduction" rel="nofollow">http://w... | 0 | 2008-10-15T12:48:02Z | 2,825,686 | <p>Having used Plone professionally for the last 4 years or so, and Deliverance on 4 commercial sites, I would advise all new front end developers (and old hands alike) to use Deliverance to theme Plone sites.</p>
<p>It is <em>much</em> easier to learn (a couple of weeks Vs couple of months) and potentially much more ... | 5 | 2010-05-13T09:31:47Z | [
"python",
"html",
"deliverance"
] |
What would you recommend for a high traffic ajax intensive website? | 204,802 | <p>For a website like reddit with lots of up/down votes and lots of comments per topic what should I go with?</p>
<p>Lighttpd/Php or Lighttpd/CherryPy/Genshi/SQLAlchemy?</p>
<p>and for database what would scale better / be fastest MySQL ( 4.1 or 5 ? ) or PostgreSQL?</p>
| 7 | 2008-10-15T13:57:23Z | 204,853 | <p>I can't speak to the MySQL/PostgreSQL question as I have limited experience with Postgres, but my Masters research project was about high-performance websites with CherryPy, and I don't think you'll be disappointed if you use CherryPy for your site. It can easily scale to thousands of simultaneous users on commodit... | 8 | 2008-10-15T14:11:29Z | [
"php",
"python",
"lighttpd",
"cherrypy",
"high-load"
] |
What would you recommend for a high traffic ajax intensive website? | 204,802 | <p>For a website like reddit with lots of up/down votes and lots of comments per topic what should I go with?</p>
<p>Lighttpd/Php or Lighttpd/CherryPy/Genshi/SQLAlchemy?</p>
<p>and for database what would scale better / be fastest MySQL ( 4.1 or 5 ? ) or PostgreSQL?</p>
| 7 | 2008-10-15T13:57:23Z | 204,854 | <p>Going to need more data. Jeff had a few articles on the same problems and the answer was to wait till you hit a performance issue.</p>
<p>to start with - who is hosting and what do they have available ? what's your in house talent skill sets ? Are you going to be hiring an outside firm ? what do they recommend ?... | 2 | 2008-10-15T14:11:42Z | [
"php",
"python",
"lighttpd",
"cherrypy",
"high-load"
] |
What would you recommend for a high traffic ajax intensive website? | 204,802 | <p>For a website like reddit with lots of up/down votes and lots of comments per topic what should I go with?</p>
<p>Lighttpd/Php or Lighttpd/CherryPy/Genshi/SQLAlchemy?</p>
<p>and for database what would scale better / be fastest MySQL ( 4.1 or 5 ? ) or PostgreSQL?</p>
| 7 | 2008-10-15T13:57:23Z | 204,916 | <p>The ideal setup would be close to <a href="http://www.igvita.com/2008/02/11/nginx-and-memcached-a-400-boost/" rel="nofollow">this</a>:</p>
<p><img src="http://www.igvita.com/posts/02-08/nginx-memcached.png" alt="caching" /></p>
<p>In short, <a href="http://wiki.codemongers.com/" rel="nofollow">nginx</a> is a fast ... | 8 | 2008-10-15T14:26:18Z | [
"php",
"python",
"lighttpd",
"cherrypy",
"high-load"
] |
What would you recommend for a high traffic ajax intensive website? | 204,802 | <p>For a website like reddit with lots of up/down votes and lots of comments per topic what should I go with?</p>
<p>Lighttpd/Php or Lighttpd/CherryPy/Genshi/SQLAlchemy?</p>
<p>and for database what would scale better / be fastest MySQL ( 4.1 or 5 ? ) or PostgreSQL?</p>
| 7 | 2008-10-15T13:57:23Z | 205,425 | <p>On the DB question, I'd say PostgreSQL scales better and has better data integrity than MySQL. For a small site MySQL might be faster, but from what I've heard it slows significantly as the size of the database grows. (<em>Note: I've never used MySQL for a large database, so you should probably get a second opinion ... | 3 | 2008-10-15T16:31:15Z | [
"php",
"python",
"lighttpd",
"cherrypy",
"high-load"
] |
What would you recommend for a high traffic ajax intensive website? | 204,802 | <p>For a website like reddit with lots of up/down votes and lots of comments per topic what should I go with?</p>
<p>Lighttpd/Php or Lighttpd/CherryPy/Genshi/SQLAlchemy?</p>
<p>and for database what would scale better / be fastest MySQL ( 4.1 or 5 ? ) or PostgreSQL?</p>
| 7 | 2008-10-15T13:57:23Z | 244,836 | <p>I would go with nginx + php + xcache + postgresql</p>
| 2 | 2008-10-28T20:54:21Z | [
"php",
"python",
"lighttpd",
"cherrypy",
"high-load"
] |
Capture the contents of a regex and delete them, efficiently | 204,829 | <p>Situation:</p>
<ul>
<li>text: a string</li>
<li>R: a regex that matches part of the string. This might be expensive to calculate. </li>
</ul>
<p>I want to both delete the R-matches from the text, and see what they actually contain. Currently, I do this like:</p>
<pre><code>import re
ab_re = re.compile("[ab]"... | 7 | 2008-10-15T14:05:55Z | 204,961 | <p>You could use split with capturing parantheses. If you do, then the text of all groups in the pattern are also returned as part of the resulting list (from <a href="http://www.python.org/doc/2.5.2/lib/node46.html" rel="nofollow">python doc</a>).</p>
<p>So the code would be </p>
<pre><code>import re
ab_re = re.com... | 0 | 2008-10-15T14:36:18Z | [
"python",
"regex"
] |
Capture the contents of a regex and delete them, efficiently | 204,829 | <p>Situation:</p>
<ul>
<li>text: a string</li>
<li>R: a regex that matches part of the string. This might be expensive to calculate. </li>
</ul>
<p>I want to both delete the R-matches from the text, and see what they actually contain. Currently, I do this like:</p>
<pre><code>import re
ab_re = re.compile("[ab]"... | 7 | 2008-10-15T14:05:55Z | 204,981 | <pre><code>import re
r = re.compile("[ab]")
text = "abcdedfe falijbijie bbbb laifsjelifjl"
matches = []
replaced = []
pos = 0
for m in r.finditer(text):
matches.append(m.group(0))
replaced.append(text[pos:m.start()])
pos = m.end()
replaced.append(text[pos:])
print matches
print ''.join(replaced)
</code><... | 4 | 2008-10-15T14:41:51Z | [
"python",
"regex"
] |
Capture the contents of a regex and delete them, efficiently | 204,829 | <p>Situation:</p>
<ul>
<li>text: a string</li>
<li>R: a regex that matches part of the string. This might be expensive to calculate. </li>
</ul>
<p>I want to both delete the R-matches from the text, and see what they actually contain. Currently, I do this like:</p>
<pre><code>import re
ab_re = re.compile("[ab]"... | 7 | 2008-10-15T14:05:55Z | 205,056 | <p>My revised answer, using <strong>re.split()</strong>, which does things in one regex pass:</p>
<pre><code>import re
text="abcdedfe falijbijie bbbb laifsjelifjl"
ab_re = re.compile("([ab])")
tokens = ab_re.split(text)
non_matches = tokens[0::2]
matches = tokens[1::2]
</code></pre>
<p>(edit: here is a complete funct... | 3 | 2008-10-15T15:00:40Z | [
"python",
"regex"
] |
Capture the contents of a regex and delete them, efficiently | 204,829 | <p>Situation:</p>
<ul>
<li>text: a string</li>
<li>R: a regex that matches part of the string. This might be expensive to calculate. </li>
</ul>
<p>I want to both delete the R-matches from the text, and see what they actually contain. Currently, I do this like:</p>
<pre><code>import re
ab_re = re.compile("[ab]"... | 7 | 2008-10-15T14:05:55Z | 205,072 | <p>What about this:</p>
<pre><code>import re
text = "abcdedfe falijbijie bbbb laifsjelifjl"
matches = []
ab_re = re.compile( "[ab]" )
def verboseTest( m ):
matches.append( m.group(0) )
return ''
textWithoutMatches = ab_re.sub( verboseTest, text )
print matches
# ['a', 'b', 'a', 'b', 'b', 'b', 'b', 'b', 'a... | 4 | 2008-10-15T15:05:21Z | [
"python",
"regex"
] |
Is it possible to compile Python natively (beyond pyc byte code)? | 205,062 | <p>I wonder if it is possible to create an executable module from a Python script. I need to have the most performance and the flexibility of Python script, without needing to run in the Python environment. I would use this code to load on demand user modules to customize my application.</p>
| 13 | 2008-10-15T15:02:09Z | 205,075 | <p>You can use something like py2exe to compile your python script into an exe, or Freeze for a linux binary.</p>
<p>see: <a href="http://stackoverflow.com/questions/2933/an-executable-python-app#2937">http://stackoverflow.com/questions/2933/an-executable-python-app#2937</a></p>
| 7 | 2008-10-15T15:05:47Z | [
"python",
"module",
"compilation"
] |
Is it possible to compile Python natively (beyond pyc byte code)? | 205,062 | <p>I wonder if it is possible to create an executable module from a Python script. I need to have the most performance and the flexibility of Python script, without needing to run in the Python environment. I would use this code to load on demand user modules to customize my application.</p>
| 13 | 2008-10-15T15:02:09Z | 205,096 | <ul>
<li>There's <a href="http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/" rel="nofollow">pyrex</a> that compiles python like source to python extension modules </li>
<li><a href="http://codespeak.net/pypy/dist/pypy/doc/coding-guide.html#our-runtime-interpreter-is-restricted-python" rel="nofollow">rpython</a>... | 14 | 2008-10-15T15:11:26Z | [
"python",
"module",
"compilation"
] |
Is it possible to compile Python natively (beyond pyc byte code)? | 205,062 | <p>I wonder if it is possible to create an executable module from a Python script. I need to have the most performance and the flexibility of Python script, without needing to run in the Python environment. I would use this code to load on demand user modules to customize my application.</p>
| 13 | 2008-10-15T15:02:09Z | 209,176 | <p>I think you can use jython to compile python to Java bytecode, and then compile that with GCJ.</p>
| 0 | 2008-10-16T15:56:03Z | [
"python",
"module",
"compilation"
] |
Is it possible to compile Python natively (beyond pyc byte code)? | 205,062 | <p>I wonder if it is possible to create an executable module from a Python script. I need to have the most performance and the flexibility of Python script, without needing to run in the Python environment. I would use this code to load on demand user modules to customize my application.</p>
| 13 | 2008-10-15T15:02:09Z | 211,301 | <p>I've had a lot of success using <a href="http://cython.org/" rel="nofollow">Cython</a>, which is based on and extends pyrex:</p>
<blockquote>
<p>Cython is a language that makes
writing C extensions for the Python
language as easy as Python itself.
Cython is based on the well-known
Pyrex, but supports more... | 2 | 2008-10-17T07:19:59Z | [
"python",
"module",
"compilation"
] |
Sometimes can't delete an Oracle database row using Django | 205,136 | <p>I have a unit test which contains the following line of code</p>
<pre><code>Site.objects.get(name="UnitTest").delete()
</code></pre>
<p>and this has worked just fine until now. However, that statement is currently hanging. It'll sit there forever trying to execute the delete. If I just say</p>
<pre><code>print... | 1 | 2008-10-15T15:19:50Z | 205,152 | <p>From a separate session, can you query the DBA_BLOCKERS and DBA_WAITERS data dictionary tables and post the results? That will tell you if your session is getting blocked by a lock held by some other session, as well as what other session is holding the lock.</p>
| 1 | 2008-10-15T15:24:07Z | [
"python",
"django",
"oracle"
] |
Starting a new database driven python web application would you use a javascript widget framework? If so which framework? | 205,204 | <p>I am starting a new web application project. I want to use python as I am using it at my bread-and-butter-job.</p>
<p>However I don't want to reinvent the wheel. Some things I have thought about:</p>
<ul>
<li><p>AJAX would be nice if itâs not too much of a hazzle. </p></li>
<li><p>It is best if the licensing all... | 1 | 2008-10-15T15:37:16Z | 205,235 | <p>I heartily suggest <a href="http://www.djangoproject.com/" rel="nofollow">Django</a> + <a href="http://www.prototypejs.org/" rel="nofollow">Prototype</a>. I think they cover most of the bases you are looking at and they are very straight-forward to get started with. Also you could use them on the GAE if that is th... | 1 | 2008-10-15T15:42:49Z | [
"javascript",
"python",
"frameworks"
] |
Starting a new database driven python web application would you use a javascript widget framework? If so which framework? | 205,204 | <p>I am starting a new web application project. I want to use python as I am using it at my bread-and-butter-job.</p>
<p>However I don't want to reinvent the wheel. Some things I have thought about:</p>
<ul>
<li><p>AJAX would be nice if itâs not too much of a hazzle. </p></li>
<li><p>It is best if the licensing all... | 1 | 2008-10-15T15:37:16Z | 205,424 | <p>I'd take a look at <a href="http://web2py.com/" rel="nofollow">web2py</a>. It's a full-stack framework that requires no configuration and is easy to try out - everything can be driven via a web interface if you choose. I've dabbled with other frameworks and it's by far the easiest to setup and includes lots of helpf... | 1 | 2008-10-15T16:30:49Z | [
"javascript",
"python",
"frameworks"
] |
Starting a new database driven python web application would you use a javascript widget framework? If so which framework? | 205,204 | <p>I am starting a new web application project. I want to use python as I am using it at my bread-and-butter-job.</p>
<p>However I don't want to reinvent the wheel. Some things I have thought about:</p>
<ul>
<li><p>AJAX would be nice if itâs not too much of a hazzle. </p></li>
<li><p>It is best if the licensing all... | 1 | 2008-10-15T15:37:16Z | 205,600 | <p>Take a look at <a href="http://extjs.com/" rel="nofollow">ExtJS</a>. It's got the best widget library out there. They offer a commercial license and an open-source license. There are several python developers in the community and there is some integration with Google APIs.</p>
| 1 | 2008-10-15T17:15:49Z | [
"javascript",
"python",
"frameworks"
] |
Starting a new database driven python web application would you use a javascript widget framework? If so which framework? | 205,204 | <p>I am starting a new web application project. I want to use python as I am using it at my bread-and-butter-job.</p>
<p>However I don't want to reinvent the wheel. Some things I have thought about:</p>
<ul>
<li><p>AJAX would be nice if itâs not too much of a hazzle. </p></li>
<li><p>It is best if the licensing all... | 1 | 2008-10-15T15:37:16Z | 205,674 | <p><a href="http://www.jquery.com/" rel="nofollow">jQuery</a>? Though its <a href="http://ui.jquery.com/" rel="nofollow">UI</a> components are perhaps not up to the very best (but lots of work appears to be done in that area), jQuery itself seems to be on track to become the de facto JS standard library. It is both MIT... | 4 | 2008-10-15T17:36:58Z | [
"javascript",
"python",
"frameworks"
] |
Starting a new database driven python web application would you use a javascript widget framework? If so which framework? | 205,204 | <p>I am starting a new web application project. I want to use python as I am using it at my bread-and-butter-job.</p>
<p>However I don't want to reinvent the wheel. Some things I have thought about:</p>
<ul>
<li><p>AJAX would be nice if itâs not too much of a hazzle. </p></li>
<li><p>It is best if the licensing all... | 1 | 2008-10-15T15:37:16Z | 213,325 | <p>web2py uses jQuery</p>
| 1 | 2008-10-17T18:36:12Z | [
"javascript",
"python",
"frameworks"
] |
How can I check the syntax of Python code in Emacs without actually executing it? | 205,704 | <p>Python's IDLE has 'Check Module' (Alt-X) to check the syntax which can be called without needing to run the code. Is there an equivalent way to do this in Emacs instead of running and executing the code?</p>
| 14 | 2008-10-15T17:46:12Z | 205,726 | <p>You can use <a href="http://www.logilab.org/857" rel="nofollow">pylint</a> for such things and there seems to be a way to integrate it into <a href="http://www.emacswiki.org/cgi-bin/wiki/PythonMode#toc8" rel="nofollow">emacs</a>, but I've never done the latter b/c I'm a vim user.</p>
| 0 | 2008-10-15T17:51:09Z | [
"python",
"validation",
"emacs",
"syntax"
] |
How can I check the syntax of Python code in Emacs without actually executing it? | 205,704 | <p>Python's IDLE has 'Check Module' (Alt-X) to check the syntax which can be called without needing to run the code. Is there an equivalent way to do this in Emacs instead of running and executing the code?</p>
| 14 | 2008-10-15T17:46:12Z | 206,617 | <p>You can <a href="http://www.plope.org/Members/chrism/flymake-mode" rel="nofollow">use Pyflakes together with Flymake</a> in order to get instant notification when your python code is valid (and avoids a few common pitfalls as well).</p>
| 8 | 2008-10-15T21:40:49Z | [
"python",
"validation",
"emacs",
"syntax"
] |
How can I check the syntax of Python code in Emacs without actually executing it? | 205,704 | <p>Python's IDLE has 'Check Module' (Alt-X) to check the syntax which can be called without needing to run the code. Is there an equivalent way to do this in Emacs instead of running and executing the code?</p>
| 14 | 2008-10-15T17:46:12Z | 207,059 | <p>Or from emacs (or vim) you could run <code>python -c 'import x'</code> where x is the name of your file minus the <code>.py</code> extension.</p>
| 2 | 2008-10-16T00:56:03Z | [
"python",
"validation",
"emacs",
"syntax"
] |
How can I check the syntax of Python code in Emacs without actually executing it? | 205,704 | <p>Python's IDLE has 'Check Module' (Alt-X) to check the syntax which can be called without needing to run the code. Is there an equivalent way to do this in Emacs instead of running and executing the code?</p>
| 14 | 2008-10-15T17:46:12Z | 207,593 | <p>You can use pylint, pychecker, pyflakes etc. from Emacs' <code>compile</code> command (<code>M-x compile</code>).</p>
<p>Hint: bind a key (say, F5) to <code>recompile</code>.</p>
| 0 | 2008-10-16T06:32:48Z | [
"python",
"validation",
"emacs",
"syntax"
] |
How can I check the syntax of Python code in Emacs without actually executing it? | 205,704 | <p>Python's IDLE has 'Check Module' (Alt-X) to check the syntax which can be called without needing to run the code. Is there an equivalent way to do this in Emacs instead of running and executing the code?</p>
| 14 | 2008-10-15T17:46:12Z | 8,584,325 | <pre><code>python -m py_compile script.py
</code></pre>
| 17 | 2011-12-21T02:10:48Z | [
"python",
"validation",
"emacs",
"syntax"
] |
Any good team-chat websites? | 206,040 | <p>Are there any good team-chat websites, preferably in Python, ideally with CherryPy or Trac?</p>
<p>This is similar to <a href="http://stackoverflow.com/questions/46612/whats-a-good-freeware-collaborative-ie-multiuser-instant-messenger#46660">http://stackoverflow.com/questions/46612/whats-a-good-freeware-collaborati... | 3 | 2008-10-15T19:17:49Z | 206,076 | <p><a href="http://www.campfirenow.com/" rel="nofollow">Campfire</a> from 37 signals - the rails guys.</p>
<p><strong>Edit:</strong> It doesn't meet your requirements but it has some great features...</p>
| 2 | 2008-10-15T19:28:32Z | [
"python",
"collaboration",
"instant-messaging"
] |
variables as parameters in field options | 206,245 | <p>I want to create a model, that will set editable=False on creation, and editable=True on editing item. I thought it should be something like this: </p>
<pre><code> home = models.ForeignKey(Team, editable=lambda self: True if self.id else False)
</code></pre>
<p>But it doesn't work. Maybe something with overriding ... | 2 | 2008-10-15T20:16:33Z | 208,049 | <p>Add the following (a small extension of <a href="http://www.djangosnippets.org/snippets/937/" rel="nofollow">this code</a>) to your admin.py:</p>
<pre><code>from django import forms
class ReadOnlyWidget(forms.Widget):
def __init__(self, original_value, display_value):
self.original_value = original_val... | 4 | 2008-10-16T10:33:21Z | [
"python",
"django"
] |
Why do attribute references act like this with Python inheritance? | 206,734 | <p>The following seems strange.. Basically, the somedata attribute seems shared between all the classes that inherited from <code>the_base_class</code>.</p>
<pre><code>class the_base_class:
somedata = {}
somedata['was_false_in_base'] = False
class subclassthing(the_base_class):
def __init__(self):
... | 16 | 2008-10-15T22:18:00Z | 206,765 | <p>You are right, <code>somedata</code> is shared between all instances of the class and it's subclasses, because it is created at class <em>definition</em> time. The lines </p>
<pre><code>somedata = {}
somedata['was_false_in_base'] = False
</code></pre>
<p>are executed when the class is defined, i.e. when the interp... | 22 | 2008-10-15T22:27:18Z | [
"python",
"class",
"inheritance"
] |
Why do attribute references act like this with Python inheritance? | 206,734 | <p>The following seems strange.. Basically, the somedata attribute seems shared between all the classes that inherited from <code>the_base_class</code>.</p>
<pre><code>class the_base_class:
somedata = {}
somedata['was_false_in_base'] = False
class subclassthing(the_base_class):
def __init__(self):
... | 16 | 2008-10-15T22:18:00Z | 206,800 | <p>Note that part of the behavior youâre seeing is due to <code>somedata</code> being a <code>dict</code>, as opposed to a simple data type such as a <code>bool</code>.</p>
<p>For instance, see this different example which behaves differently (although very similar):</p>
<pre><code>class the_base_class:
somedat... | 10 | 2008-10-15T22:40:10Z | [
"python",
"class",
"inheritance"
] |
Why do attribute references act like this with Python inheritance? | 206,734 | <p>The following seems strange.. Basically, the somedata attribute seems shared between all the classes that inherited from <code>the_base_class</code>.</p>
<pre><code>class the_base_class:
somedata = {}
somedata['was_false_in_base'] = False
class subclassthing(the_base_class):
def __init__(self):
... | 16 | 2008-10-15T22:18:00Z | 206,840 | <p>I think the easiest way to understand this (so that you can predict behavior) is to realize that your <code>somedata</code> is an attribute of the class and not the instance of that class if you define it that way.</p>
<p>There is really only one <code>somedata</code> at all times because in your example you didn't... | 2 | 2008-10-15T22:55:23Z | [
"python",
"class",
"inheritance"
] |
Ruby to Python bridge | 206,823 | <p>I am interested in getting some Python code talking to some Ruby code on Windows, Linux and possibly other platforms. Specificlly I would like to access classes in Ruby from Python and call their methods, access their data, create new instances and so on.</p>
<p>An obvious way to do this is via something like XML-R... | 8 | 2008-10-15T22:49:36Z | 206,839 | <p>Please be advised that I don't speak from personal experience here, but I imagine JRuby and Jython (The ruby and python implementations in the JVM) would be able to to easily talk to each other, as well as Java code. You may want to look into that.</p>
| 3 | 2008-10-15T22:55:14Z | [
"python",
"ruby",
"interop"
] |
Ruby to Python bridge | 206,823 | <p>I am interested in getting some Python code talking to some Ruby code on Windows, Linux and possibly other platforms. Specificlly I would like to access classes in Ruby from Python and call their methods, access their data, create new instances and so on.</p>
<p>An obvious way to do this is via something like XML-R... | 8 | 2008-10-15T22:49:36Z | 206,866 | <p>Well, you could try <a href="http://en.wikipedia.org/wiki/Named_pipe" rel="nofollow">named pipes</a> or something similar but I really think that XML-RPC would be the most headache-free way.</p>
| 4 | 2008-10-15T23:11:54Z | [
"python",
"ruby",
"interop"
] |
Ruby to Python bridge | 206,823 | <p>I am interested in getting some Python code talking to some Ruby code on Windows, Linux and possibly other platforms. Specificlly I would like to access classes in Ruby from Python and call their methods, access their data, create new instances and so on.</p>
<p>An obvious way to do this is via something like XML-R... | 8 | 2008-10-15T22:49:36Z | 207,821 | <p>This isn't what your after, but worth a read: embed Python interpreter in Ruby: this code's pretty old</p>
<p><a href="http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/index.html" rel="nofollow">http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/index.html</a></p>
<p>OR: why, rewriting bytecode... | 2 | 2008-10-16T08:50:10Z | [
"python",
"ruby",
"interop"
] |
Ruby to Python bridge | 206,823 | <p>I am interested in getting some Python code talking to some Ruby code on Windows, Linux and possibly other platforms. Specificlly I would like to access classes in Ruby from Python and call their methods, access their data, create new instances and so on.</p>
<p>An obvious way to do this is via something like XML-R... | 8 | 2008-10-15T22:49:36Z | 4,859,738 | <p><a href="http://stackoverflow.com/questions/2752979/using-jruby-jython-for-ruby-python-interoperability">Using JRuby/Jython for Ruby/Python interoperability?</a>
has more information. Of note: JRuby and Jython don't have object compatibility, but IronPython and IronRuby do.</p>
| 1 | 2011-02-01T06:46:58Z | [
"python",
"ruby",
"interop"
] |
Ruby to Python bridge | 206,823 | <p>I am interested in getting some Python code talking to some Ruby code on Windows, Linux and possibly other platforms. Specificlly I would like to access classes in Ruby from Python and call their methods, access their data, create new instances and so on.</p>
<p>An obvious way to do this is via something like XML-R... | 8 | 2008-10-15T22:49:36Z | 4,859,776 | <p>Expose your Ruby classes as web services using Sinatra, Rails, or, plain old Rack.</p>
<p>Expose your Python classes as web services using web.py, flask, Django, or App Engine.</p>
<p>Use HTTParty for Ruby to build an API into your Python classes.</p>
<p>Use a Python REST library to build an API into your Ruby cl... | 1 | 2011-02-01T06:53:07Z | [
"python",
"ruby",
"interop"
] |
Scrape a dynamic website | 206,855 | <p>What is the best method to scrape a dynamic website where most of the content is generated by what appears to be ajax requests? I have previous experience with a Mechanize, BeautifulSoup, and python combo, but I am up for something new.</p>
<p>--Edit--
For more detail: I'm trying to scrape the CNN <a href="http://... | 12 | 2008-10-15T23:04:13Z | 206,860 | <p>This is a difficult problem because you either have to reverse engineer the javascript on a per-site basis, or implement a javascript engine and run the scripts (which has its own difficulties and pitfalls).</p>
<p>It's a heavy weight solution, but I've seen people doing this with greasemonkey scripts - allow Firef... | 7 | 2008-10-15T23:09:14Z | [
"python",
"ajax",
"screen-scraping",
"beautifulsoup"
] |
Scrape a dynamic website | 206,855 | <p>What is the best method to scrape a dynamic website where most of the content is generated by what appears to be ajax requests? I have previous experience with a Mechanize, BeautifulSoup, and python combo, but I am up for something new.</p>
<p>--Edit--
For more detail: I'm trying to scrape the CNN <a href="http://... | 12 | 2008-10-15T23:04:13Z | 206,913 | <p>Adam Davis's advice is solid.</p>
<p>I would additionally suggest that you try to "reverse-engineer" what the JavaScript is doing, and instead of trying to scrape the page, you issue the HTTP requests that the JavaScript is issuing and interpret the results yourself (most likely in JSON format, nice and easy to par... | 3 | 2008-10-15T23:34:37Z | [
"python",
"ajax",
"screen-scraping",
"beautifulsoup"
] |
Scrape a dynamic website | 206,855 | <p>What is the best method to scrape a dynamic website where most of the content is generated by what appears to be ajax requests? I have previous experience with a Mechanize, BeautifulSoup, and python combo, but I am up for something new.</p>
<p>--Edit--
For more detail: I'm trying to scrape the CNN <a href="http://... | 12 | 2008-10-15T23:04:13Z | 207,065 | <p>This seems like it's a pretty common problem. I wonder why someone hasn't anyone developed a programmatic browser? I'm envisioning a Firefox you can call from the command line with a URL as an argument and it will load the page, run all of the initial page load JS events and save the resulting file.</p>
<p>I mean... | 0 | 2008-10-16T00:58:10Z | [
"python",
"ajax",
"screen-scraping",
"beautifulsoup"
] |
Scrape a dynamic website | 206,855 | <p>What is the best method to scrape a dynamic website where most of the content is generated by what appears to be ajax requests? I have previous experience with a Mechanize, BeautifulSoup, and python combo, but I am up for something new.</p>
<p>--Edit--
For more detail: I'm trying to scrape the CNN <a href="http://... | 12 | 2008-10-15T23:04:13Z | 207,106 | <p>Selenium IDE, a tool for testing, is something I've used for a lot of screen-scraping. There are a few things it doesn't handle well (Javascript window.alert() and popup windows in general), but it does its work on a page by actually triggering the click events and typing into the text boxes. Because the IDE portion... | 4 | 2008-10-16T01:15:19Z | [
"python",
"ajax",
"screen-scraping",
"beautifulsoup"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.