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 |
|---|---|---|---|---|---|---|---|---|---|
Get only the keys out of a reference property in GAE-Py | 2,076,260 | <p>I've got a an app where I'm storing posts and their authors. Very
straightforward each post has one author model.</p>
<p>The problem is this: I fetch the last 10 posts using one call, using
fetch() with limit = 10. But when I print them out, GAE uses 10 extra
gets to access the author details, because the author... | 0 | 2010-01-16T05:06:37Z | 2,076,266 | <p>See my response to <a href="http://stackoverflow.com/questions/2075951/accessing-related-object-key-without-fetching-object-in-app-engine">this question</a> just a couple hours ago -- a Q almost identical by amazing coincidence by this one, though by a different poster.</p>
<p>In short, to do this, use the <code>ge... | 1 | 2010-01-16T05:09:13Z | [
"python",
"google-app-engine"
] |
Implementation limitations of float.as_integer_ratio() | 2,076,290 | <p>Recently, a correspondent mentioned <a href="http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex" rel="nofollow"><code>float.as_integer_ratio()</code></a>, new in Python 2.6, noting that typical floating point implementations are essentially rational approximations of real numbers. Intr... | 5 | 2010-01-16T05:19:10Z | 2,076,293 | <p>Go through the source repository for Python, find out who committed the code of interest, and send them off an email.</p>
| 1 | 2010-01-16T05:21:43Z | [
"python",
"math"
] |
Implementation limitations of float.as_integer_ratio() | 2,076,290 | <p>Recently, a correspondent mentioned <a href="http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex" rel="nofollow"><code>float.as_integer_ratio()</code></a>, new in Python 2.6, noting that typical floating point implementations are essentially rational approximations of real numbers. Intr... | 5 | 2010-01-16T05:19:10Z | 2,076,296 | <p>The algorithm used by <code>as_integer_ratio</code> only <a href="http://www.google.com/codesearch/p?hl=en#4BXx6j5BqI4/IronPython_Main/Src/IronPython/Runtime/Operations/FloatOps.cs&q=as_integer_ratio&sa=N&cd=2&ct=rc" rel="nofollow">considers powers of 2 in the denominator</a>. Here is a (probably) <a... | 4 | 2010-01-16T05:24:19Z | [
"python",
"math"
] |
Implementation limitations of float.as_integer_ratio() | 2,076,290 | <p>Recently, a correspondent mentioned <a href="http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex" rel="nofollow"><code>float.as_integer_ratio()</code></a>, new in Python 2.6, noting that typical floating point implementations are essentially rational approximations of real numbers. Intr... | 5 | 2010-01-16T05:19:10Z | 2,076,304 | <p>May I recommend <a href="http://code.google.com/p/gmpy/" rel="nofollow"><code>gmpy</code></a>'s implementation of the Stern-Brocot tree:</p>
<pre><code>>>> import gmpy
>>> import math
>>> gmpy.mpq(math.pi)
mpq(245850922,78256779)
>>> x=_
>>> float(x)
3.1415926535897931
&... | 3 | 2010-01-16T05:28:26Z | [
"python",
"math"
] |
Implementation limitations of float.as_integer_ratio() | 2,076,290 | <p>Recently, a correspondent mentioned <a href="http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex" rel="nofollow"><code>float.as_integer_ratio()</code></a>, new in Python 2.6, noting that typical floating point implementations are essentially rational approximations of real numbers. Intr... | 5 | 2010-01-16T05:19:10Z | 2,076,903 | <p>You get better approximations using</p>
<pre><code>fractions.Fraction.from_float(math.pi).limit_denominator()
</code></pre>
<p>Fractions are included since maybe version 3.0.
However, math.pi doesn't have enough accuracy to return a 30 digit approximation.</p>
| 2 | 2010-01-16T09:54:11Z | [
"python",
"math"
] |
Extract string from between quotations | 2,076,343 | <p>I want to extract information from user-inputted text. Imagine I input the following:</p>
<pre><code>SetVariables "a" "b" "c"
</code></pre>
<p>How would I extract information between the first set of quotations? Then the second? Then the third?</p>
| 13 | 2010-01-16T05:53:07Z | 2,076,356 | <pre><code>>>> import re
>>> re.findall('"([^"]*)"', 'SetVariables "a" "b" "c" ')
['a', 'b', 'c']
</code></pre>
| 16 | 2010-01-16T05:58:24Z | [
"python",
"string",
"extraction",
"quotations"
] |
Extract string from between quotations | 2,076,343 | <p>I want to extract information from user-inputted text. Imagine I input the following:</p>
<pre><code>SetVariables "a" "b" "c"
</code></pre>
<p>How would I extract information between the first set of quotations? Then the second? Then the third?</p>
| 13 | 2010-01-16T05:53:07Z | 2,076,357 | <p><a href="http://docs.python.org/library/re.html?highlight=re#module-re" rel="nofollow">Regular expressions</a> are good at this:</p>
<pre><code>import re
quoted = re.compile('"[^"]*"')
for value in quoted.findall(userInputtedText):
print value
</code></pre>
| 6 | 2010-01-16T05:58:28Z | [
"python",
"string",
"extraction",
"quotations"
] |
Extract string from between quotations | 2,076,343 | <p>I want to extract information from user-inputted text. Imagine I input the following:</p>
<pre><code>SetVariables "a" "b" "c"
</code></pre>
<p>How would I extract information between the first set of quotations? Then the second? Then the third?</p>
| 13 | 2010-01-16T05:53:07Z | 2,076,399 | <p>You could do a string.split() on it. If the string is formatted properly with the quotation marks (i.e. even number of quotation marks), every odd value in the list will contain an element that is between quotation marks. </p>
<pre><code>>>> s = 'SetVariables "a" "b" "c"';
>>> l = s.split('"')[1::... | 16 | 2010-01-16T06:16:45Z | [
"python",
"string",
"extraction",
"quotations"
] |
Simple modeling of existing SQL Server database schema in Python | 2,076,365 | <p>I'm looking to write a few small tools for managing table content for an existing SQL Server 2005 DB. I have a few dozen tables of reference content for an application that is deployed on many client databases (often for different schema versions) and I want to build a few python scripts to export, import, diff, and... | 1 | 2010-01-16T06:01:42Z | 2,076,372 | <p>Django has documentation on using it with <a href="http://docs.djangoproject.com/en/dev/howto/legacy-databases/#howto-legacy-databases" rel="nofollow">legacy databases</a>, but you will still have to handle things such as specifying relations yourself.</p>
| 0 | 2010-01-16T06:04:14Z | [
"python",
"sql-server",
"orm"
] |
Simple modeling of existing SQL Server database schema in Python | 2,076,365 | <p>I'm looking to write a few small tools for managing table content for an existing SQL Server 2005 DB. I have a few dozen tables of reference content for an application that is deployed on many client databases (often for different schema versions) and I want to build a few python scripts to export, import, diff, and... | 1 | 2010-01-16T06:01:42Z | 2,076,406 | <p>SqlAlchemy may actually help you . You can have a look here <a href="http://www.sqlalchemy.org/docs/05/ormtutorial.html" rel="nofollow">http://www.sqlalchemy.org/docs/05/ormtutorial.html</a></p>
| 1 | 2010-01-16T06:23:22Z | [
"python",
"sql-server",
"orm"
] |
Making an android Python service to run in suspend state | 2,076,381 | <p>Here's my Python script written using <a href="http://code.google.com/p/android-scripting/wiki/PythonAndroidAPI">android-scripting</a>:</p>
<pre><code>import android, time
droid = android.Android()
interval = 1 # every 1 minute
while True:
# define your own vibrate pattern here
droid.vibrate(200)
time... | 13 | 2010-01-16T06:08:11Z | 2,125,874 | <p>Possible solution: use some scheduler software and start your script regularly. This way you'll not need to call time.sleep().</p>
<p>Maybe scripting is not a best solution for such periodic tasks. You will not face this problem if you write a simple Java app.</p>
| -2 | 2010-01-24T03:57:51Z | [
"python",
"android",
"android-scripting"
] |
Making an android Python service to run in suspend state | 2,076,381 | <p>Here's my Python script written using <a href="http://code.google.com/p/android-scripting/wiki/PythonAndroidAPI">android-scripting</a>:</p>
<pre><code>import android, time
droid = android.Android()
interval = 1 # every 1 minute
while True:
# define your own vibrate pattern here
droid.vibrate(200)
time... | 13 | 2010-01-16T06:08:11Z | 2,136,577 | <p>I don't know much about Python binding, so I am going to answer as general Android issue. See <a href="http://pdk.android.com/online-pdk/guide/power_management.html" rel="nofollow">Power Management</a>.</p>
<p><code>PARTIAL_WAKE_LOCK</code> sounds interesting: "Wake lock that ensures that the CPU is running. The sc... | -1 | 2010-01-25T23:44:03Z | [
"python",
"android",
"android-scripting"
] |
Making an android Python service to run in suspend state | 2,076,381 | <p>Here's my Python script written using <a href="http://code.google.com/p/android-scripting/wiki/PythonAndroidAPI">android-scripting</a>:</p>
<pre><code>import android, time
droid = android.Android()
interval = 1 # every 1 minute
while True:
# define your own vibrate pattern here
droid.vibrate(200)
time... | 13 | 2010-01-16T06:08:11Z | 2,198,034 | <p>It's unlikely that this will work in ASE without support for the AlertManager. Your best bet is to file a feature request and wait for that. Or, if you're feeling ambitious, extend ASE yourself and submit a patch!</p>
| 1 | 2010-02-04T07:33:38Z | [
"python",
"android",
"android-scripting"
] |
Making an android Python service to run in suspend state | 2,076,381 | <p>Here's my Python script written using <a href="http://code.google.com/p/android-scripting/wiki/PythonAndroidAPI">android-scripting</a>:</p>
<pre><code>import android, time
droid = android.Android()
interval = 1 # every 1 minute
while True:
# define your own vibrate pattern here
droid.vibrate(200)
time... | 13 | 2010-01-16T06:08:11Z | 2,208,326 | <p>The scripting environment is definitely a second-class citizen. What you want is called the AlarmManager, using ELAPSED_REALTIME. If that's not available for the scripting environment, you're stuck.</p>
<p>The scripting environment is not, at least currently, intended to be a full replacement for the development ... | 10 | 2010-02-05T15:41:56Z | [
"python",
"android",
"android-scripting"
] |
Making an android Python service to run in suspend state | 2,076,381 | <p>Here's my Python script written using <a href="http://code.google.com/p/android-scripting/wiki/PythonAndroidAPI">android-scripting</a>:</p>
<pre><code>import android, time
droid = android.Android()
interval = 1 # every 1 minute
while True:
# define your own vibrate pattern here
droid.vibrate(200)
time... | 13 | 2010-01-16T06:08:11Z | 8,108,670 | <p>I am facing the same kind of problem.</p>
<p>time.sleep() is not reliable when your android device is in "locked" mode:</p>
<p>Here are a few things I've tried on SL4A release4 + pythonForAndroid_r5 + android 2.3.3 on samsung galaxy S</p>
<ul>
<li>wrap a time.sleep(interval) loop inside droid.wakeLockAcquirePart... | 2 | 2011-11-13T00:33:56Z | [
"python",
"android",
"android-scripting"
] |
Speeding up templates in GAE-Py by aggregating RPC calls | 2,076,470 | <p>Here's my problem: </p>
<pre><code>class City(Model):
name = StringProperty()
class Author(Model):
name = StringProperty()
city = ReferenceProperty(City)
class Post(Model):
author = ReferenceProperty(Author)
content = StringProperty()
</code></pre>
<p>The code isn't important... its this django templat... | 1 | 2010-01-16T06:52:31Z | 2,076,843 | <p>I have been in a similar situation. Instead of ReferenceProperty, I had parent/child relationships but the basics are the same. My current solution is not polished but at least it is efficient enough for reports and things with 200-1,000 entities, each with several subsequent child entities that require fetching.</p... | 1 | 2010-01-16T09:29:52Z | [
"python",
"google-app-engine",
"django-templates"
] |
Speeding up templates in GAE-Py by aggregating RPC calls | 2,076,470 | <p>Here's my problem: </p>
<pre><code>class City(Model):
name = StringProperty()
class Author(Model):
name = StringProperty()
city = ReferenceProperty(City)
class Post(Model):
author = ReferenceProperty(Author)
content = StringProperty()
</code></pre>
<p>The code isn't important... its this django templat... | 1 | 2010-01-16T06:52:31Z | 2,678,713 | <p>Here's some great examples of pre-fetching...</p>
<p><a href="http://blog.notdot.net/2010/01/ReferenceProperty-prefetching-in-App-Engine" rel="nofollow">http://blog.notdot.net/2010/01/ReferenceProperty-prefetching-in-App-Engine</a></p>
| 0 | 2010-04-20T21:18:08Z | [
"python",
"google-app-engine",
"django-templates"
] |
Import OPML subscriptions (file) to Google Reader manually | 2,076,488 | <p>I have a huge (5,000+ feeds) OPML file which freezes and crashes my browser when I try uploading it to my Google Reader account using the following instructions:</p>
<blockquote>
<ol>
<li>Login to Google Reader</li>
<li>Click Your Subscription</li>
<li>Click the More Actions dropdown</li>
<li>Select Impor... | 1 | 2010-01-16T07:00:13Z | 2,276,631 | <p>Found an answer on Superuser on <a href="http://superuser.com/questions/18044/how-to-import-an-opml-file-with-1500-feeds-into-google-reader">How to import an OPML file with 1500 feeds into Google Reader</a></p>
| 1 | 2010-02-16T21:51:19Z | [
"python",
"api",
"file-upload",
"google-reader",
"opml"
] |
How does wordpress password hash work? | 2,076,507 | <p>I need to integrate a Django system with a Wordpress site, as in wordpress users should be able to log in the DJnago part and vice versa,</p>
<p>For this I need to understand how the password hashing works in Wordpress. I can see the <code>wp_users</code> table which stores the username and password hashes.</p>
<p... | 4 | 2010-01-16T07:07:59Z | 2,076,586 | <p>There is a comment in the implementation saying:</p>
<pre><code> 28 /**
29 * Portable PHP password hashing framework.
30 *
31 * @package phpass
32 * @version 0.1 / genuine
33 * @link http://www.openwall.com/phpass/
34 * @since 2.5
35 */
</code></pre>
<p>The hashing framework used is <... | 7 | 2010-01-16T07:40:41Z | [
"php",
"python",
"django",
"wordpress"
] |
How does wordpress password hash work? | 2,076,507 | <p>I need to integrate a Django system with a Wordpress site, as in wordpress users should be able to log in the DJnago part and vice versa,</p>
<p>For this I need to understand how the password hashing works in Wordpress. I can see the <code>wp_users</code> table which stores the username and password hashes.</p>
<p... | 4 | 2010-01-16T07:07:59Z | 5,368,240 | <p>Just to add on, the following is a comment snippet from Wordpress 3.1's "\wp-includes\pluggable.php":</p>
<pre><code> /**
* For integration with other applications, this function can be overwritten to
* instead use the other package password checking algorithm.
*/
</code></pre>
| 2 | 2011-03-20T11:38:30Z | [
"php",
"python",
"django",
"wordpress"
] |
Finding the performance bottleneck in a Python and MySQL script | 2,076,582 | <p>I have a script with a main <code>for</code> loop that repeats about 15k times. In this loop it queries a local MySQL database and does a SVN update on a local repository. I placed the SVN repository in a RAMdisk as before most of the time seemed to be spent reading/writing to disk.</p>
<p>Now I have a script that ... | 2 | 2010-01-16T07:40:01Z | 2,076,590 | <p>Profile your Python code. That will show you how long each function/method call takes. If that's the method call querying the MySQL database, you'll have a clue where to look. But it also may be something else. In any case, profiling is the usual approach to solve such problems.</p>
| 1 | 2010-01-16T07:44:00Z | [
"python",
"mysql",
"performance",
"svn"
] |
Finding the performance bottleneck in a Python and MySQL script | 2,076,582 | <p>I have a script with a main <code>for</code> loop that repeats about 15k times. In this loop it queries a local MySQL database and does a SVN update on a local repository. I placed the SVN repository in a RAMdisk as before most of the time seemed to be spent reading/writing to disk.</p>
<p>Now I have a script that ... | 2 | 2010-01-16T07:40:01Z | 2,076,639 | <p>Doing SQL queries in a for loop 15k times is a bottleneck in every language.. </p>
<p>Is there any reason you query every time again ? If you do a single query before the for loop and then loop over the resultset and the SVN part, you will see a dramatic increase in speed.</p>
<p>But I doubt that you will get a hi... | 4 | 2010-01-16T08:03:41Z | [
"python",
"mysql",
"performance",
"svn"
] |
Finding the performance bottleneck in a Python and MySQL script | 2,076,582 | <p>I have a script with a main <code>for</code> loop that repeats about 15k times. In this loop it queries a local MySQL database and does a SVN update on a local repository. I placed the SVN repository in a RAMdisk as before most of the time seemed to be spent reading/writing to disk.</p>
<p>Now I have a script that ... | 2 | 2010-01-16T07:40:01Z | 2,077,129 | <p>It is "well known", so to speak, that <code>svn update</code> waits up to a whole second after it has finished running, so that file modification timestamps get "in the past" (since many filesystems don't have a timestamp granularity finer than one second). You can find more information about it by Googling for "svn... | 1 | 2010-01-16T11:16:13Z | [
"python",
"mysql",
"performance",
"svn"
] |
ds python import math module | 2,076,606 | <p>I'm trying to get some python code I've written earlier on Windows to work on my DS. I'm using (<a href="https://www.develer.com/trac/dspython/" rel="nofollow">DSPython</a>), and when I tried to import math, it failed with "ImportError: No module named math". I've gotten most all other modules I need that don't rely... | 3 | 2010-01-16T07:48:33Z | 4,622,665 | <p>Your best bet would be to wrap the NDS c library with pyrex, and create your own math module. The rest of dspython is.</p>
| 0 | 2011-01-07T05:04:29Z | [
"python",
"math",
"module",
"nintendo-ds"
] |
ds python import math module | 2,076,606 | <p>I'm trying to get some python code I've written earlier on Windows to work on my DS. I'm using (<a href="https://www.develer.com/trac/dspython/" rel="nofollow">DSPython</a>), and when I tried to import math, it failed with "ImportError: No module named math". I've gotten most all other modules I need that don't rely... | 3 | 2010-01-16T07:48:33Z | 5,134,846 | <p>Last month <a href="https://www.develer.com/trac/dspython/" rel="nofollow">dspython</a> has been given an overall project cleanup, and several issues, including the one you mention, were addressed in the process.</p>
<p>If you're still interested in running that Python code in your DS, this is a good time to try ag... | 1 | 2011-02-27T17:57:58Z | [
"python",
"math",
"module",
"nintendo-ds"
] |
Django: Chicken or Egg question | 2,076,678 | <p>I am building an application that will send an API call and save the resulting information after processing the information in a <code>APIRecord(models.Model)</code> class.</p>
<p><strong>1)</strong> Should I build a separate class in such a way that the class does the API call, processes the information (including... | 3 | 2010-01-16T08:19:04Z | 2,078,384 | <p>it is design decision.
it depends to your design and programming interests.
i used the combination of three methods you said. if i need to some informations that can be build from other fields then i will create an internal function in model class. if i need other records of database to do something i will create an... | 1 | 2010-01-16T18:08:40Z | [
"python",
"django",
"design-patterns",
"application-design"
] |
Python os.stat and unicode file names | 2,076,708 | <p>In my Django application, a user has uploaded a file with a unicode character in the name.</p>
<p>When I'm downloading files, I'm calling :</p>
<pre><code>os.path.exists(media)
</code></pre>
<p>to test that the file is there. This, in turn, seems to call</p>
<pre><code>st = os.stat(path)
</code></pre>
<p>Which ... | 11 | 2010-01-16T08:30:46Z | 2,076,721 | <p>Encode to the filesystem encoding before calling. See the <code>locale</code> module.</p>
| 1 | 2010-01-16T08:35:11Z | [
"python",
"unicode",
"operating-system"
] |
Python os.stat and unicode file names | 2,076,708 | <p>In my Django application, a user has uploaded a file with a unicode character in the name.</p>
<p>When I'm downloading files, I'm calling :</p>
<pre><code>os.path.exists(media)
</code></pre>
<p>to test that the file is there. This, in turn, seems to call</p>
<pre><code>st = os.stat(path)
</code></pre>
<p>Which ... | 11 | 2010-01-16T08:30:46Z | 2,076,884 | <p>I'm assuming you're in Unix. If not, please remember to say which OS you're in.</p>
<p>Make sure your locale is set to UTF-8. All modern Linux systems do this by default, usually by setting the environment variable LANG to "en_US.UTF-8", or another language. Also, make sure your filenames are encoded in UTF-8.</... | 7 | 2010-01-16T09:42:43Z | [
"python",
"unicode",
"operating-system"
] |
Python os.stat and unicode file names | 2,076,708 | <p>In my Django application, a user has uploaded a file with a unicode character in the name.</p>
<p>When I'm downloading files, I'm calling :</p>
<pre><code>os.path.exists(media)
</code></pre>
<p>to test that the file is there. This, in turn, seems to call</p>
<pre><code>st = os.stat(path)
</code></pre>
<p>Which ... | 11 | 2010-01-16T08:30:46Z | 32,262,821 | <p>Change your http server to use UTF-8 locale. For example, I use apache2 on CentOS. I changed <em>/etc/sysconfig/httpd</em> locale setting by HTTPD_LANG:</p>
<pre><code># CentOS use /etc/sysconfig/httpd to config environment variables.
#
# By default, the httpd process is started in the C locale; to
# change the loc... | 0 | 2015-08-28T03:20:09Z | [
"python",
"unicode",
"operating-system"
] |
Python os.stat and unicode file names | 2,076,708 | <p>In my Django application, a user has uploaded a file with a unicode character in the name.</p>
<p>When I'm downloading files, I'm calling :</p>
<pre><code>os.path.exists(media)
</code></pre>
<p>to test that the file is there. This, in turn, seems to call</p>
<pre><code>st = os.stat(path)
</code></pre>
<p>Which ... | 11 | 2010-01-16T08:30:46Z | 39,558,275 | <p>None of these solutions worked for me. However, I did find the solution. There is yet another place in Apache settings where one has to add the locale setting if one uses WSGI. <a href="https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/modwsgi/" rel="nofollow">Official docs are here</a>. Add the following... | 0 | 2016-09-18T13:43:38Z | [
"python",
"unicode",
"operating-system"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,076,898 | <p>I'd rethink the problem itself... You don't seem to be doing anything sequential with the numbers... and you've got an index on the column which has them. Do they actually <strong>need</strong> to be <strong>numbers</strong>?</p>
<p>Consider a sha hash... you don't actually need the entire thing. Do what git or oth... | 0 | 2010-01-16T09:51:22Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,076,937 | <p>With some modular arithmic and prime numbers, you can create all numbers between 0 and a big prime, out of order. <strike>If you choose your numbers carefully, the next number is hard to guess.</strike></p>
<pre><code>modulo = 87178291199 # prime
incrementor = 17180131327 # relative prime
current = 433494437 # som... | 9 | 2010-01-16T10:07:57Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,076,977 | <p>You are stating that you store the numbers in a database.</p>
<p>Wouldn't it then be easier to store all the numbers there, and ask the database for a random unused number?
Most databases support such a request.</p>
<p>Examples</p>
<p>MySQL:</p>
<pre><code>SELECT column FROM table
ORDER BY RAND()
LIMIT 1
</code>... | -2 | 2010-01-16T10:26:54Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,076,998 | <p>If they don't have to be random, but just not obviously linear (1, 2, 3, 4, ...), then here's a simple algorithm:</p>
<p>Pick two prime numbers. One of them will be the largest number you can generate, so it should be around one billion. The other should be fairly large.</p>
<pre><code>max_value = 795028841
step... | 6 | 2010-01-16T10:35:13Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,077,000 | <p>Do you need this to be cryptographically secure or just hard to guess? How bad are collisions? Because if it needs to be cryptographically strong and have zero collisions, it is, sadly, impossible.</p>
| 0 | 2010-01-16T10:35:44Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,077,036 | <p>This is a neat problem, and I've been thinking about it for a while (with solutions similar to <a href="http://stackoverflow.com/questions/2076838/generating-non-repeating-random-numbers-in-python/2076937#2076937">Sjoerd's</a>), but in the end, here's what I think:</p>
<p>Use your point 1) and stop worrying.</p>
<... | 25 | 2010-01-16T10:45:42Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,077,264 | <p>You could use <a href="http://en.wikipedia.org/wiki/Format-Preserving_Encryption" rel="nofollow">Format-Preserving Encryption</a> to encrypt a counter. Your counter just goes from 0 upwards, and the encryption uses a key of your choice to turn it into a seemingly random value of whatever radix and width you want.</p... | 11 | 2010-01-16T12:10:10Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,077,313 | <p>I think you are overestimating the problems with approach 1). Unless you have hard-realtime requirements just checking by random choice terminates rather fast. The probability of needing more than a number of iterations decays exponentially. With 100M numbers outputted (10% fillfactor) you'll have one in billion cha... | 5 | 2010-01-16T12:26:55Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,077,409 | <p>The standard Linear Congruential random number generator's seed sequence CANNOT repeat until the full set of numbers from the starting seed value have been generated. Then it MUST repeat precisely. </p>
<p>The internal seed is often large (48 or 64 bits). The generated numbers are smaller (32 bits usually) becau... | 4 | 2010-01-16T13:09:50Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,078,401 | <p>I started trying to write an explanation of the approach used below, but just implementing it was easier and more accurate. This approach has the odd behavior that it gets faster the more numbers you've generated. But it works, and it doesn't require you to generate all the numbers in advance. </p>
<p>As a simpl... | 0 | 2010-01-16T18:14:16Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,079,589 | <p>If you don't need something cryptographically secure, but just "sufficiently obfuscated"...</p>
<p><strong>Galois Fields</strong></p>
<p>You could try operations in <a href="http://en.wikipedia.org/wiki/Finite_field">Galois Fields</a>, e.g. GF(2)<sup>32</sup>, to map a simple incrementing counter <em>x</em> to a s... | 6 | 2010-01-17T01:04:53Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 2,083,392 | <p>You can run 1) without running into the problem of too many wrong random numbers if you just decrease the random interval by one each time.</p>
<p>For this method to work, you will need to save the numbers already given (which you want to do anyway) and also save the quantity of numbers taken.</p>
<p>It is pretty ... | 1 | 2010-01-18T01:18:16Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 8,443,747 | <p>If it is enough for you that a casual observer can't guess the next value, you can use things like a <a href="http://en.wikipedia.org/wiki/Linear_congruential_generator" rel="nofollow">linear congruential generator</a> or even a simple <a href="http://en.wikipedia.org/wiki/Linear_feedback_shift_register" rel="nofoll... | 0 | 2011-12-09T09:52:28Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 12,109,014 | <p>Bit late answer, but I haven't seen this suggested anywhere.</p>
<p>Why not use the <a href="http://docs.python.org/library/uuid.html" rel="nofollow">uuid</a> module to create <a href="https://en.wikipedia.org/wiki/Guid" rel="nofollow">globally unique identifiers</a></p>
| 0 | 2012-08-24T11:58:31Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 12,135,030 | <p>My solution <a href="https://github.com/glushchenko/python-unique-id" rel="nofollow">https://github.com/glushchenko/python-unique-id</a>, i think you should extend matrix for 1,000,000,000 variations and have fun.</p>
| 1 | 2012-08-27T00:26:24Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 23,973,412 | <p>To generate a list of totally random numbers within a defined threshold, as follows:</p>
<pre><code>plist=list()
length_of_list=100
upbound=1000
lowbound=0
while len(pList)<(length_of_list):
pList.append(rnd.randint(lowbound,upbound))
pList=list(set(pList))
</code></pre>
| 0 | 2014-05-31T17:57:05Z | [
"python",
"random",
"numbers"
] |
Generating non-repeating random numbers in Python | 2,076,838 | <p>Ok this is one of those trickier than it sounds questions so I'm turning to stack overflow because I can't think of a good answer. Here is what I want: I need Python to generate a simple a list of numbers from 0 to 1,000,000,000 in random order to be used for serial numbers (using a random number so that you can't t... | 39 | 2010-01-16T09:27:22Z | 30,079,975 | <p>I bumped into the same problem and opened a <a href="http://stackoverflow.com/q/30063624/694360">question with a different title</a> before getting to this one. <a href="http://stackoverflow.com/a/30063866/694360">My solution</a> is a random sample generator of indexes (i.e. non-repeating numbers) in the interval <c... | 0 | 2015-05-06T14:40:42Z | [
"python",
"random",
"numbers"
] |
GAE: Making many queries into one | 2,077,034 | <p>I have a productpart database containing a string property named 'type'.
What I'm trying to do is to get all products by a given type (sometimes more then one type).</p>
<p>I've tried to use GAE filter method but can't get it to work properly.</p>
<p>The only solution I've got working is to make a new db.GqlQuery... | 1 | 2010-01-16T10:45:30Z | 2,077,462 | <p>You can use the IN operator. It would create the three different queries and group the results together for you under the scenes. See the <a href="http://code.google.com/appengine/docs/python/datastore/gqlreference.html" rel="nofollow">docs</a>:</p>
<blockquote>
<p>GQL does not have an OR operator.
However, it ... | 2 | 2010-01-16T13:33:31Z | [
"python",
"google-app-engine",
"gae-datastore"
] |
Escape special HTML characters in Python | 2,077,283 | <p>I have a string where special characters like <code>'</code> or <code>"</code> or <code>&</code> (...) can appear. In the string:</p>
<pre><code>string = " Hello "XYZ" this 'is' a test & so on "
</code></pre>
<p>how can I automatically escape every special character, so that I get this:</p>
<pre><code>str... | 11 | 2010-01-16T12:18:33Z | 2,077,321 | <p>In Python 3.2, you could use the <a href="http://docs.python.org/3/library/html.html#html.escape"><code>html.escape</code> function</a>, e.g.</p>
<pre><code>>>> string = """ Hello "XYZ" this 'is' a test & so on """
>>> import html
>>> html.escape(string)
' Hello &quot;XYZ&quot... | 23 | 2010-01-16T12:30:29Z | [
"python"
] |
Escape special HTML characters in Python | 2,077,283 | <p>I have a string where special characters like <code>'</code> or <code>"</code> or <code>&</code> (...) can appear. In the string:</p>
<pre><code>string = " Hello "XYZ" this 'is' a test & so on "
</code></pre>
<p>how can I automatically escape every special character, so that I get this:</p>
<pre><code>str... | 11 | 2010-01-16T12:18:33Z | 2,077,332 | <p>The <a href="http://docs.python.org/library/cgi.html#functions" rel="nofollow">cgi.escape</a> method will convert special charecters to valid html tags</p>
<pre><code> import cgi
original_string = 'Hello "XYZ" this \'is\' a test & so on '
escaped_string = cgi.escape(original_string, True)
print original_stri... | 4 | 2010-01-16T12:34:34Z | [
"python"
] |
Escape special HTML characters in Python | 2,077,283 | <p>I have a string where special characters like <code>'</code> or <code>"</code> or <code>&</code> (...) can appear. In the string:</p>
<pre><code>string = " Hello "XYZ" this 'is' a test & so on "
</code></pre>
<p>how can I automatically escape every special character, so that I get this:</p>
<pre><code>str... | 11 | 2010-01-16T12:18:33Z | 2,077,410 | <p>A simple string function will do it:</p>
<pre><code>def escape(t):
"""HTML-escape the text in `t`."""
return (t
.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
.replace("'", "&#39;").replace('"', "&quot;")
)
</code></pre>
<p>Other answe... | 2 | 2010-01-16T13:10:04Z | [
"python"
] |
Escape special HTML characters in Python | 2,077,283 | <p>I have a string where special characters like <code>'</code> or <code>"</code> or <code>&</code> (...) can appear. In the string:</p>
<pre><code>string = " Hello "XYZ" this 'is' a test & so on "
</code></pre>
<p>how can I automatically escape every special character, so that I get this:</p>
<pre><code>str... | 11 | 2010-01-16T12:18:33Z | 24,373,701 | <p>The other answers here will help with such as the characters you listed and a few others. However, if you also want to convert everything else to entity names, too, you'll have to do something else. For instance, if <code>á</code> needs to be converted to <code>&aacute;</code>, neither <code>cgi.escape</code> n... | 0 | 2014-06-23T19:20:41Z | [
"python"
] |
Python deque performance for small iterables | 2,077,379 | <p>I was playing around with Python's collection.deque and wrote the following benchmark:</p>
<pre><code>#!/usr/bin/python
import timeit
if __name__=='__main__':
number = 1000000
for r in (1,10,100,1000,5000,10000,100000):
print r
print timeit.timeit("while x: x.pop(0);",
... | 1 | 2010-01-16T12:50:22Z | 2,077,393 | <p><strike>For low numbers of elements, the time taken to construct the deque and list is significant.</p>
<p>Once the number f elements grows, this it's no longer significant in the results.</p>
<p>Rewrite the test so that construction of lists is outside of the timeit call.</strike></p>
<p>Edit: As @Interjar point... | 2 | 2010-01-16T12:58:59Z | [
"python",
"performance",
"deque"
] |
Python deque performance for small iterables | 2,077,379 | <p>I was playing around with Python's collection.deque and wrote the following benchmark:</p>
<pre><code>#!/usr/bin/python
import timeit
if __name__=='__main__':
number = 1000000
for r in (1,10,100,1000,5000,10000,100000):
print r
print timeit.timeit("while x: x.pop(0);",
... | 1 | 2010-01-16T12:50:22Z | 2,077,501 | <p>The timeit module runs the setup code once, and then the timed code <code>number</code> times (in this case, <code>number</code>==1000000). In your case this looks like (for the list case):</p>
<pre><code>x = list(range(r))
#timer is started here
for iteration in xrange(1000000):
while x: x.pop(0)
#timer is sto... | 4 | 2010-01-16T13:49:21Z | [
"python",
"performance",
"deque"
] |
Python deque performance for small iterables | 2,077,379 | <p>I was playing around with Python's collection.deque and wrote the following benchmark:</p>
<pre><code>#!/usr/bin/python
import timeit
if __name__=='__main__':
number = 1000000
for r in (1,10,100,1000,5000,10000,100000):
print r
print timeit.timeit("while x: x.pop(0);",
... | 1 | 2010-01-16T12:50:22Z | 2,077,995 | <p>I always find <code>timeit</code> more suitable for use from the shell command line. Here, for example:</p>
<pre><code>$ python -mtimeit -s'from collections import deque; base=range(100); ctr=list' 'x=ctr(base)' 'while x: x.pop(0)'
10000 loops, best of 3: 77.3 usec per loop
$ python -mtimeit -s'from collections imp... | 3 | 2010-01-16T16:08:06Z | [
"python",
"performance",
"deque"
] |
DB a table for the category and another table for the subcategory with similar fields, why? | 2,077,522 | <p>I recently joined a new company and the development team was in the progress of a project to rebuild the database categories structure as follows:</p>
<p>if we have category and subcategory for items, like food category and italian food category in food category.
They were building a table for each category, instea... | 2 | 2010-01-16T13:58:20Z | 2,077,536 | <p>First, the most obvious answer is that you should ask <em>them</em>, not <em>us</em>, since I can tell you this, that design seems bogus deluxe.</p>
<p>The only reason I can come up with is that you have inexperienced DBA's that does not know how to performance-tune a database, and seems to think that a table with ... | 2 | 2010-01-16T14:03:15Z | [
"python",
"mysql",
"database",
"django",
"performance"
] |
DB a table for the category and another table for the subcategory with similar fields, why? | 2,077,522 | <p>I recently joined a new company and the development team was in the progress of a project to rebuild the database categories structure as follows:</p>
<p>if we have category and subcategory for items, like food category and italian food category in food category.
They were building a table for each category, instea... | 2 | 2010-01-16T13:58:20Z | 2,077,556 | <p>There are more than one way to do anything.</p>
<p>The possible benefit I see in doing the food, food_italian... is that it allows for <a href="http://dev.mysql.com/tech-resources/articles/mysql_5.1_partitions.html" rel="nofollow">table partitioning</a>. Using many different tables allow for better table locking m... | 0 | 2010-01-16T14:13:20Z | [
"python",
"mysql",
"database",
"django",
"performance"
] |
How to load a C# dll in python? | 2,077,870 | <p>how can I load a c# dll in python?</p>
<p>Do I have to put some extra code in the c# files? (like export in c++ files)</p>
<p>I don't want to use IronPython. I want to import a module to Python!</p>
| 10 | 2010-01-16T15:38:22Z | 2,077,878 | <p>This is to answer the second part of your Question
Try making the DLL COM visible.</p>
<p>by using the </p>
<pre><code>[ComVisible(true)]
</code></pre>
<p>Ok IronPython is a .net implemenatation of the Python language
The technology is going to use the DLR of the .net 4.0 when it arrives so IronPython will hav... | 3 | 2010-01-16T15:40:57Z | [
"c#",
"python",
".net",
"cpython",
"python.net"
] |
How to load a C# dll in python? | 2,077,870 | <p>how can I load a c# dll in python?</p>
<p>Do I have to put some extra code in the c# files? (like export in c++ files)</p>
<p>I don't want to use IronPython. I want to import a module to Python!</p>
| 10 | 2010-01-16T15:38:22Z | 17,734,725 | <p><a href="http://pythonnet.sourceforge.net/" rel="nofollow"><em>Python for .NET</em></a> works well if you don't want to use IronPython.</p>
| 3 | 2013-07-18T22:02:13Z | [
"c#",
"python",
".net",
"cpython",
"python.net"
] |
How to load a C# dll in python? | 2,077,870 | <p>how can I load a c# dll in python?</p>
<p>Do I have to put some extra code in the c# files? (like export in c++ files)</p>
<p>I don't want to use IronPython. I want to import a module to Python!</p>
| 10 | 2010-01-16T15:38:22Z | 20,263,498 | <p>The package <a href="http://pythonnet.sourceforge.net/" rel="nofollow">Python for.NET</a> and the Python Implementation <a href="http://ironpython.net/" rel="nofollow">IronPython</a> now work the same way. </p>
<p>Example for a C# DLL <code>MyDll.dll</code>:</p>
<pre><code>import clr
clr.AddReference('MyDll')
from... | 11 | 2013-11-28T10:26:47Z | [
"c#",
"python",
".net",
"cpython",
"python.net"
] |
'proper' & reliable way to get all installed windows programs in Python? | 2,077,902 | <p>I've seen numerous ways of retrieving installed programs on WinXP+ in python. What is the <em>proper</em> and <em>most robust</em> way of doing this?</p>
<p>Currently I'm accessing <code>HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall</code> and reading each of the keys from there to get a list. (I'... | 7 | 2010-01-16T15:45:11Z | 2,081,549 | <p>The technet script you refer to perfectly works under Win 7 (with Python 2.5 32bits), and I really cannot see why it shouldn't.</p>
<p>Actually, the real weakness of the WMI approach is that it only lists products installed through the Windows Installer. So it's will not give you the full list. Many programs use di... | 7 | 2010-01-17T15:56:19Z | [
"python",
"windows",
"registry",
"wmi",
"win32com"
] |
'proper' & reliable way to get all installed windows programs in Python? | 2,077,902 | <p>I've seen numerous ways of retrieving installed programs on WinXP+ in python. What is the <em>proper</em> and <em>most robust</em> way of doing this?</p>
<p>Currently I'm accessing <code>HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall</code> and reading each of the keys from there to get a list. (I'... | 7 | 2010-01-16T15:45:11Z | 28,569,573 | <p>WMI is the correct way to look for installed programs as it will work across different versions of the OS and will be supported going forward. Looking for specific regkeys may work fine for specific versions of Windows but is not guaranteed to work in the future. Here is some simple python code to check for Box Sync... | 1 | 2015-02-17T19:28:58Z | [
"python",
"windows",
"registry",
"wmi",
"win32com"
] |
New field in Django model doesn't show up in admin interface or model forms | 2,077,977 | <p>I've created a model in one of my apps which works fine. However, I needed to add a new field. I did this, and used <code>manage.py reset <appname></code> to drop the tables and add them again. This process went fine - the new field appears in the database. However, I can't get the field to show up in the admi... | 3 | 2010-01-16T16:03:13Z | 2,077,989 | <p>By any chance, did you forget to update your <a href="http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-objects" rel="nofollow">ModelAdmin</a> definitions?</p>
| 1 | 2010-01-16T16:06:33Z | [
"python",
"django",
"django-models",
"django-admin"
] |
New field in Django model doesn't show up in admin interface or model forms | 2,077,977 | <p>I've created a model in one of my apps which works fine. However, I needed to add a new field. I did this, and used <code>manage.py reset <appname></code> to drop the tables and add them again. This process went fine - the new field appears in the database. However, I can't get the field to show up in the admi... | 3 | 2010-01-16T16:03:13Z | 2,078,134 | <p>Have you restarted your server?</p>
| 5 | 2010-01-16T16:44:46Z | [
"python",
"django",
"django-models",
"django-admin"
] |
Python/Django shell won't start | 2,078,059 | <p>One of the great features of Django is that you can open a python interpreter set-up for use with your project. This can be used to analyse objects in a database and allows any python commands to be executed on your project. I find it essential for Django development. It is invoked in the project directory using thi... | 5 | 2010-01-16T16:23:44Z | 2,078,129 | <p>It seems like IPython is installed wrongly somehow. Try starting the shell with:</p>
<pre><code>./manage.py shell --plain
</code></pre>
<p>to start the standard Python shell, rather than IPython. If that works, then trying removing IPython completely and reinstalling it.</p>
| 11 | 2010-01-16T16:43:08Z | [
"python",
"django",
"shell"
] |
Python/Django shell won't start | 2,078,059 | <p>One of the great features of Django is that you can open a python interpreter set-up for use with your project. This can be used to analyse objects in a database and allows any python commands to be executed on your project. I find it essential for Django development. It is invoked in the project directory using thi... | 5 | 2010-01-16T16:23:44Z | 7,712,111 | <p>IPython 0.11 has a different API, for which a fix exists in the last Django versions.</p>
<p>For older Django versions, you can use IPython 0.10, which does work:</p>
<pre><code>pip install ipython==0.10
</code></pre>
| 6 | 2011-10-10T11:28:54Z | [
"python",
"django",
"shell"
] |
static file with mod_wsgi in django | 2,078,160 | <p>I've searched a lot but I still have a problem with the static files (css, image,...) with my django website.</p>
<p>I'm using mod_wsgi with apache on archlinux 64bits</p>
<p>I've added it in my http.conf : </p>
<pre><code>LoadModule wsgi_module modules/mod_wsgi.so
<VirtualHost *:80>
WSGIDaemonProcess ... | 6 | 2010-01-16T16:52:55Z | 2,079,085 | <p>This seems to be what I have for my application except that I didn't see the <code>NameVirtualHost</code> directive in the http.conf which is required if you want to setup virtual servers. You can try adding <code>NameVirtualHost *:80</code> before the virtual host definition.</p>
| 0 | 2010-01-16T22:14:57Z | [
"python",
"django",
"apache",
"mod-wsgi"
] |
static file with mod_wsgi in django | 2,078,160 | <p>I've searched a lot but I still have a problem with the static files (css, image,...) with my django website.</p>
<p>I'm using mod_wsgi with apache on archlinux 64bits</p>
<p>I've added it in my http.conf : </p>
<pre><code>LoadModule wsgi_module modules/mod_wsgi.so
<VirtualHost *:80>
WSGIDaemonProcess ... | 6 | 2010-01-16T16:52:55Z | 2,079,216 | <p>Your <code>django.wsgi</code> file,</p>
<pre><code>WSGIScriptAlias / /srv/http/wsgi-scripts/django.wsgi
</code></pre>
<p>is outside of the <code><Directory></code> defined by:</p>
<pre><code><Directory /home/mart/programmation/python/django/martfiles/>
</code></pre>
<p>Try adding this to <code>httpd.... | 3 | 2010-01-16T22:54:46Z | [
"python",
"django",
"apache",
"mod-wsgi"
] |
static file with mod_wsgi in django | 2,078,160 | <p>I've searched a lot but I still have a problem with the static files (css, image,...) with my django website.</p>
<p>I'm using mod_wsgi with apache on archlinux 64bits</p>
<p>I've added it in my http.conf : </p>
<pre><code>LoadModule wsgi_module modules/mod_wsgi.so
<VirtualHost *:80>
WSGIDaemonProcess ... | 6 | 2010-01-16T16:52:55Z | 2,080,001 | <p>It is not sufficient for just the directory '/home/mart/programmation/python/django/martfiles/media' containing static files to be readable and searchable. The user that Apache runs as must have read and potentially search access, to all parent directories of it back up to root directory. Since home directories on m... | 7 | 2010-01-17T04:55:18Z | [
"python",
"django",
"apache",
"mod-wsgi"
] |
Python class that inherits from itself? How does this work? | 2,078,634 | <p>Relatively new to Python, and I saw the following construct in the PyFacebook library (source here: <a href="http://github.com/sciyoshi/pyfacebook/blob/master/facebook/__init__.py#L660" rel="nofollow">http://github.com/sciyoshi/pyfacebook/blob/master/facebook/<strong>init</strong>.py#L660</a>). I'm curious what thi... | 3 | 2010-01-16T19:19:31Z | 2,078,640 | <p>It's using the AuthProxy imported from a different module (check your imports) and deriving from it.</p>
| 3 | 2010-01-16T19:20:51Z | [
"python",
"eclipse",
"facebook"
] |
Python class that inherits from itself? How does this work? | 2,078,634 | <p>Relatively new to Python, and I saw the following construct in the PyFacebook library (source here: <a href="http://github.com/sciyoshi/pyfacebook/blob/master/facebook/__init__.py#L660" rel="nofollow">http://github.com/sciyoshi/pyfacebook/blob/master/facebook/<strong>init</strong>.py#L660</a>). I'm curious what thi... | 3 | 2010-01-16T19:19:31Z | 2,078,650 | <p>The class statement there doesn't make the class inherit from itself, it creates a class object with the current value of AuthProxy as a superclass, and then assigns the class object to the variable 'AuthProxy', presumably overwriting the previously assigned AuthProxy that it inherited from.</p>
<p>Essentially, it'... | 11 | 2010-01-16T19:24:53Z | [
"python",
"eclipse",
"facebook"
] |
Python class that inherits from itself? How does this work? | 2,078,634 | <p>Relatively new to Python, and I saw the following construct in the PyFacebook library (source here: <a href="http://github.com/sciyoshi/pyfacebook/blob/master/facebook/__init__.py#L660" rel="nofollow">http://github.com/sciyoshi/pyfacebook/blob/master/facebook/<strong>init</strong>.py#L660</a>). I'm curious what thi... | 3 | 2010-01-16T19:19:31Z | 2,078,666 | <p>The "former" AuthProxy is created by <code>__generate_proxies</code> (it's not very nice code, there is even an <code>exec</code> and <code>eval</code> in it :)), but the author wanted also define some methods on top of it.</p>
| 3 | 2010-01-16T19:31:35Z | [
"python",
"eclipse",
"facebook"
] |
Python class that inherits from itself? How does this work? | 2,078,634 | <p>Relatively new to Python, and I saw the following construct in the PyFacebook library (source here: <a href="http://github.com/sciyoshi/pyfacebook/blob/master/facebook/__init__.py#L660" rel="nofollow">http://github.com/sciyoshi/pyfacebook/blob/master/facebook/<strong>init</strong>.py#L660</a>). I'm curious what thi... | 3 | 2010-01-16T19:19:31Z | 4,589,099 | <p>To make Eclipse stop whining about it, do this:</p>
<p>class AuthProxy(AuthProxy): #@UndefinedVariable</p>
| 1 | 2011-01-03T22:41:11Z | [
"python",
"eclipse",
"facebook"
] |
generating a binary tree from given data in python | 2,078,669 | <p>i wanted to know how to read values from a list into a binary tree.
i have a triangle like this:</p>
<pre><code> 0
1 2
3 4 5
6 7 8 9
</code></pre>
<p>i have written a class node like this</p>
<pre><code>class node:
def __init__(self,data,left=None,right=None):
self.d... | 3 | 2010-01-16T19:32:13Z | 2,078,709 | <p>This does sound like homework, so I won't write code, but here are a couple of hints:</p>
<ol>
<li><p>This could be done even if your triangle were written as a list, like
<code>0 1 2 3 4 5 6 7 8 9</code></p></li>
<li><p>Because it seems like this is a full binary tree (assuming your triangle is wrong and the thir... | 1 | 2010-01-16T19:48:44Z | [
"python",
"binary-tree"
] |
generating a binary tree from given data in python | 2,078,669 | <p>i wanted to know how to read values from a list into a binary tree.
i have a triangle like this:</p>
<pre><code> 0
1 2
3 4 5
6 7 8 9
</code></pre>
<p>i have written a class node like this</p>
<pre><code>class node:
def __init__(self,data,left=None,right=None):
self.d... | 3 | 2010-01-16T19:32:13Z | 2,078,765 | <p>For such list:</p>
<pre><code>a = 'aBCdef'
</code></pre>
<p>The program below generates the following structure:</p>
<pre><code>- a -
- B C
B C -
- d e
d e f
e f -
</code></pre>
<p>Code (input list is assumed to correspond to a 'complete' triangular):</p>
<pre><code>class Node:
def __init__(self,data,left=N... | 0 | 2010-01-16T20:11:15Z | [
"python",
"binary-tree"
] |
GAE Simple Searching + Autocomplete | 2,078,738 | <p>I'm looking to create a search function for my flash game website.</p>
<p>One of the problems with the site is that it is difficult to find a specific game you want, as users must go to the alphabetical list to find one they want.</p>
<p>It's run with Google App Engine written in python, using the webapp framework... | 1 | 2010-01-16T20:00:37Z | 2,078,792 | <p>Have you looked at <a href="http://gae-full-text-search.appspot.com/" rel="nofollow">gae-search</a>? I believe the Django + jQuery "autocomplete" feature is not part of the free version (it's just in the for-pay premium version), but maybe it's worth a little money to you.</p>
| 0 | 2010-01-16T20:21:37Z | [
"python",
"google-app-engine"
] |
GAE Simple Searching + Autocomplete | 2,078,738 | <p>I'm looking to create a search function for my flash game website.</p>
<p>One of the problems with the site is that it is difficult to find a specific game you want, as users must go to the alphabetical list to find one they want.</p>
<p>It's run with Google App Engine written in python, using the webapp framework... | 1 | 2010-01-16T20:00:37Z | 2,078,830 | <p>I have written the code below to handle this. Basically, I save all the possible word "starts" in a list instead of whole sentences. That's how the jquery autocomplete of <a href="http://www.toape.com.br" rel="nofollow">this site</a> works.</p>
<pre><code>import unicodedata
import re
splitter = re.compile(r'[\s|\-... | 5 | 2010-01-16T20:34:40Z | [
"python",
"google-app-engine"
] |
Passing options to Python executable in non-interactive mode | 2,078,752 | <p>I would like to pass some options to Python (version 2.6) every time, not just in interactive mode. Is there a file I can put such commands in?</p>
<p>EDIT: Specifically, I'm wanting to silence the Deprecation warnings.</p>
| 2 | 2010-01-16T20:06:17Z | 2,078,762 | <p>Have you tried <code>~/.pythonrc.py?</code> It is listed in the Python man page with the following description:</p>
<blockquote>
<p>User-specific initialization file
loaded by the user module; not used by
default or by most applications.</p>
</blockquote>
<p>I'm not sure what it means by the 'user' module bu... | 0 | 2010-01-16T20:10:17Z | [
"python"
] |
Passing options to Python executable in non-interactive mode | 2,078,752 | <p>I would like to pass some options to Python (version 2.6) every time, not just in interactive mode. Is there a file I can put such commands in?</p>
<p>EDIT: Specifically, I'm wanting to silence the Deprecation warnings.</p>
| 2 | 2010-01-16T20:06:17Z | 2,078,777 | <p>Most of the options can be passed in as environment variables -- do <code>python -h</code> to see the list:</p>
<pre><code>$ py26 -h|grep PYTH
-B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x
-d : debug output from parser; also PYTHONDEBUG=x
-E : ignore PYTHON* environment variab... | 3 | 2010-01-16T20:15:03Z | [
"python"
] |
Passing options to Python executable in non-interactive mode | 2,078,752 | <p>I would like to pass some options to Python (version 2.6) every time, not just in interactive mode. Is there a file I can put such commands in?</p>
<p>EDIT: Specifically, I'm wanting to silence the Deprecation warnings.</p>
| 2 | 2010-01-16T20:06:17Z | 2,079,332 | <p>I'm sorry, I don't quite understand exactly what your question is, but, you might try:</p>
<pre><code>import warnings
warnings.simplefilter("ignore", DeprecationWarning)
</code></pre>
<p>So, this might not really answer the question.</p>
| 2 | 2010-01-16T23:21:45Z | [
"python"
] |
Passing options to Python executable in non-interactive mode | 2,078,752 | <p>I would like to pass some options to Python (version 2.6) every time, not just in interactive mode. Is there a file I can put such commands in?</p>
<p>EDIT: Specifically, I'm wanting to silence the Deprecation warnings.</p>
| 2 | 2010-01-16T20:06:17Z | 2,079,527 | <p>The <code>#!/usr/bin/python</code> line at the beginning of a Python script under Linux can be used to also pass options to the interpreter.</p>
<p>There are also a number of modules imported whenever Python starts up. On my system, a likely candidate for modification to set options in the manner suggested by othe... | 5 | 2010-01-17T00:37:34Z | [
"python"
] |
Pythonic way to sort list of objects by a dict value (by key) contained within the object | 2,078,986 | <p>I'm seeking advice on doing the following in a more pythonic way.</p>
<p>Consider:</p>
<pre><code>class MyObj(object):
def __init__(self):
self.dict_properties = {}
</code></pre>
<p>Suppose I've got a list which contains multiple MyObj instances:</p>
<pre><code>mylist = [<__main__.MyObj object at ... | 2 | 2010-01-16T21:38:23Z | 2,078,994 | <p>I'd just do:</p>
<p><code>mylist.sort(key=lambda o: o.dict_properties["kykey"])</code></p>
<p>You could also overide <strong>cmp</strong> on the class.</p>
| 3 | 2010-01-16T21:39:48Z | [
"python",
"sorting"
] |
Pythonic way to sort list of objects by a dict value (by key) contained within the object | 2,078,986 | <p>I'm seeking advice on doing the following in a more pythonic way.</p>
<p>Consider:</p>
<pre><code>class MyObj(object):
def __init__(self):
self.dict_properties = {}
</code></pre>
<p>Suppose I've got a list which contains multiple MyObj instances:</p>
<pre><code>mylist = [<__main__.MyObj object at ... | 2 | 2010-01-16T21:38:23Z | 2,078,998 | <pre><code>mylist.sort(key=lambda x: x.dict_properties['mykey'])
</code></pre>
<p>is way simpler, and faster. You could reach for <code>operator</code> and try to compose an <code>attrgetter</code> and an <code>itemgetter</code>, but a straightforward <code>lambda</code> (or <code>def</code>) seems simplest here.</p>... | 9 | 2010-01-16T21:41:05Z | [
"python",
"sorting"
] |
Pythonic way to sort list of objects by a dict value (by key) contained within the object | 2,078,986 | <p>I'm seeking advice on doing the following in a more pythonic way.</p>
<p>Consider:</p>
<pre><code>class MyObj(object):
def __init__(self):
self.dict_properties = {}
</code></pre>
<p>Suppose I've got a list which contains multiple MyObj instances:</p>
<pre><code>mylist = [<__main__.MyObj object at ... | 2 | 2010-01-16T21:38:23Z | 2,079,137 | <p>If speed is an issue, then use decorate-sort-undecorate:</p>
<pre><code> mylist_decorated = [(elem.dict_properties['mykey'], elem) for elem in mylist]
mylist_decorated.sort()
mylist = [elem[1] for elem in mylist_decorated] # or zip(*mylist_decorated)[1] :)
</code></pre>
<ul>
<li>this way sort() can spre... | 1 | 2010-01-16T22:30:51Z | [
"python",
"sorting"
] |
How to get the EXIF or meta-data from images? | 2,079,013 | <p>I need a really good library or a command-line software that can be used to extract Exif data from images. No specific programming language, except the library or the software has to work really well. </p>
<p>I found various libraries for PHP and Python, but most of it hasn't been updated or being maintained and do... | 3 | 2010-01-16T21:46:37Z | 2,079,021 | <p>Did you not find that if <a href="http://www.php.net/manual/en/book.exif.php" rel="nofollow">PHP is compiled with --enable-exif</a> that it will have an API for handling EXIF data? If you did find it, was hat one that doesn't do what you require?</p>
| 0 | 2010-01-16T21:51:55Z | [
"java",
"php",
"python",
"image",
"exif"
] |
How to get the EXIF or meta-data from images? | 2,079,013 | <p>I need a really good library or a command-line software that can be used to extract Exif data from images. No specific programming language, except the library or the software has to work really well. </p>
<p>I found various libraries for PHP and Python, but most of it hasn't been updated or being maintained and do... | 3 | 2010-01-16T21:46:37Z | 2,079,024 | <p>The Gimp's <a href="http://registry.gimp.org/node/8839" rel="nofollow">Exif Viewer plugin</a> uses <a href="http://libexif.sourceforge.net/" rel="nofollow">libexif</a>, which is written in C and seems to have been updated recently. Also, <a href="http://www.exif.org/specifications.html" rel="nofollow">here is the EX... | 2 | 2010-01-16T21:52:36Z | [
"java",
"php",
"python",
"image",
"exif"
] |
How to get the EXIF or meta-data from images? | 2,079,013 | <p>I need a really good library or a command-line software that can be used to extract Exif data from images. No specific programming language, except the library or the software has to work really well. </p>
<p>I found various libraries for PHP and Python, but most of it hasn't been updated or being maintained and do... | 3 | 2010-01-16T21:46:37Z | 2,079,027 | <p>Have you checked <a href="http://fetidcascade.com/pyexif.html" rel="nofollow">this article</a> and the modules pointed to from there? Given the standard nature of Exif, in theory, once you fully meet the standard there should be no need for further development, nor for manufacturer-specific tweaks, right?-)</p>
| 0 | 2010-01-16T21:52:54Z | [
"java",
"php",
"python",
"image",
"exif"
] |
How to get the EXIF or meta-data from images? | 2,079,013 | <p>I need a really good library or a command-line software that can be used to extract Exif data from images. No specific programming language, except the library or the software has to work really well. </p>
<p>I found various libraries for PHP and Python, but most of it hasn't been updated or being maintained and do... | 3 | 2010-01-16T21:46:37Z | 2,079,055 | <p>Take a look into <a href="http://php.net/manual/en/function.exif-read-data.php" rel="nofollow"><code>exif_read_data()</code></a> (PHP).</p>
| 1 | 2010-01-16T22:02:55Z | [
"java",
"php",
"python",
"image",
"exif"
] |
How to get the EXIF or meta-data from images? | 2,079,013 | <p>I need a really good library or a command-line software that can be used to extract Exif data from images. No specific programming language, except the library or the software has to work really well. </p>
<p>I found various libraries for PHP and Python, but most of it hasn't been updated or being maintained and do... | 3 | 2010-01-16T21:46:37Z | 2,079,065 | <p>For perl, there is <a href="http://search.cpan.org/~exiftool/Image-ExifTool-8.00/" rel="nofollow">Image::ExifTool</a> and Image::EXIF.</p>
<p>The first is used by the "exiftool", which is capable of reading lots of meta informations (also in other formats then exif) from images.</p>
| 0 | 2010-01-16T22:08:23Z | [
"java",
"php",
"python",
"image",
"exif"
] |
How to get the EXIF or meta-data from images? | 2,079,013 | <p>I need a really good library or a command-line software that can be used to extract Exif data from images. No specific programming language, except the library or the software has to work really well. </p>
<p>I found various libraries for PHP and Python, but most of it hasn't been updated or being maintained and do... | 3 | 2010-01-16T21:46:37Z | 2,079,293 | <p>I wrote <a href="http://code.google.com/p/pexif/" rel="nofollow">pexif</a>, which works pretty well for me. It is pure python, so should be easy to extend. It also lets you edit exif fields, (if you want, I wrote it to add GPS tags to my photos).</p>
<p>The major down side is that it has limited support for manufac... | 0 | 2010-01-16T23:14:06Z | [
"java",
"php",
"python",
"image",
"exif"
] |
How to get the EXIF or meta-data from images? | 2,079,013 | <p>I need a really good library or a command-line software that can be used to extract Exif data from images. No specific programming language, except the library or the software has to work really well. </p>
<p>I found various libraries for PHP and Python, but most of it hasn't been updated or being maintained and do... | 3 | 2010-01-16T21:46:37Z | 2,079,487 | <p><a href="http://www.sentex.net/~mwandel/jhead/" rel="nofollow">jhead</a> is a great command-line EXIF utility; it can both read and write EXIF data. I was even updated recently (November 2009)!</p>
<p>You can download binaries for many different platforms (including Linux, Mac OS X and Windows).</p>
| 2 | 2010-01-17T00:22:37Z | [
"java",
"php",
"python",
"image",
"exif"
] |
How to get the EXIF or meta-data from images? | 2,079,013 | <p>I need a really good library or a command-line software that can be used to extract Exif data from images. No specific programming language, except the library or the software has to work really well. </p>
<p>I found various libraries for PHP and Python, but most of it hasn't been updated or being maintained and do... | 3 | 2010-01-16T21:46:37Z | 2,326,355 | <p>Right this is what you want.
<a href="http://www.sno.phy.queensu.ca/~phil/exiftool/">http://www.sno.phy.queensu.ca/~phil/exiftool/</a>
Gets what flickr does!</p>
| 5 | 2010-02-24T13:42:04Z | [
"java",
"php",
"python",
"image",
"exif"
] |
How to get the EXIF or meta-data from images? | 2,079,013 | <p>I need a really good library or a command-line software that can be used to extract Exif data from images. No specific programming language, except the library or the software has to work really well. </p>
<p>I found various libraries for PHP and Python, but most of it hasn't been updated or being maintained and do... | 3 | 2010-01-16T21:46:37Z | 4,013,832 | <p>You could take a look at <a href="http://www.exiv2.org/" rel="nofollow">exiv2</a>. I used the command line version to bulk rename all my photos to include a timestamp in the filename.</p>
<p>Should be fairly straighforward to use from any scripting environment.</p>
| 0 | 2010-10-25T10:50:37Z | [
"java",
"php",
"python",
"image",
"exif"
] |
wx.Font uses a facename & PIL.ImageFont uses a filename... Is there any way to relate the two? | 2,079,033 | <p>Hey guys, sorry but this is going to be a big one.. ;)</p>
<p>I'm running into an annoying little snag right now. I'm creating an RSS-style app for work which will be placed on some large LCD displays across the office. The basic concept is to have a client/server setup where the user would use a custom editor to c... | 2 | 2010-01-16T21:57:03Z | 2,081,154 | <p>Have you looked into using <a href="http://www.wxpython.org/docs/api/wx.MemoryDC-class.html" rel="nofollow">wx.MemoryDC</a> with a double-buffered window (i.e. "bit blitting")? The basic technique is that you draw your text into the DC off-screen, and then "blit" it onto the screen. This eliminates flicker.</p>
<p>... | 1 | 2010-01-17T13:50:53Z | [
"python",
"animation",
"fonts",
"wxpython",
"python-imaging-library"
] |
wx.Font uses a facename & PIL.ImageFont uses a filename... Is there any way to relate the two? | 2,079,033 | <p>Hey guys, sorry but this is going to be a big one.. ;)</p>
<p>I'm running into an annoying little snag right now. I'm creating an RSS-style app for work which will be placed on some large LCD displays across the office. The basic concept is to have a client/server setup where the user would use a custom editor to c... | 2 | 2010-01-16T21:57:03Z | 2,120,746 | <p>I'm hitting this exact same issue. Thanks for the tip on the registry key, that seems to be working well, but I'm building an app that will be installed on some Vista 64 bit machines and for some reason I'm not able to read the registry from Python under Vista 64. And plus, its so kludgey having to removing all the ... | 0 | 2010-01-22T21:41:59Z | [
"python",
"animation",
"fonts",
"wxpython",
"python-imaging-library"
] |
wx.Font uses a facename & PIL.ImageFont uses a filename... Is there any way to relate the two? | 2,079,033 | <p>Hey guys, sorry but this is going to be a big one.. ;)</p>
<p>I'm running into an annoying little snag right now. I'm creating an RSS-style app for work which will be placed on some large LCD displays across the office. The basic concept is to have a client/server setup where the user would use a custom editor to c... | 2 | 2010-01-16T21:57:03Z | 17,790,840 | <p>Forgot to answer this long ago...</p>
<p>With regards to relating the fonts, in the long run I was not able to find a feasible method to accomplish this task. </p>
<p>Using the suggestions made by <a href="https://groups.google.com/forum/#!topic/wxpython-users/QZa7jSaVTSE" rel="nofollow">Christopher</a>, I was abl... | 0 | 2013-07-22T14:57:59Z | [
"python",
"animation",
"fonts",
"wxpython",
"python-imaging-library"
] |
Better way to port Java into Python? | 2,079,076 | <p>After several hours of working on porting this program over, it appears to finally be in a working state. However, I was wondering if anyone knew of a better way or more complete way of porting Java servlets over into Python. The beginning of the Python script contains a lot of support code to make it easier to port... | 1 | 2010-01-16T22:12:55Z | 2,079,133 | <p>My best suggestion is to <em>not</em> write a line by line port. Python is not Java and you're hamstringing yourself if you're just writing Java style code in the Python language.</p>
<p>Here's a starter for recognizing some of the common differences/mistakes: <a href="http://dirtsimple.org/2004/12/python-is-not-j... | 5 | 2010-01-16T22:29:45Z | [
"java",
"python",
"servlets",
"porting"
] |
Better way to port Java into Python? | 2,079,076 | <p>After several hours of working on porting this program over, it appears to finally be in a working state. However, I was wondering if anyone knew of a better way or more complete way of porting Java servlets over into Python. The beginning of the Python script contains a lot of support code to make it easier to port... | 1 | 2010-01-16T22:12:55Z | 2,079,184 | <p>Not a direct answer but, any good reason to not use something like <a href="http://www.webwareforpython.org/" rel="nofollow">Webware</a> which offers, among other features (see the <a href="http://www.webwareforpython.org/Docs/Overview.html" rel="nofollow">Overview</a>):</p>
<blockquote>
<ul>
<li><strong>Servle... | 2 | 2010-01-16T22:42:48Z | [
"java",
"python",
"servlets",
"porting"
] |
Better way to port Java into Python? | 2,079,076 | <p>After several hours of working on porting this program over, it appears to finally be in a working state. However, I was wondering if anyone knew of a better way or more complete way of porting Java servlets over into Python. The beginning of the Python script contains a lot of support code to make it easier to port... | 1 | 2010-01-16T22:12:55Z | 2,079,215 | <p>Isn't this a translation and not a port? :)</p>
<p>I just <a href="http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=G1w&q=automatic+port+java+to+python&aq=f&oq=&aqi=" rel="nofollow">googled</a> and found <a href="http://code.google.com/p/java2pyth... | 3 | 2010-01-16T22:54:41Z | [
"java",
"python",
"servlets",
"porting"
] |
Better way to port Java into Python? | 2,079,076 | <p>After several hours of working on porting this program over, it appears to finally be in a working state. However, I was wondering if anyone knew of a better way or more complete way of porting Java servlets over into Python. The beginning of the Python script contains a lot of support code to make it easier to port... | 1 | 2010-01-16T22:12:55Z | 2,079,301 | <p>Creating a python webapp in this way is confusing and non pythonic. You might have better success rewriting your app in Django rather than porting it line by line from Java</p>
| 2 | 2010-01-16T23:15:18Z | [
"java",
"python",
"servlets",
"porting"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.