title
stringlengths
10
172
question_id
int64
469
40.1M
question_body
stringlengths
22
48.2k
question_score
int64
-44
5.52k
question_date
stringlengths
20
20
answer_id
int64
497
40.1M
answer_body
stringlengths
18
33.9k
answer_score
int64
-38
8.38k
answer_date
stringlengths
20
20
tags
listlengths
1
5
Is there a database implementation that has notifications and revisions?
1,118,272
<p>I am looking for a database library that can be used within an editor to replace a custom document format. In my case the document would contain a functional program.</p> <p>I want application data to be persistent even while editing, so that when the program crashes, no data is lost. I know that all databases offe...
0
2009-07-13T08:29:26Z
1,118,299
<p><a href="http://www.oracle.com/technology/products/berkeley-db/index.html" rel="nofollow">Berkeley DB</a> is an undemanding, light-weight key-value database that supports locking and transactions. There are bindings for it in a lot of programming languages, including C++ and python. You'll have to implement revisio...
1
2009-07-13T08:36:54Z
[ "c++", "python", "database-design", "editor" ]
Is there a database implementation that has notifications and revisions?
1,118,272
<p>I am looking for a database library that can be used within an editor to replace a custom document format. In my case the document would contain a functional program.</p> <p>I want application data to be persistent even while editing, so that when the program crashes, no data is lost. I know that all databases offe...
0
2009-07-13T08:29:26Z
1,118,325
<p>Check out ZODB. It doesn't have notifications built in, so you would need a messaging system there (since you may use separate computers). But it has transactions, you can roll back forever (unless you pack the database, which removes earlier revisions), you can access it directly as an integrated part of the applic...
0
2009-07-13T08:43:32Z
[ "c++", "python", "database-design", "editor" ]
Is there a database implementation that has notifications and revisions?
1,118,272
<p>I am looking for a database library that can be used within an editor to replace a custom document format. In my case the document would contain a functional program.</p> <p>I want application data to be persistent even while editing, so that when the program crashes, no data is lost. I know that all databases offe...
0
2009-07-13T08:29:26Z
1,118,368
<p>It might be a bit more power than what you ask for, but You should definitely look at <a href="http://couchdb.apache.org/" rel="nofollow">CouchDB</a>.</p> <p>It is a document database with "document" being defined as a JSON record. It stores all the changes to the documents as revisions, so you instantly get revisi...
1
2009-07-13T08:56:55Z
[ "c++", "python", "database-design", "editor" ]
Non-Standard Optional Argument Defaults
1,118,454
<p>I have two functions:</p> <pre><code>def f(a,b,c=g(b)): blabla def g(n): blabla </code></pre> <p><code>c</code> is an optional argument in function <code>f</code>. If the user does not specify its value, the program should compute g(b) and that would be the value of <code>c</code>. But the code does not c...
3
2009-07-13T09:23:48Z
1,118,464
<p>value of <code>c</code> will be evaluated (<code>g(b)</code>) at compilation time. You need <code>g</code> defined before <code>f</code> therefore. And of course you need a global <code>b</code> variable to be defined at that stage too.</p> <pre><code>b = 4 def g(a): return a+1 def test(a, c=g(b)): print(...
2
2009-07-13T09:26:07Z
[ "python", "optional-arguments" ]
Non-Standard Optional Argument Defaults
1,118,454
<p>I have two functions:</p> <pre><code>def f(a,b,c=g(b)): blabla def g(n): blabla </code></pre> <p><code>c</code> is an optional argument in function <code>f</code>. If the user does not specify its value, the program should compute g(b) and that would be the value of <code>c</code>. But the code does not c...
3
2009-07-13T09:23:48Z
1,118,465
<p>You cannot do it that way.</p> <p>Inside the function, check if c is specified. If not, do the calculation.</p> <pre><code>def f(a,b,c=None): if c == None: c = g(b) blabla </code></pre>
2
2009-07-13T09:26:21Z
[ "python", "optional-arguments" ]
Non-Standard Optional Argument Defaults
1,118,454
<p>I have two functions:</p> <pre><code>def f(a,b,c=g(b)): blabla def g(n): blabla </code></pre> <p><code>c</code> is an optional argument in function <code>f</code>. If the user does not specify its value, the program should compute g(b) and that would be the value of <code>c</code>. But the code does not c...
3
2009-07-13T09:23:48Z
1,118,467
<pre><code>def f(a,b,c=None): if c is None: c = g(b) </code></pre> <p>If <code>None</code> can be a valid value for <code>c</code> then you do this:</p> <pre><code>sentinel = object() def f(a,b,c=sentinel): if c is sentinel: c = g(b) </code></pre>
19
2009-07-13T09:26:54Z
[ "python", "optional-arguments" ]
Non-Standard Optional Argument Defaults
1,118,454
<p>I have two functions:</p> <pre><code>def f(a,b,c=g(b)): blabla def g(n): blabla </code></pre> <p><code>c</code> is an optional argument in function <code>f</code>. If the user does not specify its value, the program should compute g(b) and that would be the value of <code>c</code>. But the code does not c...
3
2009-07-13T09:23:48Z
1,118,756
<pre><code>def f(a,b,*args): if len(args) == 1: c = args[0] elif len(args) == 0: c = g(b) else: raise Exception('Function takes 2 or 3 parameters only.') blabla def g(n): blabla </code></pre> <p>You can probably structure it better, but that's the main idea. Alternatively y...
0
2009-07-13T10:39:09Z
[ "python", "optional-arguments" ]
Non-Standard Optional Argument Defaults
1,118,454
<p>I have two functions:</p> <pre><code>def f(a,b,c=g(b)): blabla def g(n): blabla </code></pre> <p><code>c</code> is an optional argument in function <code>f</code>. If the user does not specify its value, the program should compute g(b) and that would be the value of <code>c</code>. But the code does not c...
3
2009-07-13T09:23:48Z
2,893,677
<p>The problem with</p> <pre><code>sentinel = object() def f(a, b, c=sentinel): if c is sentinel: c = g(b) </code></pre> <p>is that <code>sentinel</code> is global/public unless this code is part of a function/method. So someone might still be able to call <code>f(23, 42, sentinel)</code>. However, if <code>f...
1
2010-05-23T22:06:39Z
[ "python", "optional-arguments" ]
Interpret this particular REGEX
1,118,672
<p>I did a REGEX pattern some time ago and I don't remember its meaning. For me this is a write-only language :)</p> <p>Here is the REGEX:</p> <pre><code>"(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$" </code></pre> <p>I need to know, in plain English, what does it means.</p>
0
2009-07-13T10:19:11Z
1,118,689
<pre><code>(?!^[0-9]*$) </code></pre> <p>don't match only numbers,</p> <pre><code>(?!^[a-zA-Z]*$) </code></pre> <p>don't match only letters,</p> <pre><code>^([a-zA-Z0-9]{8,10})$ </code></pre> <p>match letters and number 8 to 10 characters long.</p>
6
2009-07-13T10:22:24Z
[ "python", "regex" ]
Interpret this particular REGEX
1,118,672
<p>I did a REGEX pattern some time ago and I don't remember its meaning. For me this is a write-only language :)</p> <p>Here is the REGEX:</p> <pre><code>"(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$" </code></pre> <p>I need to know, in plain English, what does it means.</p>
0
2009-07-13T10:19:11Z
1,118,702
<p>Use something like <a href="http://www.ultrapico.com/Expresso.htm" rel="nofollow">expresso</a> to analyise it.</p>
1
2009-07-13T10:25:55Z
[ "python", "regex" ]
Interpret this particular REGEX
1,118,672
<p>I did a REGEX pattern some time ago and I don't remember its meaning. For me this is a write-only language :)</p> <p>Here is the REGEX:</p> <pre><code>"(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$" </code></pre> <p>I need to know, in plain English, what does it means.</p>
0
2009-07-13T10:19:11Z
1,118,708
<p><a href="http://www.regexbuddy.com/" rel="nofollow">RegexBuddy</a> says the following (!?!):</p> <pre><code>(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$ Options: ^ and $ match at line breaks Assert that it is impossible to match the regex below starting at this position (negative lookahead) «(?!^[0-9]*$)» ...
2
2009-07-13T10:28:14Z
[ "python", "regex" ]
Interpret this particular REGEX
1,118,672
<p>I did a REGEX pattern some time ago and I don't remember its meaning. For me this is a write-only language :)</p> <p>Here is the REGEX:</p> <pre><code>"(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$" </code></pre> <p>I need to know, in plain English, what does it means.</p>
0
2009-07-13T10:19:11Z
1,118,709
<p><a href="http://www.perl.com/doc/manual/html/pod/perlre.html" rel="nofollow">Perl</a> (and <a href="http://docs.python.org/library/re.html" rel="nofollow">Python</a> accordingly) says to the <code>(?!...)</code> part:</p> <blockquote> <p>A zero-width negative lookahead assertion. For example <code>/foo(?!bar)/</c...
4
2009-07-13T10:28:31Z
[ "python", "regex" ]
Migrating Django Application to Google App Engine?
1,118,761
<p>I'm developing a web application and considering Django, Google App Engine, and several other options. I wondered what kind of "penalty" I will incur if I develop a complete Django application assuming it runs on a dedicated server, and then later want to migrate it to Google App Engine.</p> <p>I have a basic under...
9
2009-07-13T10:40:05Z
1,118,790
<p>There are a few things that you can't do on the App Engine that you can do on your own server like uploading of files. On the App Engine you kinda have to upload it and store the datastore which can cause a few problems.</p> <p>Other than that it should be fine from the Presentation part. There are a number of othe...
1
2009-07-13T10:47:54Z
[ "python", "django", "google-app-engine" ]
Migrating Django Application to Google App Engine?
1,118,761
<p>I'm developing a web application and considering Django, Google App Engine, and several other options. I wondered what kind of "penalty" I will incur if I develop a complete Django application assuming it runs on a dedicated server, and then later want to migrate it to Google App Engine.</p> <p>I have a basic under...
9
2009-07-13T10:40:05Z
1,118,791
<p>Basically, you will change the data model base class and some APIs if you use them (PIL, urllib2, etc). </p> <p>If your goal is app-engine, I would use the app engine helper <a href="http://code.google.com/appengine/articles/appengine_helper_for_django.html" rel="nofollow">http://code.google.com/appengine/articles/...
2
2009-07-13T10:48:11Z
[ "python", "django", "google-app-engine" ]
Migrating Django Application to Google App Engine?
1,118,761
<p>I'm developing a web application and considering Django, Google App Engine, and several other options. I wondered what kind of "penalty" I will incur if I develop a complete Django application assuming it runs on a dedicated server, and then later want to migrate it to Google App Engine.</p> <p>I have a basic under...
9
2009-07-13T10:40:05Z
1,119,377
<p>Most (all?) of Django is available in GAE, so your main task is to avoid basing your designs around a reliance on anything from Django or the Python standard libraries which is not available on GAE.</p> <p>You've identified the glaring difference, which is the database, so I'll assume you're on top of that. Another...
8
2009-07-13T13:16:36Z
[ "python", "django", "google-app-engine" ]
Migrating Django Application to Google App Engine?
1,118,761
<p>I'm developing a web application and considering Django, Google App Engine, and several other options. I wondered what kind of "penalty" I will incur if I develop a complete Django application assuming it runs on a dedicated server, and then later want to migrate it to Google App Engine.</p> <p>I have a basic under...
9
2009-07-13T10:40:05Z
1,123,292
<p>It sounds like you have awareness of the major limitation in building/migrating your app -- that AppEngine doesn't support Django's ORM.</p> <p>Keep in mind that this doesn't just affect the code you write yourself -- it also limits your ability to use a lot of existing Django code. That includes other applications...
2
2009-07-14T03:18:17Z
[ "python", "django", "google-app-engine" ]
Python script: import sys failing on WinXP setup
1,118,979
<p>I'm trying out a hello world python script on WinXP. When I execute:</p> <blockquote> <p>python test.py arg1.log</p> </blockquote> <p>I get an error for the first line of the script, which is 'import sys':</p> <pre><code>File "test.py", line 1, in &lt;module&gt; i NameError: name 'i' is not defined </code></pre...
0
2009-07-13T11:38:23Z
1,118,998
<p>You've saved the file as Windows Unicode (aka UTF-16, aka UCS-2) rather than ASCII or UTF-8.</p> <p>If your editor has an Encoding option (or something under "Save As" for the encoding) change it to UTF-8.</p> <p>If your editor has no such option, you can load it into Notepad and save it as UTF-8.</p>
10
2009-07-13T11:44:05Z
[ "python", "windows-xp" ]
PyQt: event is not triggered, what's wrong with my code?
1,119,110
<p>I'm a Python newbie and I'm trying to write a trivial app with an event handler that gets activated when an item in a custom QTreeWidget is clicked. For some reason it doesn't work. Since I'm only at the beginning of learning it, I can't figure out what I'm doing wrong. Here is the code:</p> <pre><code>#!/usr/bin/e...
4
2009-07-13T12:14:45Z
1,119,407
<p>You should have said</p> <pre><code>self.connect(self, SIGNAL('itemClicked(QTreeWidgetItem*, int)'), self.onClick) </code></pre> <p>Notice it says <strong>int</strong> rather than <em>column</em> in the first argument to <code>SIGNAL</code>. You also only need to do the <code>connect</code> call once for the tree ...
11
2009-07-13T13:20:59Z
[ "python", "pyqt" ]
How to put infinity and minus infinity in Django FloatField?
1,119,497
<p>I am trying to put infinity in a FloatField, but that doesn't seem to work. How do I solve this?</p> <pre><code>f = DjangoModel(float_value=float('inf')) #ok f.save() #crashes </code></pre> <p>Results in:</p> <pre><code>Traceback (most recent call last): ... ProgrammingError: column "inf" does not exist LINE 1: ....
3
2009-07-13T13:38:44Z
1,119,513
<p>It should be 'infinity' shouldn't it? However, I don't know if that can be stored in a float field. float('infinity') returns inf, and that would be a char field.</p> <p>Edit: Unfortunately, it is hard to say what C library Django uses without digging deep. I'd say figure out what the value stored in the float fiel...
0
2009-07-13T13:41:15Z
[ "python", "django", "infinity" ]
How to put infinity and minus infinity in Django FloatField?
1,119,497
<p>I am trying to put infinity in a FloatField, but that doesn't seem to work. How do I solve this?</p> <pre><code>f = DjangoModel(float_value=float('inf')) #ok f.save() #crashes </code></pre> <p>Results in:</p> <pre><code>Traceback (most recent call last): ... ProgrammingError: column "inf" does not exist LINE 1: ....
3
2009-07-13T13:38:44Z
1,120,260
<p>It seems like Djangos ORM doesn't have any special handling for this. Pythons representaton of the values are inf and -inf, while PostgrSQL wants 'Infinity' and '-Infinity'. Obviously Djangos ORM doesn't handle that conversion.</p> <p>So you need to fix the ORM, I guess. And then think about the fact that other SQL...
3
2009-07-13T15:43:01Z
[ "python", "django", "infinity" ]
Live RX and TX rates in linux
1,119,683
<p>I'm looking for a way to programatically (whether calling a library, or a standalone program) monitor live ip traffic in linux. I don't want totals, i want the current bandwidth that is being used. I'm looking for a tool similar (but non-graphical) to OS X's istat menu's network traffic monitor.</p> <p>I'm fairly c...
2
2009-07-13T14:12:37Z
1,119,916
<p>We have byte and packet counters in /proc/net/dev, so:</p> <pre><code>import time last={} def diff(col): return counters[col] - last[iface][col] while True: print "\n%10s: %10s %10s %10s %10s"%("interface","bytes recv","bytes sent", "pkts recv", "pkts sent") for line in open('/proc/net/dev').readlines()[2:]:...
9
2009-07-13T14:50:05Z
[ "c++", "python", "c" ]
Live RX and TX rates in linux
1,119,683
<p>I'm looking for a way to programatically (whether calling a library, or a standalone program) monitor live ip traffic in linux. I don't want totals, i want the current bandwidth that is being used. I'm looking for a tool similar (but non-graphical) to OS X's istat menu's network traffic monitor.</p> <p>I'm fairly c...
2
2009-07-13T14:12:37Z
1,123,176
<p>I use a little program known as <a href="http://dag.wieers.com/home-made/dstat/" rel="nofollow"><code>dstat</code></a> It combines a lot "stat" like functions into 1 quick output. Very customizable. It will give you current network throughput as well as much more. </p> <p>In linux the program <code>netstat</code> w...
1
2009-07-14T02:31:08Z
[ "c++", "python", "c" ]
Live RX and TX rates in linux
1,119,683
<p>I'm looking for a way to programatically (whether calling a library, or a standalone program) monitor live ip traffic in linux. I don't want totals, i want the current bandwidth that is being used. I'm looking for a tool similar (but non-graphical) to OS X's istat menu's network traffic monitor.</p> <p>I'm fairly c...
2
2009-07-13T14:12:37Z
29,800,657
<p>You can get network throughput and packet counts using the following <code>dstat</code> command:</p> <pre><code>dstat -n --net-packets -f 10 </code></pre> <p>Or if you want to monitor specific interfaces, you can do:</p> <pre><code>dstat -n --net-packets -N eth0,wlan0 10 </code></pre> <p>If you prefer the more c...
0
2015-04-22T14:24:56Z
[ "c++", "python", "c" ]
Java Python Integration
1,119,696
<p>I have a Java app that needs to integrate with a 3rd party library. The library is written in Python, and I don't have any say over that. I'm trying to figure out the best way to integrate with it. I'm trying out JEPP (Java Embedded Python) - has anyone used that before? My other thought is to use JNI to communicate...
32
2009-07-13T14:15:23Z
1,119,708
<p>Have you considered running <a href="http://www.jython.org/" rel="nofollow">Jython</a> on the Java VM?</p>
4
2009-07-13T14:16:46Z
[ "java", "python", "integration" ]
Java Python Integration
1,119,696
<p>I have a Java app that needs to integrate with a 3rd party library. The library is written in Python, and I don't have any say over that. I'm trying to figure out the best way to integrate with it. I'm trying out JEPP (Java Embedded Python) - has anyone used that before? My other thought is to use JNI to communicate...
32
2009-07-13T14:15:23Z
1,119,711
<p>Why not use <a href="http://www.jython.org/">Jython</a>? The only downside I can immediately think of is if your library uses CPython native extensions.</p> <p>EDIT: If you can use Jython <em>now</em> but think you may have problems with a later version of the library, I suggest you try to isolate the library from ...
24
2009-07-13T14:17:25Z
[ "java", "python", "integration" ]
Java Python Integration
1,119,696
<p>I have a Java app that needs to integrate with a 3rd party library. The library is written in Python, and I don't have any say over that. I'm trying to figure out the best way to integrate with it. I'm trying out JEPP (Java Embedded Python) - has anyone used that before? My other thought is to use JNI to communicate...
32
2009-07-13T14:15:23Z
1,119,714
<p>If you can get your Python code to work in Jython, then you should be able to use that to call it from Java:</p> <ul> <li><a href="http://jython.sourceforge.net/cgi-bin/faqw.py?req=show&amp;file=faq06.001.htp" rel="nofollow">http://jython.sourceforge.net/cgi-bin/faqw.py?req=show&amp;file=faq06.001.htp</a></li> </ul...
3
2009-07-13T14:17:55Z
[ "java", "python", "integration" ]
Java Python Integration
1,119,696
<p>I have a Java app that needs to integrate with a 3rd party library. The library is written in Python, and I don't have any say over that. I'm trying to figure out the best way to integrate with it. I'm trying out JEPP (Java Embedded Python) - has anyone used that before? My other thought is to use JNI to communicate...
32
2009-07-13T14:15:23Z
1,119,735
<p>I've investigated a similar setup with JNI. Maybe this will help if haven't seen it yet:</p> <p><a href="http://wiki.cacr.caltech.edu/danse/index.php/Communication_between_Java_and_Python" rel="nofollow">http://wiki.cacr.caltech.edu/danse/index.php/Communication_between_Java_and_Python</a></p> <p><a href="http://j...
3
2009-07-13T14:21:39Z
[ "java", "python", "integration" ]
Java Python Integration
1,119,696
<p>I have a Java app that needs to integrate with a 3rd party library. The library is written in Python, and I don't have any say over that. I'm trying to figure out the best way to integrate with it. I'm trying out JEPP (Java Embedded Python) - has anyone used that before? My other thought is to use JNI to communicate...
32
2009-07-13T14:15:23Z
1,119,752
<p>You could use a messaging service like <a href="http://activemq.apache.org/" rel="nofollow">ActiveMQ</a>. It has both <a href="http://activemq.apache.org/python.html" rel="nofollow">Python</a> and Java support. This way, you can leave the complicated JNI or C bindings as they are and deal solely with what I consider...
3
2009-07-13T14:24:21Z
[ "java", "python", "integration" ]
Java Python Integration
1,119,696
<p>I have a Java app that needs to integrate with a 3rd party library. The library is written in Python, and I don't have any say over that. I'm trying to figure out the best way to integrate with it. I'm trying out JEPP (Java Embedded Python) - has anyone used that before? My other thought is to use JNI to communicate...
32
2009-07-13T14:15:23Z
1,119,884
<p>Frankly <strong>most ways to somehow run Python directly from within JVM don't work</strong>. They are either not-quite-compatible (new release of your third party library can use python 2.6 features and will not work with Jython 2.5) or hacky (it will break with cryptic JVM stacktrace not really leading to solution...
10
2009-07-13T14:44:27Z
[ "java", "python", "integration" ]
Java Python Integration
1,119,696
<p>I have a Java app that needs to integrate with a 3rd party library. The library is written in Python, and I don't have any say over that. I'm trying to figure out the best way to integrate with it. I'm trying out JEPP (Java Embedded Python) - has anyone used that before? My other thought is to use JNI to communicate...
32
2009-07-13T14:15:23Z
1,119,887
<blockquote> <p>My other thought is to use JNI to communicate with the C bindings for Python.</p> </blockquote> <p>I like very much <a href="https://github.com/twall/jna/">JNA</a>:</p> <blockquote> <p>JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but ...
5
2009-07-13T14:45:12Z
[ "java", "python", "integration" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
1,119,762
<p>You probably want base64, not base62. There's an URL-compatible version of it floating around, so the extra two filler characters shouldn't be a problem.</p> <p>The process is fairly simple; consider that base64 represents 6 bits and a regular byte represents 8. Assign a value from 000000 to 111111 to each of the 6...
4
2009-07-13T14:26:05Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
1,119,768
<p>Sorry, I can't help you with a library here. I would prefer using base64 and just adding to extra characters to your choice -- if possible!</p> <p>Then you can use the base64 module.</p> <p>If this is really, really not possible:</p> <p>You can do it yourself this way (this is pseudo-code):</p> <pre><code>base62...
1
2009-07-13T14:26:58Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
1,119,769
<p>There is no standard module for this, but I have written my own functions to achieve that.</p> <pre class="lang-py prettyprint-override"><code>BASE62 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" def encode(num, alphabet=BASE62): """Encode a positive number in Base X Arguments: - ...
106
2009-07-13T14:27:01Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
1,119,967
<p>you can download zbase62 module from <a href="http://pypi.python.org/pypi/zbase62" rel="nofollow">pypi</a></p> <p>eg </p> <pre><code>&gt;&gt;&gt; import zbase62 &gt;&gt;&gt; zbase62.b2a("abcd") '1mZPsa' </code></pre>
2
2009-07-13T15:00:35Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
1,123,373
<p>Personally I like the solution from Baishampayan, mostly because of stripping the confusing characters.</p> <p>For completeness, and solution with better performance, <a href="http://fi.am/entry/urlsafe-base64-encodingdecoding-in-two-lines/" rel="nofollow">this post</a> shows a way to use the Python base64 module.<...
1
2009-07-14T03:55:44Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
1,486,460
<p>I have a Python library for doing exactly that here: <a href="http://www.djangosnippets.org/snippets/1431/" rel="nofollow">http://www.djangosnippets.org/snippets/1431/</a></p>
3
2009-09-28T10:59:20Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
1,487,304
<p>The following decoder-maker works with any reasonable base, has a much tidier loop, and gives an explicit error message when it meets an invalid character.</p> <pre><code>def base_n_decoder(alphabet): """Return a decoder for a base-n encoded string Argument: - `alphabet`: The alphabet used for encoding ...
8
2009-09-28T14:20:24Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
2,549,514
<p>I once wrote a script to do this aswell, I think it's quite elegant :)</p> <pre><code>import string BASE_LIST = string.digits + string.letters + '_@' BASE_DICT = dict((c, i) for i, c in enumerate(BASE_LIST)) def base_decode(string, reverse_base=BASE_DICT): length = len(reverse_base) ret = 0 for i, c in...
38
2010-03-30T23:58:33Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
4,634,454
<p>If all you need is to generate a short ID (since you mention URL shorteners) rather than encode/decode something, this module might help:</p> <p><a href="https://github.com/stochastic-technologies/shortuuid/" rel="nofollow">https://github.com/stochastic-technologies/shortuuid/</a></p>
3
2011-01-08T14:59:07Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
4,728,421
<p>I have benefited greatly from others' posts here. I needed the python code originally for a Django project, but since then I have turned to node.js, so here's a <strong><em>javascript version</em></strong> of the code (the encoding part) that Baishampayan Ghose provided.</p> <pre><code>var ALPHABET = "0123456789abc...
2
2011-01-18T19:58:32Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
5,137,148
<p>I wrote this a while back and it's worked pretty well (negatives and all included)</p> <pre><code>def code(number,base): try: int(number),int(base) except ValueError: raise ValueError('code(number,base): number and base must be in base10') else: number,base = int(number),int(base...
1
2011-02-28T00:36:23Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
14,259,141
<p>If you're looking for the highest efficiency (like django), you'll want something like the following. This code is a combination of efficient methods from Baishampayan Ghose and WoLpH and John Machin.</p> <pre><code># Edit this list of characters as desired. BASE_ALPH = tuple("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZab...
6
2013-01-10T13:33:19Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
15,694,685
<pre><code>BASE_LIST = tuple("23456789ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz") BASE_DICT = dict((c, v) for v, c in enumerate(BASE_LIST)) BASE_LEN = len(BASE_LIST) def nice_decode(str): num = 0 for char in str[::-1]: num = num * BASE_LEN + BASE_DICT[char] return num def nice_encode(num): ...
1
2013-03-29T00:50:19Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
16,945,658
<p>I hope the following snippet could help. </p> <pre><code>def num2sym(num, sym, join_symbol=''): if num == 0: return sym[0] if num &lt; 0 or type(num) not in (int, long): raise ValueError('num must be positive integer') l = len(sym) # target number base r = [] div = num whil...
2
2013-06-05T16:54:30Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
26,386,020
<p>Here is an recurive and iterative way to do that. The iterative one is a little faster depending on the count of execution.</p> <pre><code>def base62_encode_r(dec): s = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' return s[dec] if dec &lt; 62 else base62_encode_r(dec / 62) + s[dec % 62] ...
1
2014-10-15T15:13:04Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
30,479,452
<p>There is now a python library for this.</p> <p>I'm working on making a pip package for this.</p> <p>I recommend you use my bases.py <a href="https://github.com/kamijoutouma/bases.py" rel="nofollow">https://github.com/kamijoutouma/bases.py</a> which was inspired by bases.js</p> <pre><code>from bases import Bases b...
1
2015-05-27T10:12:10Z
[ "python", "math", "base62" ]
Base 62 conversion
1,119,722
<p>How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ').</p> <p>I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts st...
56
2009-07-13T14:19:41Z
36,875,787
<p>Here's my solution:</p> <pre><code>def base62(a): baseit = (lambda a=a, b=62: (not a) and '0' or baseit(a-a%b, b*62) + '0123456789abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[a%b%61 or -1*bool(a%b)]) return baseit() </code></pre> <hr> <h2>explanation</h2> ...
0
2016-04-26T21:07:57Z
[ "python", "math", "base62" ]
Using Python to convert color formats?
1,119,754
<p>I'm working on a Python tool to convert image data into these color formats:</p> <ul> <li>RGB565</li> <li>RGBA5551</li> <li>RGBA4444.</li> </ul> <p>What's the simplest way to achieve this?</p> <p>I've used the <a href="http://www.pythonware.com/products/pil/" rel="nofollow">Python Imaging Library (PIL)</a> freque...
2
2009-07-13T14:24:42Z
1,120,077
<p>Changing something from 8 to 5 bits is trivial. In 8 bits the value is between 0 and 255, in 5 bits it's between 8 and 31, so all you need to do is divide the value with 8. Or 4 in the case for green in RGB565 mode. Or 16 in RGBA4444 mode as it uses 4 bits per channel, etc.</p> <p>Edit: Reading through your questio...
1
2009-07-13T15:15:10Z
[ "python" ]
Using Python to convert color formats?
1,119,754
<p>I'm working on a Python tool to convert image data into these color formats:</p> <ul> <li>RGB565</li> <li>RGBA5551</li> <li>RGBA4444.</li> </ul> <p>What's the simplest way to achieve this?</p> <p>I've used the <a href="http://www.pythonware.com/products/pil/" rel="nofollow">Python Imaging Library (PIL)</a> freque...
2
2009-07-13T14:24:42Z
1,299,963
<p>There's a module called <a href="http://code.google.com/p/python-colormath/" rel="nofollow">Python Colormath</a> which provides a lot of different conversions. Highly recommended.</p>
1
2009-08-19T13:35:17Z
[ "python" ]
Using Python to convert color formats?
1,119,754
<p>I'm working on a Python tool to convert image data into these color formats:</p> <ul> <li>RGB565</li> <li>RGBA5551</li> <li>RGBA4444.</li> </ul> <p>What's the simplest way to achieve this?</p> <p>I've used the <a href="http://www.pythonware.com/products/pil/" rel="nofollow">Python Imaging Library (PIL)</a> freque...
2
2009-07-13T14:24:42Z
1,561,517
<p>I ended up doing the conversions manually as Lennart Regebro suggested.</p> <p>However, pure Python (iterating over each pixel) turned out to be too slow.</p> <p>My final solution used <a href="http://www.pythonware.com/products/pil/" rel="nofollow">PIL</a> to load the image and <a href="http://numpy.scipy.org/" r...
0
2009-10-13T16:53:14Z
[ "python" ]
Using Python to convert color formats?
1,119,754
<p>I'm working on a Python tool to convert image data into these color formats:</p> <ul> <li>RGB565</li> <li>RGBA5551</li> <li>RGBA4444.</li> </ul> <p>What's the simplest way to achieve this?</p> <p>I've used the <a href="http://www.pythonware.com/products/pil/" rel="nofollow">Python Imaging Library (PIL)</a> freque...
2
2009-07-13T14:24:42Z
1,631,026
<p>Numpy is powerful indeed, but to get there and back to PIL requires two memory copies. Have you tried something along the following lines?</p> <pre><code>im = Image.open('yourimage.png') im.putdata([yourfunction(r,g,b) for (r,g,b) in im.getdata()]) </code></pre> <p>This is quite fast (especially when you can use a...
1
2009-10-27T14:02:32Z
[ "python" ]
Using Python to convert color formats?
1,119,754
<p>I'm working on a Python tool to convert image data into these color formats:</p> <ul> <li>RGB565</li> <li>RGBA5551</li> <li>RGBA4444.</li> </ul> <p>What's the simplest way to achieve this?</p> <p>I've used the <a href="http://www.pythonware.com/products/pil/" rel="nofollow">Python Imaging Library (PIL)</a> freque...
2
2009-07-13T14:24:42Z
4,043,391
<p>There is also a module named <a href="http://code.google.com/p/grapefruit/" rel="nofollow">Grapefruit</a> that let you do conversions between quite a lot of color formats.</p>
1
2010-10-28T13:32:29Z
[ "python" ]
Getting "Comment post not allowed (400)" when using Django Comments
1,120,139
<p>I'm going through a Django book and I seem to be stuck. The code base used in the book is .96 and I'm using 1.0 for my Django install. The portion I'm stuck at is related to Django comments (django.contrib.comments). When I submit my comments I get "Comment post not allowed (400) Why: Missing content_type or obje...
1
2009-07-13T15:25:50Z
1,120,946
<p>Django underwent a <em>huge</em> amount of change between 0.96 and 1.0, so it's not surprising you're having problems.</p> <p>For your specific issue, see <a href="http://docs.djangoproject.com/en/dev/ref/contrib/comments/upgrade/" rel="nofollow">here</a>.</p> <p>However I would suggest you find a more up-to-date ...
0
2009-07-13T17:35:43Z
[ "python", "django", "comments" ]
Getting "Comment post not allowed (400)" when using Django Comments
1,120,139
<p>I'm going through a Django book and I seem to be stuck. The code base used in the book is .96 and I'm using 1.0 for my Django install. The portion I'm stuck at is related to Django comments (django.contrib.comments). When I submit my comments I get "Comment post not allowed (400) Why: Missing content_type or obje...
1
2009-07-13T15:25:50Z
1,131,472
<p>It's not perfect, but I've worked around this. I used the form.html included with Django itself and that got me past the "Comment post not allowed (400)" message and posted my comment successfully. It includes a few other fields but since I didn't define my own form in forms.py that's to be expected I suppose. At...
0
2009-07-15T13:40:57Z
[ "python", "django", "comments" ]
Disabling Python nosetests
1,120,148
<p>When using nosetests for Python it is possible to disable a unit test by setting the test function's <code>__test__</code> attribute to false. I have implemented this using the following decorator:</p> <pre><code>def unit_test_disabled(): def wrapper(func): func.__test__ = False return func ...
30
2009-07-13T15:27:28Z
1,120,180
<p>Perhaps this will work:</p> <pre><code>def unit_test_disabled(f): f.__test__ = False return f @unit_test_disabled def test_my_sample_test() #code here ... </code></pre>
1
2009-07-13T15:31:46Z
[ "python", "nosetests" ]
Disabling Python nosetests
1,120,148
<p>When using nosetests for Python it is possible to disable a unit test by setting the test function's <code>__test__</code> attribute to false. I have implemented this using the following decorator:</p> <pre><code>def unit_test_disabled(): def wrapper(func): func.__test__ = False return func ...
30
2009-07-13T15:27:28Z
1,120,347
<p>I think you will also need to rename your decorator to something that has not got test in. The below only fails on the second test for me and the first does not show up in the test suite. </p> <pre><code>def unit_disabled(func): def wrapper(func): func.__test__ = False return func return ...
-14
2009-07-13T15:57:44Z
[ "python", "nosetests" ]
Disabling Python nosetests
1,120,148
<p>When using nosetests for Python it is possible to disable a unit test by setting the test function's <code>__test__</code> attribute to false. I have implemented this using the following decorator:</p> <pre><code>def unit_test_disabled(): def wrapper(func): func.__test__ = False return func ...
30
2009-07-13T15:27:28Z
1,843,106
<p>Nose already has a builtin decorator for this:</p> <pre><code>from nose.tools import nottest @nottest def test_my_sample_test() #code here ... </code></pre> <p>Also check out the other goodies that nose provides: <a href="https://nose.readthedocs.org/en/latest/testing_tools.html">https://nose.readthedocs.org/...
107
2009-12-03T21:39:10Z
[ "python", "nosetests" ]
Disabling Python nosetests
1,120,148
<p>When using nosetests for Python it is possible to disable a unit test by setting the test function's <code>__test__</code> attribute to false. I have implemented this using the following decorator:</p> <pre><code>def unit_test_disabled(): def wrapper(func): func.__test__ = False return func ...
30
2009-07-13T15:27:28Z
7,687,714
<p>There also is a skiptest plugin for nosetest, which will cause the test show in test output as skipped. Here is a decorator for that:</p> <pre><code>def skipped(func): from nose.plugins.skip import SkipTest def _(): raise SkipTest("Test %s is skipped" % func.__name__) _.__name__ = func.__name__ ...
25
2011-10-07T13:08:28Z
[ "python", "nosetests" ]
Disabling Python nosetests
1,120,148
<p>When using nosetests for Python it is possible to disable a unit test by setting the test function's <code>__test__</code> attribute to false. I have implemented this using the following decorator:</p> <pre><code>def unit_test_disabled(): def wrapper(func): func.__test__ = False return func ...
30
2009-07-13T15:27:28Z
28,630,874
<p>You can also use <a href="https://docs.python.org/2/library/unittest.html#unittest.skip"><code>unittest.skip</code></a> decorator:</p> <pre><code>import unittest @unittest.skip("temporarily disabled") class MyTestCase(unittest.TestCase): ... </code></pre>
38
2015-02-20T14:06:06Z
[ "python", "nosetests" ]
Disabling Python nosetests
1,120,148
<p>When using nosetests for Python it is possible to disable a unit test by setting the test function's <code>__test__</code> attribute to false. I have implemented this using the following decorator:</p> <pre><code>def unit_test_disabled(): def wrapper(func): func.__test__ = False return func ...
30
2009-07-13T15:27:28Z
37,215,576
<p><strong>You can just start the class, method or function name with an underscore and nose will ignore it.</strong></p> <p><code>@nottest</code> has its uses but I find that it does not work well when classes derive from one another and some base classes must be ignored by nose. This happens often when I have a seri...
0
2016-05-13T16:59:47Z
[ "python", "nosetests" ]
How do you cast an instance to a derived class?
1,120,156
<p>I am trying to use a little inheritance in a Python program I am working on. I have a base class, User, which implements all of the functionality of a user. I am adding the concept of an unapproved user, which is just like a user, with the addition of a single method.</p> <p>The User class has some methods that r...
5
2009-07-13T15:28:24Z
1,120,176
<p>Python is a dynamically-typed language, so the concept of "casting" doesn't exist. If the object is already an <code>UnapprovedUser</code>, then you can already call all methods that exist in that class, without having to cast.</p>
2
2009-07-13T15:31:17Z
[ "python", "oop", "inheritance" ]
How do you cast an instance to a derived class?
1,120,156
<p>I am trying to use a little inheritance in a Python program I am working on. I have a base class, User, which implements all of the functionality of a user. I am adding the concept of an unapproved user, which is just like a user, with the addition of a single method.</p> <p>The User class has some methods that r...
5
2009-07-13T15:28:24Z
1,120,278
<p>Rather than "casting", I think you really want to create an <code>UnapprovedUser</code> rather than a <code>User</code> when invoking <code>UnapprovedUser.get()</code>. To do that:</p> <p>Change <code>User.get</code> to actually use the <code>cls</code> argument that's passed-in:</p> <pre><code>@classmethod def ge...
7
2009-07-13T15:45:51Z
[ "python", "oop", "inheritance" ]
How do you cast an instance to a derived class?
1,120,156
<p>I am trying to use a little inheritance in a Python program I am working on. I have a base class, User, which implements all of the functionality of a user. I am adding the concept of an unapproved user, which is just like a user, with the addition of a single method.</p> <p>The User class has some methods that r...
5
2009-07-13T15:28:24Z
1,120,339
<p>In a class method, the class is passed in in the cls parameter. So instead of User.something do cls.something. Done!</p> <p>That said, I'm not sure I would do this with two types of user. I'm not 100% sure what you mean with "Approved" here, I it seems to me to be one of two things. </p> <ol> <li><p>It may mean th...
0
2009-07-13T15:56:01Z
[ "python", "oop", "inheritance" ]
How do you cast an instance to a derived class?
1,120,156
<p>I am trying to use a little inheritance in a Python program I am working on. I have a base class, User, which implements all of the functionality of a user. I am adding the concept of an unapproved user, which is just like a user, with the addition of a single method.</p> <p>The User class has some methods that r...
5
2009-07-13T15:28:24Z
1,120,391
<ul> <li><p>super(UnapprovedUser, self) is wrong it should be super(UnapprovedUser, cls) because in class method you do not have self available</p></li> <li><p>I will reiterate your question , in base class you are creating user and somehow you want to return derived class e.g. </p></li> </ul> <pre><code> class Use...
1
2009-07-13T16:04:20Z
[ "python", "oop", "inheritance" ]
Platform for developing all things google?
1,120,297
<p>I am interested in developing things for google apps and android using python and java. I am new to both and was wondering if a environment set in <code>windows</code> or <code>linux</code> would be more productive for these tasks?</p>
4
2009-07-13T15:48:50Z
1,120,511
<p>Google has tools for Eclipse only for both <a href="http://developer.android.com/guide/developing/eclipse-adt.html" rel="nofollow">Android</a> and for <a href="http://code.google.com/appengine/docs/java/tools/eclipse.html" rel="nofollow">Google Apps</a>. They haven't made any other tools as far as I know.</p> <p>O...
1
2009-07-13T16:21:04Z
[ "java", "python", "android", "platform" ]
Platform for developing all things google?
1,120,297
<p>I am interested in developing things for google apps and android using python and java. I am new to both and was wondering if a environment set in <code>windows</code> or <code>linux</code> would be more productive for these tasks?</p>
4
2009-07-13T15:48:50Z
1,121,377
<p>I'd throw down another vote for Eclipse. I've been using it on the mac and I find it to be very buggy. Not sure if that's just the nature of the beast... My experiences with it on XP have been more stable. Haven't had time to check it out on Ubuntu.</p>
0
2009-07-13T18:52:26Z
[ "java", "python", "android", "platform" ]
Platform for developing all things google?
1,120,297
<p>I am interested in developing things for google apps and android using python and java. I am new to both and was wondering if a environment set in <code>windows</code> or <code>linux</code> would be more productive for these tasks?</p>
4
2009-07-13T15:48:50Z
1,122,211
<p>Internally, I believe Google uses Eclipse running on Ubuntu for Android development, so that'd be your best bet if you're completely paranoid about avoiding all potential issues. Of course, this is impossible, and really you should just use whatever you're comfortable in.</p>
0
2009-07-13T21:34:29Z
[ "java", "python", "android", "platform" ]
Does Jython have the GIL?
1,120,354
<p>I was sure that it hasn't, but looking for a definite answer on the Interwebs left me in doubt. For example, I got a <a href="http://journal.thobe.org/2008/03/next-step-to-increase-python.html">2008 post</a> which sort of looked like a joke at first glance but seemed to be serious at looking closer.</p> <p><em>Edit...
15
2009-07-13T15:58:36Z
1,120,370
<p>No, it does not. It's a part of the VM implementation, not the language.</p> <p>See also:</p> <pre><code>from __future__ import braces </code></pre>
19
2009-07-13T16:00:43Z
[ "python", "multithreading", "jython" ]
Does Jython have the GIL?
1,120,354
<p>I was sure that it hasn't, but looking for a definite answer on the Interwebs left me in doubt. For example, I got a <a href="http://journal.thobe.org/2008/03/next-step-to-increase-python.html">2008 post</a> which sort of looked like a joke at first glance but seemed to be serious at looking closer.</p> <p><em>Edit...
15
2009-07-13T15:58:36Z
1,121,385
<p>Both <code>Jython</code> and <code>IronPython</code> "lack" the <code>GIL</code>, because it's an implementation detail of the underlying VM. There was a lot of information I've found sometime ago, now the only thing I could come up with <a href="http://74.125.93.132/search?q=cache:2E7sw0IZa8kJ:mail.python.org/piper...
3
2009-07-13T18:53:30Z
[ "python", "multithreading", "jython" ]
Does Jython have the GIL?
1,120,354
<p>I was sure that it hasn't, but looking for a definite answer on the Interwebs left me in doubt. For example, I got a <a href="http://journal.thobe.org/2008/03/next-step-to-increase-python.html">2008 post</a> which sort of looked like a joke at first glance but seemed to be serious at looking closer.</p> <p><em>Edit...
15
2009-07-13T15:58:36Z
1,136,769
<p>Google is making a Python implementation that is an modified cpython with performance improvements called unladen swallow. This will take care of removing the GIL. See: <a href="http://code.google.com/p/unladen-swallow/wiki/ProjectPlan" rel="nofollow">Unladen Swallow</a></p>
-1
2009-07-16T10:40:32Z
[ "python", "multithreading", "jython" ]
Does Jython have the GIL?
1,120,354
<p>I was sure that it hasn't, but looking for a definite answer on the Interwebs left me in doubt. For example, I got a <a href="http://journal.thobe.org/2008/03/next-step-to-increase-python.html">2008 post</a> which sort of looked like a joke at first glance but seemed to be serious at looking closer.</p> <p><em>Edit...
15
2009-07-13T15:58:36Z
1,147,548
<p>The quote you found was indeed a joke, here is a demo of Jython's implementation of the GIL:</p> <pre><code>Jython 2.5.0 (trunk:6550M, Jul 20 2009, 08:40:15) [Java HotSpot(TM) Client VM (Apple Inc.)] on java1.5.0_19 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; from __future__...
22
2009-07-18T13:35:07Z
[ "python", "multithreading", "jython" ]
Join Records on Multiple Line File based on Criteria
1,120,555
<p>I am trying to write a python script</p> <p>that takes record data like this</p> <pre><code>6xxxxxxxx 7xxxxxxxx 6xxxxxxxx 7xxxxxxxx 7xxxxxxxx 6xxxxxxxx 6xxxxxxxx 6xxxxxxxx 7xxxxxxxx 7xxxxxxxx 7xxxxxxxx </code></pre> <p>and performs the following logic</p> <pre><code>newline = "" read in a record if the recor...
1
2009-07-13T16:28:25Z
1,120,622
<p>None of the branches in your if statement finish with <code>newline</code> set to "". Therefore, the first branch will never evaluate because <code>newline</code> is never "" except for the very first case.</p>
0
2009-07-13T16:36:09Z
[ "python", "file-io" ]
Join Records on Multiple Line File based on Criteria
1,120,555
<p>I am trying to write a python script</p> <p>that takes record data like this</p> <pre><code>6xxxxxxxx 7xxxxxxxx 6xxxxxxxx 7xxxxxxxx 7xxxxxxxx 6xxxxxxxx 6xxxxxxxx 6xxxxxxxx 7xxxxxxxx 7xxxxxxxx 7xxxxxxxx </code></pre> <p>and performs the following logic</p> <pre><code>newline = "" read in a record if the recor...
1
2009-07-13T16:28:25Z
1,120,662
<p>You can simplify this by simply appending a newline for a record that starts with 6, and not appending one if it doens't.</p> <pre><code>for line in open('infile'): if line[0] == '6': print '' print line.strip() , </code></pre> <p>OK, this creates one empty line first in the file, and may not end the file ...
0
2009-07-13T16:44:08Z
[ "python", "file-io" ]
Join Records on Multiple Line File based on Criteria
1,120,555
<p>I am trying to write a python script</p> <p>that takes record data like this</p> <pre><code>6xxxxxxxx 7xxxxxxxx 6xxxxxxxx 7xxxxxxxx 7xxxxxxxx 6xxxxxxxx 6xxxxxxxx 6xxxxxxxx 7xxxxxxxx 7xxxxxxxx 7xxxxxxxx </code></pre> <p>and performs the following logic</p> <pre><code>newline = "" read in a record if the recor...
1
2009-07-13T16:28:25Z
1,123,029
<p>if you file is not in GB, </p> <pre><code>data=open("file").read().split() a = [n for n,l in enumerate(data) if l.startswith("6") ] for i,j in enumerate(a): if i+1 == len(a): r=data[a[i]:] else: r=data[a[i]:a[i+1]] print ' '.join(r) </code></pre>
0
2009-07-14T01:32:40Z
[ "python", "file-io" ]
Using Python to execute a command on every file in a folder
1,120,707
<p>I'm trying to create a Python script that would :</p> <ol> <li>Look into the folder "/input"</li> <li>For each video in that folder, run a mencoder command (to transcode them to something playable on my phone)</li> <li>Once mencoder has finished his run, delete the original video.</li> </ol> <p>That doesn't seem t...
23
2009-07-13T16:50:53Z
1,120,736
<p>To find all the filenames use <code>os.listdir()</code>.</p> <p>Then you loop over the filenames. Like so:</p> <pre><code>import os for filename in os.listdir('dirname'): callthecommandhere(blablahbla, filename, foo) </code></pre> <p>If you prefer subprocess, use subprocess. :-)</p>
41
2009-07-13T16:55:06Z
[ "python", "foreach", "mencoder" ]
Using Python to execute a command on every file in a folder
1,120,707
<p>I'm trying to create a Python script that would :</p> <ol> <li>Look into the folder "/input"</li> <li>For each video in that folder, run a mencoder command (to transcode them to something playable on my phone)</li> <li>Once mencoder has finished his run, delete the original video.</li> </ol> <p>That doesn't seem t...
23
2009-07-13T16:50:53Z
1,120,770
<p>Use <a href="http://docs.python.org/library/os.html#os.walk">os.walk</a> to iterate recursively over directory content:</p> <pre><code>import os root_dir = '.' for directory, subdirectories, files in os.walk(root_dir): for file in files: print os.path.join(directory, file) </code></pre> <p>No real di...
15
2009-07-13T17:01:45Z
[ "python", "foreach", "mencoder" ]
Using Python to execute a command on every file in a folder
1,120,707
<p>I'm trying to create a Python script that would :</p> <ol> <li>Look into the folder "/input"</li> <li>For each video in that folder, run a mencoder command (to transcode them to something playable on my phone)</li> <li>Once mencoder has finished his run, delete the original video.</li> </ol> <p>That doesn't seem t...
23
2009-07-13T16:50:53Z
1,120,814
<p><code>AVI</code> to <code>MPG</code> (pick your extensions):</p> <pre><code>files = os.listdir('/input') for sourceVideo in files: if sourceVideo[-4:] != ".avi" continue destinationVideo = sourceVideo[:-4] + ".mpg" cmdLine = ['mencoder', sourceVideo, '-ovc', 'copy', '-oac', 'copy', '-ss', ...
2
2009-07-13T17:08:33Z
[ "python", "foreach", "mencoder" ]
Using Python to execute a command on every file in a folder
1,120,707
<p>I'm trying to create a Python script that would :</p> <ol> <li>Look into the folder "/input"</li> <li>For each video in that folder, run a mencoder command (to transcode them to something playable on my phone)</li> <li>Once mencoder has finished his run, delete the original video.</li> </ol> <p>That doesn't seem t...
23
2009-07-13T16:50:53Z
1,121,204
<p>Or you could use the os.path.walk function, which does more work for you than just os.walk:</p> <p>A stupid example:</p> <pre><code>def walk_func(blah_args, dirname,names): print ' '.join(('In ',dirname,', called with ',blah_args)) for name in names: print 'Walked on ' + name if __name__ == '__main__...
1
2009-07-13T18:24:06Z
[ "python", "foreach", "mencoder" ]
Using Python to execute a command on every file in a folder
1,120,707
<p>I'm trying to create a Python script that would :</p> <ol> <li>Look into the folder "/input"</li> <li>For each video in that folder, run a mencoder command (to transcode them to something playable on my phone)</li> <li>Once mencoder has finished his run, delete the original video.</li> </ol> <p>That doesn't seem t...
23
2009-07-13T16:50:53Z
1,121,416
<p>Python might be overkill for this.</p> <pre><code>for file in *; do mencoder -some options $file; rm -f $file ; done </code></pre>
9
2009-07-13T18:58:39Z
[ "python", "foreach", "mencoder" ]
Using Python to execute a command on every file in a folder
1,120,707
<p>I'm trying to create a Python script that would :</p> <ol> <li>Look into the folder "/input"</li> <li>For each video in that folder, run a mencoder command (to transcode them to something playable on my phone)</li> <li>Once mencoder has finished his run, delete the original video.</li> </ol> <p>That doesn't seem t...
23
2009-07-13T16:50:53Z
3,583,829
<p>I had a similar problem, with a lot of help from the web and this post I made a small application, my target is VCD and SVCD and I don't delete the source but I reckon it will be fairly easy to adapt to your own needs.</p> <p>It can convert 1 video and cut it or can convert all videos in a folder, rename them and p...
1
2010-08-27T11:53:07Z
[ "python", "foreach", "mencoder" ]
Emulator Framework
1,120,709
<p>Are there any good open source frameworks for developing computer system emulators? I am particularly interested in something written in Python or Java that can reduce the effort involved in developing emulators for 8-bit processors (e.g. 6502, 6510, etc.).</p>
4
2009-07-13T16:51:04Z
1,120,817
<p>Isn't the 6510 in the C64? You might be able to make use of the java libraries that emulate c64 code</p> <p><a href="http://www.dreamfabric.com/c64/" rel="nofollow">http://www.dreamfabric.com/c64/</a></p> <p><a href="http://www.jac64.com/jac64-java-based-c64-emulator.html" rel="nofollow">http://www.jac64.com/jac6...
2
2009-07-13T17:09:11Z
[ "java", "python", "emulator", "6502", "6510" ]
Emulator Framework
1,120,709
<p>Are there any good open source frameworks for developing computer system emulators? I am particularly interested in something written in Python or Java that can reduce the effort involved in developing emulators for 8-bit processors (e.g. 6502, 6510, etc.).</p>
4
2009-07-13T16:51:04Z
1,120,882
<p>I've developed a <a href="http://eli.thegreenplace.net/files/prog%5Fcode/perlmix.zip" rel="nofollow">complete emulator for the MIX machine</a> (Knuth's imaginary computer from TAOCP) in Perl a few years ago. The source code is well documented and the simulator is runnable, so one can practice with examples. It wasn'...
1
2009-07-13T17:22:34Z
[ "java", "python", "emulator", "6502", "6510" ]
Emulator Framework
1,120,709
<p>Are there any good open source frameworks for developing computer system emulators? I am particularly interested in something written in Python or Java that can reduce the effort involved in developing emulators for 8-bit processors (e.g. 6502, 6510, etc.).</p>
4
2009-07-13T16:51:04Z
1,120,912
<p>You may want to check out <a href="http://www.viceteam.org/" rel="nofollow">VICE</a>, which can emulates a variety of Commodore 8-bit computers: "the C64, the C64DTV, the C128, the VIC20, almost all PET models, the PLUS4 and the CBM-II (aka C610)". That includes 6502, 6510 and 8502 processors. VICE is released under...
2
2009-07-13T17:31:22Z
[ "java", "python", "emulator", "6502", "6510" ]
What's the simplest possible buildout.cfg to install Zope 2?
1,120,758
<p>I know that the reccomended way to install Zope is with Buildout, but I can't seem to find a simple buildout.cfg to install a minimal Zope 2 environment. There are lots to install Plone and other things.</p> <p>I've tried:</p> <pre><code>[buildout] parts = zope [zope] recipe = plone.recipe.zope2install eggs = </c...
5
2009-07-13T16:59:56Z
1,124,896
<p>You need to tell plone.recipe.zope2install where to download Zope. Also, you'll need a zope2instance section, to create a Zope instance for you. These recipes are only needed for Zope up to version 2.11, as of 2.12 Zope has been fully eggified.</p> <p>Here is a minimal Zope 2.11 buildout.cfg:</p> <pre><code>[build...
5
2009-07-14T11:50:25Z
[ "python", "zope", "buildout" ]
Django templates: adding sections conditionally
1,120,914
<p>I just started using django for development. At the moment, I have the following issue: I have to write a page template able to represent different categories of data. For example, suppose I have a medical record of a patient. The represented information about this patient are, for example:</p> <ol> <li>name, surna...
0
2009-07-13T17:31:23Z
1,120,969
<p>See this example: <a href="http://www.djangosnippets.org/snippets/1057/" rel="nofollow">http://www.djangosnippets.org/snippets/1057/</a></p> <p>Essentially, you can loop through a model's fields in the template.</p> <p>I assume you just want to display the data present in all of these different fields correct? Loo...
2
2009-07-13T17:39:58Z
[ "python", "django", "django-templates" ]
Django templates: adding sections conditionally
1,120,914
<p>I just started using django for development. At the moment, I have the following issue: I have to write a page template able to represent different categories of data. For example, suppose I have a medical record of a patient. The represented information about this patient are, for example:</p> <ol> <li>name, surna...
0
2009-07-13T17:31:23Z
1,120,987
<p>The answer to this depends a lot on how you've structured your data, which you don't say - are the extra bits of information in separate related tables, subclassed models, individual fields on the same model...?</p> <p>In general, this sounds like a job for a template tag. I would probably write a custom tag that t...
1
2009-07-13T17:43:25Z
[ "python", "django", "django-templates" ]
Which is better in python, del or delattr?
1,120,927
<p>This may be silly, but its been nagging the back of my brain for a while. </p> <p>Python gives us two built-in ways to delete attributes from objects, the <strong>del</strong> command word and the <strong>delattr</strong> built-in function. I prefer <strong>delattr</strong> because it I think its a bit more explici...
99
2009-07-13T17:33:33Z
1,120,938
<p>It's really a matter of preference, but the first is probably preferable. I'd only use the second one if you don't know the name of the attribute that you're deleting ahead of time.</p>
12
2009-07-13T17:34:59Z
[ "python", "del" ]
Which is better in python, del or delattr?
1,120,927
<p>This may be silly, but its been nagging the back of my brain for a while. </p> <p>Python gives us two built-in ways to delete attributes from objects, the <strong>del</strong> command word and the <strong>delattr</strong> built-in function. I prefer <strong>delattr</strong> because it I think its a bit more explici...
99
2009-07-13T17:33:33Z
1,121,036
<p>Unquestionably the former. In my view this is like asking whether <code>foo.bar</code> is better than <code>getattr(foo, "bar")</code>, and I don't think anyone is asking that question :)</p>
15
2009-07-13T17:55:06Z
[ "python", "del" ]
Which is better in python, del or delattr?
1,120,927
<p>This may be silly, but its been nagging the back of my brain for a while. </p> <p>Python gives us two built-in ways to delete attributes from objects, the <strong>del</strong> command word and the <strong>delattr</strong> built-in function. I prefer <strong>delattr</strong> because it I think its a bit more explici...
99
2009-07-13T17:33:33Z
1,121,068
<p>The first is more efficient than the second. <code>del foo.bar</code> compiles to two bytecode instructions:</p> <pre><code> 2 0 LOAD_FAST 0 (foo) 3 DELETE_ATTR 0 (bar) </code></pre> <p>whereas <code>delattr(foo, "bar")</code> takes five:</p> <pre><code> 2 ...
161
2009-07-13T17:58:51Z
[ "python", "del" ]
Which is better in python, del or delattr?
1,120,927
<p>This may be silly, but its been nagging the back of my brain for a while. </p> <p>Python gives us two built-in ways to delete attributes from objects, the <strong>del</strong> command word and the <strong>delattr</strong> built-in function. I prefer <strong>delattr</strong> because it I think its a bit more explici...
99
2009-07-13T17:33:33Z
1,121,069
<p>If you think <code>delattr</code> is more explicit, then why not used <code>getattr</code> all the time rather than <code>object.attr</code>?</p> <p>As for under the hood... your guess is as good as mine. If not significantly better.</p>
0
2009-07-13T17:59:44Z
[ "python", "del" ]
Which is better in python, del or delattr?
1,120,927
<p>This may be silly, but its been nagging the back of my brain for a while. </p> <p>Python gives us two built-in ways to delete attributes from objects, the <strong>del</strong> command word and the <strong>delattr</strong> built-in function. I prefer <strong>delattr</strong> because it I think its a bit more explici...
99
2009-07-13T17:33:33Z
1,121,082
<p>Just like getattr and setattr, delattr should only be used when the attribute name is unknown.</p> <p>In that sense, it's roughly equivalent to several python features that are used to access built-in functionality at a lower level than you normally have available, such as <code>__import__</code> instead of <code>i...
5
2009-07-13T18:00:48Z
[ "python", "del" ]
Which is better in python, del or delattr?
1,120,927
<p>This may be silly, but its been nagging the back of my brain for a while. </p> <p>Python gives us two built-in ways to delete attributes from objects, the <strong>del</strong> command word and the <strong>delattr</strong> built-in function. I prefer <strong>delattr</strong> because it I think its a bit more explici...
99
2009-07-13T17:33:33Z
1,121,103
<p>Not sure about the inner workings, but from a code reusability and don't be a jerk coworker perspective, use del. It's more clear and understood by people coming from other languages as well.</p>
3
2009-07-13T18:03:59Z
[ "python", "del" ]
Which is better in python, del or delattr?
1,120,927
<p>This may be silly, but its been nagging the back of my brain for a while. </p> <p>Python gives us two built-in ways to delete attributes from objects, the <strong>del</strong> command word and the <strong>delattr</strong> built-in function. I prefer <strong>delattr</strong> because it I think its a bit more explici...
99
2009-07-13T17:33:33Z
19,380,479
<ul> <li><strong>del</strong> is more explicit and efficient;</li> <li><strong>delattr</strong> allows dynamic attribute deleting.</li> </ul> <p>Consider the following examples:</p> <pre><code>for name in ATTRIBUTES: delattr(obj, name) </code></pre> <p>or:</p> <pre><code>def _cleanup(self, name): """Do clea...
17
2013-10-15T11:49:04Z
[ "python", "del" ]
Which is better in python, del or delattr?
1,120,927
<p>This may be silly, but its been nagging the back of my brain for a while. </p> <p>Python gives us two built-in ways to delete attributes from objects, the <strong>del</strong> command word and the <strong>delattr</strong> built-in function. I prefer <strong>delattr</strong> because it I think its a bit more explici...
99
2009-07-13T17:33:33Z
24,630,541
<p>It is an old question, but I would like to put my 2 cents in. </p> <p>Though, <code>del foo.bar</code> is more elegant, at times you will need <code>delattr(foo, "bar")</code>. Say, if you have an interactive command line interface that allows a user to dynamically delete any member in the object by <em>typing the ...
1
2014-07-08T11:23:29Z
[ "python", "del" ]
How do you address data returned to a socket in python?
1,120,976
<p>Say you are telneting into IRC to figure out how it all works. As you issue commands the IRC server returns data telling you what it's doing. Once I have created a default script that basically is how a normal IRC connection between server and client occurs, if it ever deviates from that it won't tell me what is w...
0
2009-07-13T17:40:52Z
1,121,056
<p><a href="http://twistedmatrix.com/trac/" rel="nofollow">Twisted</a> is an event-driven networking engine written in Python, and includes support for <code>IRC</code> protocols. To access <code>IRC</code> functionality, import it:</p> <pre><code>from twisted.words.protocols import irc </code></pre> <p>See an <a hre...
0
2009-07-13T17:57:27Z
[ "python", "sockets", "irc" ]
How do you address data returned to a socket in python?
1,120,976
<p>Say you are telneting into IRC to figure out how it all works. As you issue commands the IRC server returns data telling you what it's doing. Once I have created a default script that basically is how a normal IRC connection between server and client occurs, if it ever deviates from that it won't tell me what is w...
0
2009-07-13T17:40:52Z
1,121,162
<p>Here's a tutorial which pretty much walks you through an IRC client using sockets in Python:</p> <ul> <li><a href="http://www.devshed.com/index2.php?option=content&amp;task=view&amp;id=607&amp;pop=1&amp;hide%5Fads=1&amp;page=0&amp;hide%5Fjs=1" rel="nofollow">Python and IRC</a></li> </ul>
1
2009-07-13T18:14:26Z
[ "python", "sockets", "irc" ]
Improve a IRC Client in Python
1,121,002
<p>How i can make some improvement in my IRC client made in Python. The improvement is: How i can put something that the user can type the <em>HOST, PORT, NICK, INDENT and REALNAME</em> strings and the message? And here is the code of the program:</p> <blockquote> <p>simplebot.py</p> <pre><code>import sys import so...
0
2009-07-13T17:47:09Z
1,121,023
<p>You already have the blueprint there for what you want it to do. You're doing:</p> <pre><code>if(line[0]=="PING"): </code></pre> <p>No reason you couldn't adapt that scheme to accept input of <code>PORT</code>, <code>NICK</code>, etc.</p> <p>Also, while 1 isn't very Pythonic. Yes it works, but really there is no ...
2
2009-07-13T17:51:36Z
[ "python", "sockets", "client", "python-3.x", "irc" ]
Improve a IRC Client in Python
1,121,002
<p>How i can make some improvement in my IRC client made in Python. The improvement is: How i can put something that the user can type the <em>HOST, PORT, NICK, INDENT and REALNAME</em> strings and the message? And here is the code of the program:</p> <blockquote> <p>simplebot.py</p> <pre><code>import sys import so...
0
2009-07-13T17:47:09Z
1,121,110
<p>Not a direct answer, but you should check the <code>IRC</code> implementation in <a href="http://twistedmatrix.com/" rel="nofollow">twisted</a>, an event-driven networking engine written in Python that includes support for <code>irc</code> in <code>twisted.words.protocols.irc</code>.</p>
1
2009-07-13T18:04:39Z
[ "python", "sockets", "client", "python-3.x", "irc" ]
Improve a IRC Client in Python
1,121,002
<p>How i can make some improvement in my IRC client made in Python. The improvement is: How i can put something that the user can type the <em>HOST, PORT, NICK, INDENT and REALNAME</em> strings and the message? And here is the code of the program:</p> <blockquote> <p>simplebot.py</p> <pre><code>import sys import so...
0
2009-07-13T17:47:09Z
1,121,163
<p>If you're brand new to Python, an IRC client is quite an undertaking, especially if you haven't worked with similar clients before in other languages.</p> <p>I would recommend you to look up on threading, so that you can put your IRC handler on a separate thread, and receive user input on another thread (If you do ...
0
2009-07-13T18:15:05Z
[ "python", "sockets", "client", "python-3.x", "irc" ]
Improve a IRC Client in Python
1,121,002
<p>How i can make some improvement in my IRC client made in Python. The improvement is: How i can put something that the user can type the <em>HOST, PORT, NICK, INDENT and REALNAME</em> strings and the message? And here is the code of the program:</p> <blockquote> <p>simplebot.py</p> <pre><code>import sys import so...
0
2009-07-13T17:47:09Z
1,121,166
<p>So you want the user to control the exact connection information that the IRC client uses? In order to do this, you must collect input from the user before you start your connection using the <a href="http://docs.python.org/library/functions.html#raw%5Finput" rel="nofollow">raw_input</a> function.</p> <p>NOTE: raw_...
2
2009-07-13T18:15:52Z
[ "python", "sockets", "client", "python-3.x", "irc" ]