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
Putting Copyright Symbol into a Python File
221,376
<p>I need to include a copyright statement at the top of every Python source file I produce:</p> <pre><code># Copyright: © 2008 etc. </code></pre> <p>However, when I then run such a file I get this message:</p> <p>SyntaxError: Non-ASCII character '\xa9' in file MyFile.py on line 3, but no encoding declared; see <...
11
2008-10-21T10:15:16Z
1,235,665
<p>For Python 2, the "right" thing to do is to specify the encoding, or never use non-ASCII characters. Specifying the encoding makes it simpler on the compiler and on humans. Sorry, but Python originally specified ASCII as the default, back in the Dark Ages.</p> <p>For Python 3, UTF-8 is the default encoding, so yo...
1
2009-08-05T20:48:45Z
[ "python", "encoding" ]
Putting Copyright Symbol into a Python File
221,376
<p>I need to include a copyright statement at the top of every Python source file I produce:</p> <pre><code># Copyright: © 2008 etc. </code></pre> <p>However, when I then run such a file I get this message:</p> <p>SyntaxError: Non-ASCII character '\xa9' in file MyFile.py on line 3, but no encoding declared; see <...
11
2008-10-21T10:15:16Z
19,210,542
<p>Put this line at first:</p> <pre><code># -*- coding: utf-8 -*- </code></pre>
1
2013-10-06T15:32:56Z
[ "python", "encoding" ]
Removing a sequence of characters from a large binary file using python
221,386
<p>I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binary files. Can it be done in something like numpy?</p>
3
2008-10-21T10:21:46Z
221,407
<p>If two copies fit in memory, then you can easily make a copy. The second copy is the compressed version. Sure, you can use numpy, but you can also use the <a href="http://www.python.org/doc/2.5.2/lib/module-array.html" rel="nofollow">array</a> package. Additionally, you can treat your big binary object as a strin...
2
2008-10-21T10:33:57Z
[ "python", "numpy", "binaryfiles" ]
Removing a sequence of characters from a large binary file using python
221,386
<p>I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binary files. Can it be done in something like numpy?</p>
3
2008-10-21T10:21:46Z
221,696
<p>You need to make your question more precise. Do you know the values you want to trim ahead of time?</p> <p>Assuming you do, I would probably search for the matching sections using <code>subprocess</code> to run "<code>fgrep -o -b &lt;search string&gt;</code>" and then change the relevant sections of the file using...
0
2008-10-21T12:48:00Z
[ "python", "numpy", "binaryfiles" ]
Removing a sequence of characters from a large binary file using python
221,386
<p>I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binary files. Can it be done in something like numpy?</p>
3
2008-10-21T10:21:46Z
221,851
<p>If you don't have the memory to do <code>open("big.file").read()</code>, then numpy wont really help.. It uses the same memory as python variables do (if you have 1GB of RAM, you can only load 1GB of data into numpy)</p> <p>The solution is simple - read the file in chunks.. <code>f = open("big.file", "rb")</code>, ...
4
2008-10-21T13:18:37Z
[ "python", "numpy", "binaryfiles" ]
Removing a sequence of characters from a large binary file using python
221,386
<p>I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binary files. Can it be done in something like numpy?</p>
3
2008-10-21T10:21:46Z
1,008,370
<p>dbr's solution is a good idea but a bit overly complicated all you really have to do is rewind the file pointer the length of the sequence you are searching for, before you read your next chunk.</p> <pre><code>def ReplaceSequence(inFilename, outFilename, oldSeq, newSeq): inputFile = open(inFilename, "rb") output...
1
2009-06-17T17:04:42Z
[ "python", "numpy", "binaryfiles" ]
Removing a sequence of characters from a large binary file using python
221,386
<p>I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binary files. Can it be done in something like numpy?</p>
3
2008-10-21T10:21:46Z
1,008,461
<p>This generator-based version will keep exactly one character of the file content in memory at a time.</p> <p>Note that I am taking your question title quite literally - you want to reduce runs of the same <em>character</em> to a single character. For replacing patterns in general, this does not work:</p> <pre><co...
0
2009-06-17T17:23:38Z
[ "python", "numpy", "binaryfiles" ]
Removing a sequence of characters from a large binary file using python
221,386
<p>I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binary files. Can it be done in something like numpy?</p>
3
2008-10-21T10:21:46Z
13,611,980
<p>AJMayorga suggestion is fine unless the sizes of the replacement strings are different. Or the replacement string is at the end of the chunk.</p> <p>I fixed it like this:</p> <pre><code>def ReplaceSequence(inFilename, outFilename, oldSeq, newSeq): inputFile = open(inFilename, "rb") outputFile = open(outFi...
1
2012-11-28T18:30:10Z
[ "python", "numpy", "binaryfiles" ]
Is it possible to set a timeout on a socket in Twisted?
221,745
<p>I realize I'm probably just dumb and missing something big and important, but I can't figure out how to specify a timeout in twisted using reactor.listenUDP. My goal is to be able to specify a timeout, and after said amount of time, if DatagramProtocol.datagramReceived has not been executed, have it execute a callba...
8
2008-10-21T12:56:32Z
221,832
<p>Since Twisted is event driven, you don't need a timeout per se. You simply need to set a state variable (like datagramRecieved) when you receive a datagram and register a <a href="http://twistedmatrix.com/projects/core/documentation/howto/time.html" rel="nofollow">looping call</a> that checks the state variable, st...
5
2008-10-21T13:15:01Z
[ "python", "networking", "sockets", "twisted" ]
Is it possible to set a timeout on a socket in Twisted?
221,745
<p>I realize I'm probably just dumb and missing something big and important, but I can't figure out how to specify a timeout in twisted using reactor.listenUDP. My goal is to be able to specify a timeout, and after said amount of time, if DatagramProtocol.datagramReceived has not been executed, have it execute a callba...
8
2008-10-21T12:56:32Z
251,302
<p>I think <code>reactor.callLater</code> would work better than <code>LoopingCall</code>. Something like this:</p> <pre><code>class Protocol(DatagramProtocol): def __init__(self, timeout): self.timeout = timeout def datagramReceived(self, datagram): self.timeout.cancel() # ... timeou...
13
2008-10-30T18:52:01Z
[ "python", "networking", "sockets", "twisted" ]
Is it possible to set a timeout on a socket in Twisted?
221,745
<p>I realize I'm probably just dumb and missing something big and important, but I can't figure out how to specify a timeout in twisted using reactor.listenUDP. My goal is to be able to specify a timeout, and after said amount of time, if DatagramProtocol.datagramReceived has not been executed, have it execute a callba...
8
2008-10-21T12:56:32Z
11,810,177
<p>with reactor we must use callLater. Start timeout countdown when connectionMade. Reset timeout countdown when lineReceived.</p> <p>Here's the </p> <pre><code># -*- coding: utf-8 -*- from twisted.internet.protocol import Factory from twisted.protocols.basic import LineReceiver from twisted.internet import reactor,...
3
2012-08-04T16:26:20Z
[ "python", "networking", "sockets", "twisted" ]
Is it possible to set a timeout on a socket in Twisted?
221,745
<p>I realize I'm probably just dumb and missing something big and important, but I can't figure out how to specify a timeout in twisted using reactor.listenUDP. My goal is to be able to specify a timeout, and after said amount of time, if DatagramProtocol.datagramReceived has not been executed, have it execute a callba...
8
2008-10-21T12:56:32Z
24,895,751
<p>A better way to do this is with <code>twisted.protocols.policies.TimeoutMixin</code>. It's essentially doing a <code>callLater</code> but abstracted into a <code>Mixin</code>.</p>
0
2014-07-22T19:09:07Z
[ "python", "networking", "sockets", "twisted" ]
Best approach with dynamic classes using Python globals()
222,133
<p>I'm working on a web application that will return a variable set of modules depending on user input. Each module is a Python class with a constructor that accepts a single parameter and has an '.html' property that contains the output.</p> <p>Pulling the class dynamically from the global namespace works:</p> <pre>...
6
2008-10-21T14:41:54Z
222,307
<p>First of all, it sounds like you may be reinventing the wheel a little bit... most Python web frameworks (CherryPy/TurboGears is what I know) already include a way to dispatch requests to specific classes based on the contents of the URL, or the user input.</p> <p>There is nothing <strong>wrong</strong> with the wa...
4
2008-10-21T15:32:59Z
[ "python", "coding-style", "namespaces" ]
Best approach with dynamic classes using Python globals()
222,133
<p>I'm working on a web application that will return a variable set of modules depending on user input. Each module is a Python class with a constructor that accepts a single parameter and has an '.html' property that contains the output.</p> <p>Pulling the class dynamically from the global namespace works:</p> <pre>...
6
2008-10-21T14:41:54Z
222,334
<p>A flaw with this approach is that it may give the user the ability to to more than you want them to. They can call <em>any</em> single-parameter function in that namespace just by providing the name. You can help guard against this with a few checks (eg. isinstance(SomeBaseClass, theClass), but its probably better...
6
2008-10-21T15:43:46Z
[ "python", "coding-style", "namespaces" ]
Best approach with dynamic classes using Python globals()
222,133
<p>I'm working on a web application that will return a variable set of modules depending on user input. Each module is a Python class with a constructor that accepts a single parameter and has an '.html' property that contains the output.</p> <p>Pulling the class dynamically from the global namespace works:</p> <pre>...
6
2008-10-21T14:41:54Z
224,641
<p>Another way to build the map between class names and classes:</p> <p>When defining classes, add an attribute to any class that you want to put in the lookup table, e.g.:</p> <pre><code>class Foo: lookup = True def __init__(self, params): # and so on </code></pre> <p>Once this is done, building the...
0
2008-10-22T06:18:41Z
[ "python", "coding-style", "namespaces" ]
ElementTree XPath - Select Element based on attribute
222,375
<p>I am having trouble using the attribute XPath Selector in ElementTree, which I should be able to do according to the <a href="http://effbot.org/zone/element-xpath.htm">Documentation</a></p> <p>Here's some sample code</p> <p><strong>XML</strong></p> <pre><code>&lt;root&gt; &lt;target name="1"&gt; &lt;a&gt;&lt...
34
2008-10-21T15:52:51Z
222,466
<p>Looks like findall only supports a subset XPath. See the mailing list discussion <a href="http://codespeak.net/pipermail/lxml-dev/2006-May/001294.html" rel="nofollow">here</a></p>
3
2008-10-21T16:14:28Z
[ "python", "elementtree" ]
ElementTree XPath - Select Element based on attribute
222,375
<p>I am having trouble using the attribute XPath Selector in ElementTree, which I should be able to do according to the <a href="http://effbot.org/zone/element-xpath.htm">Documentation</a></p> <p>Here's some sample code</p> <p><strong>XML</strong></p> <pre><code>&lt;root&gt; &lt;target name="1"&gt; &lt;a&gt;&lt...
34
2008-10-21T15:52:51Z
222,473
<p>The syntax you're trying to use is new in <strong><a href="http://effbot.org/zone/element-xpath.htm">ElementTree 1.3</a></strong>.</p> <p>Such version is shipped with <strong>Python 2.7</strong> or higher. If you have Python 2.6 or less you still have ElementTree 1.2.6 or less.</p>
32
2008-10-21T16:16:06Z
[ "python", "elementtree" ]
ElementTree XPath - Select Element based on attribute
222,375
<p>I am having trouble using the attribute XPath Selector in ElementTree, which I should be able to do according to the <a href="http://effbot.org/zone/element-xpath.htm">Documentation</a></p> <p>Here's some sample code</p> <p><strong>XML</strong></p> <pre><code>&lt;root&gt; &lt;target name="1"&gt; &lt;a&gt;&lt...
34
2008-10-21T15:52:51Z
16,105,230
<p>There are several problems in this code.</p> <ol> <li><p>Python's buildin ElementTree (ET for short) has no real XPATH support; only a limited subset By example, it doesn't support <em>find-from-root</em> expressions like <code>//target</code>. </p> <p>Notice: the <a href="http://docs.python.org/2/library/xml.etr...
8
2013-04-19T13:00:16Z
[ "python", "elementtree" ]
How to script Visual Studio 2008 from Python?
222,450
<p>I'd like to write Python scripts that drive Visual Studio 2008 and Visual C++ 2008. All the examples I've found so far use <code>win32com.client.Dispatch</code>. This works fine for Excel 2007 and Word 2007 but fails for Visual Studio 2008:</p> <pre><code>import win32com.client app1 = win32com.client.Dispatch( 'E...
7
2008-10-21T16:08:55Z
222,459
<p>You can try <em>.Net</em>'s own version, <a href="http://www.codeplex.com/ironpython" rel="nofollow">IronPython</a>. It has a <em>VS</em> addon, <a href="http://www.codeplex.com/IronPythonStudio" rel="nofollow">IronPythonStudio</a>.</p> <p>Being a <em>.Net</em> language, you can access all the available assemblies,...
2
2008-10-21T16:12:04Z
[ "python", "visual-studio", "visual-studio-2008", "visual-c++" ]
How to script Visual Studio 2008 from Python?
222,450
<p>I'd like to write Python scripts that drive Visual Studio 2008 and Visual C++ 2008. All the examples I've found so far use <code>win32com.client.Dispatch</code>. This works fine for Excel 2007 and Word 2007 but fails for Visual Studio 2008:</p> <pre><code>import win32com.client app1 = win32com.client.Dispatch( 'E...
7
2008-10-21T16:08:55Z
223,002
<p>Depending on what exactly you're trying to do, <a href="http://www.autoitscript.com/autoit3/index.shtml" rel="nofollow">AutoIt</a> may meet your needs. In fact, I'm sure it will do anything you need it to do.</p> <p>Taken from my <a href="http://stackoverflow.com/questions/151846/get-other-running-processes-window...
3
2008-10-21T18:49:14Z
[ "python", "visual-studio", "visual-studio-2008", "visual-c++" ]
How to script Visual Studio 2008 from Python?
222,450
<p>I'd like to write Python scripts that drive Visual Studio 2008 and Visual C++ 2008. All the examples I've found so far use <code>win32com.client.Dispatch</code>. This works fine for Excel 2007 and Word 2007 but fails for Visual Studio 2008:</p> <pre><code>import win32com.client app1 = win32com.client.Dispatch( 'E...
7
2008-10-21T16:08:55Z
223,886
<p>I don't know if this will help you with 2008, but with Visual Studio 2005 and win32com I'm able to do this:</p> <pre><code>&gt;&gt;&gt; import win32com.client &gt;&gt;&gt; b = win32com.client.Dispatch('VisualStudio.DTE') &gt;&gt;&gt; b &lt;COMObject VisualStudio.DTE&gt; &gt;&gt;&gt; b.name u'Microsoft Visual Studio...
3
2008-10-21T23:08:12Z
[ "python", "visual-studio", "visual-studio-2008", "visual-c++" ]
How to script Visual Studio 2008 from Python?
222,450
<p>I'd like to write Python scripts that drive Visual Studio 2008 and Visual C++ 2008. All the examples I've found so far use <code>win32com.client.Dispatch</code>. This works fine for Excel 2007 and Word 2007 but fails for Visual Studio 2008:</p> <pre><code>import win32com.client app1 = win32com.client.Dispatch( 'E...
7
2008-10-21T16:08:55Z
982,565
<p>ryan_s has the right answer. You might rethink using win32com.</p> <p>I prefer the comtypes module to win32com. It fits in better with ctypes and python in general.</p> <p>Using either approach with vs 2008 will work. Here is an example that prints the names and keyboard shortcuts for all the commands in Visual St...
3
2009-06-11T17:42:16Z
[ "python", "visual-studio", "visual-studio-2008", "visual-c++" ]
How to script Visual Studio 2008 from Python?
222,450
<p>I'd like to write Python scripts that drive Visual Studio 2008 and Visual C++ 2008. All the examples I've found so far use <code>win32com.client.Dispatch</code>. This works fine for Excel 2007 and Word 2007 but fails for Visual Studio 2008:</p> <pre><code>import win32com.client app1 = win32com.client.Dispatch( 'E...
7
2008-10-21T16:08:55Z
20,095,416
<p>As of year 2013, better option can be to script <code>Visual Studio</code> via <code>IronPython</code> cause better <code>CLR</code>/<code>COM</code> and other MS stuff integration:</p> <pre><code> import clr import System t = System.Type.GetTypeFromProgID("AutoItX3.Control") oAutoItX = System.Activator.CreateInst...
0
2013-11-20T12:00:39Z
[ "python", "visual-studio", "visual-studio-2008", "visual-c++" ]
What is the meaning of '(?i)password' in python regular expression?
222,536
<p>Pexpect can be used to automate tasks in python (does not need TCL to be installed). One of the simplest routines of this class is the 'run()' routine. It accepts a dictionary of expected question patterns as keys and the responses as values. For example</p> <p>pexpect.run ('scp foo myname@host.example.com:.', even...
4
2008-10-21T16:29:51Z
222,556
<p><a href="https://docs.python.org/library/re.html#regular-expression-syntax" rel="nofollow">https://docs.python.org/library/re.html#regular-expression-syntax</a></p> <blockquote> <p>(?...) This is an extension notation (a "?" following a "(" is not meaningful otherwise). The first character after the "?" ...
7
2008-10-21T16:34:50Z
[ "python", "regex", "pattern-matching" ]
What is the meaning of '(?i)password' in python regular expression?
222,536
<p>Pexpect can be used to automate tasks in python (does not need TCL to be installed). One of the simplest routines of this class is the 'run()' routine. It accepts a dictionary of expected question patterns as keys and the responses as values. For example</p> <p>pexpect.run ('scp foo myname@host.example.com:.', even...
4
2008-10-21T16:29:51Z
222,586
<p>This is an extension in the regular expression syntax in the re module of Python. The "i" means "ignore case". This means a case insensitive search for "password" is done.</p> <p>from <a href="https://docs.python.org/library/re.html#regular-expression-syntax" rel="nofollow">https://docs.python.org/library/re.html#r...
4
2008-10-21T16:43:07Z
[ "python", "regex", "pattern-matching" ]
cherrypy not closing the sockets
222,736
<p>I am using cherrypy as a webserver. It gives good performance for my application but there is a very big problem with it. cherrypy crashes after couple of hours stating that it could not create a socket as there are too many files open:</p> <pre><code>[21/Oct/2008:12:44:25] ENGINE HTTP Server cherrypy._cpwsgi_serv...
2
2008-10-21T17:33:26Z
223,137
<p>I imagine you're storing (in-memory) some piece of data which has a reference to the socket; if you store the request objects anywhere, for instance, that would likely do it.</p> <p>The last-ditch chance for sockets to be closed is when they're garbage-collected; if you're doing anything that would prevent garbage ...
4
2008-10-21T19:22:18Z
[ "python", "sockets", "cherrypy" ]
Sorting a tuple that contains tuples
222,752
<p>I have the following tuple, which contains tuples:</p> <pre><code>MY_TUPLE = ( ('A','Apple'), ('C','Carrot'), ('B','Banana'), ) </code></pre> <p>I'd like to sort this tuple based upon the <strong>second</strong> value contained in inner-tuples (i.e., sort Apple, Carrot, Banana rather than A, B, C).</p>...
12
2008-10-21T17:40:51Z
222,762
<pre><code>from operator import itemgetter MY_SORTED_TUPLE = tuple(sorted(MY_TUPLE, key=itemgetter(1))) </code></pre> <p>or without <code>itemgetter</code>:</p> <pre><code>MY_SORTED_TUPLE = tuple(sorted(MY_TUPLE, key=lambda item: item[1])) </code></pre>
21
2008-10-21T17:44:08Z
[ "python", "sorting", "tuples" ]
Sorting a tuple that contains tuples
222,752
<p>I have the following tuple, which contains tuples:</p> <pre><code>MY_TUPLE = ( ('A','Apple'), ('C','Carrot'), ('B','Banana'), ) </code></pre> <p>I'd like to sort this tuple based upon the <strong>second</strong> value contained in inner-tuples (i.e., sort Apple, Carrot, Banana rather than A, B, C).</p>...
12
2008-10-21T17:40:51Z
222,769
<pre><code>sorted(my_tuple, key=lambda tup: tup[1]) </code></pre> <p>In other words, when comparing two elements of the tuple you're sorting, sort based on the return value of the function passed as the key parameter.</p>
2
2008-10-21T17:45:12Z
[ "python", "sorting", "tuples" ]
Sorting a tuple that contains tuples
222,752
<p>I have the following tuple, which contains tuples:</p> <pre><code>MY_TUPLE = ( ('A','Apple'), ('C','Carrot'), ('B','Banana'), ) </code></pre> <p>I'd like to sort this tuple based upon the <strong>second</strong> value contained in inner-tuples (i.e., sort Apple, Carrot, Banana rather than A, B, C).</p>...
12
2008-10-21T17:40:51Z
222,776
<p>From <a href="http://wiki.python.org/moin/HowTo/Sorting#head-d121eed08556ad7cb2a02a886788656dadb709bd">Sorting Mini-HOW TO</a></p> <blockquote> <p>Often there's a built-in that will match your needs, such as str.lower(). The operator module contains a number of functions useful for this purpose. For examp...
7
2008-10-21T17:45:56Z
[ "python", "sorting", "tuples" ]
Sorting a tuple that contains tuples
222,752
<p>I have the following tuple, which contains tuples:</p> <pre><code>MY_TUPLE = ( ('A','Apple'), ('C','Carrot'), ('B','Banana'), ) </code></pre> <p>I'd like to sort this tuple based upon the <strong>second</strong> value contained in inner-tuples (i.e., sort Apple, Carrot, Banana rather than A, B, C).</p>...
12
2008-10-21T17:40:51Z
222,789
<p>I achieved the same thing using this code, but your suggestion is great. Thanks!</p> <pre><code>templist = [ (line[1], line) for line in MY_TUPLE ] templist.sort() SORTED_MY_TUPLE = [ line[1] for line in templist ] </code></pre>
-2
2008-10-21T17:52:01Z
[ "python", "sorting", "tuples" ]
How to use 'super' in Python?
222,877
<p>Can someone explain to me the difference between doing:</p> <pre><code>class Child(SomeBaseClass): def __init__(self): super(Child, self).__init__() </code></pre> <p>and this:</p> <pre><code>class Child(SomeBaseClass): def __init__(self): SomeBaseClass.__init__(self) </code></pre> <p>I've...
221
2008-10-21T18:13:15Z
222,922
<p>The benefits of <code>super()</code> in single-inheritance are minimal -- mostly, you don't have to hard-code the name of the base class into every method that uses its parent methods.</p> <p>However, it's almost impossible to use multiple-inheritance without <code>super()</code>. This includes common idioms like m...
156
2008-10-21T18:24:50Z
[ "python", "inheritance", "super" ]
How to use 'super' in Python?
222,877
<p>Can someone explain to me the difference between doing:</p> <pre><code>class Child(SomeBaseClass): def __init__(self): super(Child, self).__init__() </code></pre> <p>and this:</p> <pre><code>class Child(SomeBaseClass): def __init__(self): SomeBaseClass.__init__(self) </code></pre> <p>I've...
221
2008-10-21T18:13:15Z
224,020
<p>Doesn't all of this assume that the base class is inherited from <code>object</code>?</p> <pre><code>class A: def __init__(self): print "A.__init__()" class B(A): def __init__(self): print "B.__init__()" super(B, self).__init__() </code></pre> <p>Will not work. <code>class A</code>...
23
2008-10-22T00:06:32Z
[ "python", "inheritance", "super" ]
How to use 'super' in Python?
222,877
<p>Can someone explain to me the difference between doing:</p> <pre><code>class Child(SomeBaseClass): def __init__(self): super(Child, self).__init__() </code></pre> <p>and this:</p> <pre><code>class Child(SomeBaseClass): def __init__(self): SomeBaseClass.__init__(self) </code></pre> <p>I've...
221
2008-10-21T18:13:15Z
33,469,090
<blockquote> <p>Can someone explain to me the difference between doing:</p> <pre><code>class Child(SomeBaseClass): def __init__(self): super(Child, self).__init__() </code></pre> <p>and this:</p> <pre><code>class Child(SomeBaseClass): def __init__(self): SomeBaseClass.__init__(self) </c...
41
2015-11-02T00:53:24Z
[ "python", "inheritance", "super" ]
How to use 'super' in Python?
222,877
<p>Can someone explain to me the difference between doing:</p> <pre><code>class Child(SomeBaseClass): def __init__(self): super(Child, self).__init__() </code></pre> <p>and this:</p> <pre><code>class Child(SomeBaseClass): def __init__(self): SomeBaseClass.__init__(self) </code></pre> <p>I've...
221
2008-10-21T18:13:15Z
39,376,081
<p>When calling <code>super()</code> to resolve to a parent's version of a classmethod, instance method, or staticmethod, we want to pass the current class whose scope we are in as the first argument, to indicate which parent's scope we're trying to resolve to, and as a second argument the object of interest to indicat...
3
2016-09-07T17:33:28Z
[ "python", "inheritance", "super" ]
How do you get the text from an HTML 'datacell' using BeautifulSoup
223,328
<p>I have been trying to strip out some data from HTML files. I have the logic coded to get the right cells. Now I am struggling to get the actual contents of the 'cell':</p> <p>here is my htm snip</p> <p>headerRows[0][10].contents</p> <pre><code> [&lt;font size="+0"&gt;&lt;font face="serif" size="1"&gt;&lt;b&gt;...
6
2008-10-21T20:16:13Z
223,534
<p>The <a href="http://www.crummy.com/software/BeautifulSoup/documentation.html" rel="nofollow">BeautifulSoup documentation</a> should cover everything you need - in this case it looks like you want to use <code>findNext</code>:</p> <pre><code>headerRows[0][10].findNext('b').string </code></pre> <p>A more generic sol...
5
2008-10-21T21:14:21Z
[ "python", "html", "parsing", "beautifulsoup" ]
How do you get the text from an HTML 'datacell' using BeautifulSoup
223,328
<p>I have been trying to strip out some data from HTML files. I have the logic coded to get the right cells. Now I am struggling to get the actual contents of the 'cell':</p> <p>here is my htm snip</p> <p>headerRows[0][10].contents</p> <pre><code> [&lt;font size="+0"&gt;&lt;font face="serif" size="1"&gt;&lt;b&gt;...
6
2008-10-21T20:16:13Z
223,994
<p>I have a base class that I extend all Beautiful Soup classes with a bunch of methods that help me get at text within a group of elements that I don't necessarily want to rely on the structure of. One of those methods is the following:</p> <pre><code> def clean(self, val): if type(val) is not StringType: val = ...
0
2008-10-21T23:57:03Z
[ "python", "html", "parsing", "beautifulsoup" ]
How do you get the text from an HTML 'datacell' using BeautifulSoup
223,328
<p>I have been trying to strip out some data from HTML files. I have the logic coded to get the right cells. Now I am struggling to get the actual contents of the 'cell':</p> <p>here is my htm snip</p> <p>headerRows[0][10].contents</p> <pre><code> [&lt;font size="+0"&gt;&lt;font face="serif" size="1"&gt;&lt;b&gt;...
6
2008-10-21T20:16:13Z
629,326
<pre><code>headerRows[0][10].contents[0].find('b').string </code></pre>
3
2009-03-10T08:30:14Z
[ "python", "html", "parsing", "beautifulsoup" ]
When does urllib2 actually download a file from a url?
223,356
<pre><code>url = "http://example.com/file.xml" data = urllib2.urlopen(url) data.read() </code></pre> <p>The question is, when exactly will the file be downloaded from the internet? When i do urlopen or .read()? On my network interface I see high traffic both times. </p>
2
2008-10-21T20:23:02Z
223,389
<p>Witout looking at the code, I'd expect that the following happens:</p> <ol> <li><code>urlopen()</code> opens the connection, and sends the query. Then the server starts feeding the reply. At this point, the data accumulates in buffers until they are full and the operating system tells the server to hold on for a wh...
5
2008-10-21T20:31:01Z
[ "python" ]
When does urllib2 actually download a file from a url?
223,356
<pre><code>url = "http://example.com/file.xml" data = urllib2.urlopen(url) data.read() </code></pre> <p>The question is, when exactly will the file be downloaded from the internet? When i do urlopen or .read()? On my network interface I see high traffic both times. </p>
2
2008-10-21T20:23:02Z
223,974
<p>I agree with ddaa. However, if you want to understand this sort of thing, you can set up a dummy server using something like <code>nc</code> (in *nix) and then open the URL in the interactive Python interpreter.</p> <p>In one terminal, run <code>nc -l 1234</code> which will open a socket and listen for connections ...
5
2008-10-21T23:48:31Z
[ "python" ]
Using Variables for Class Names in Python?
223,559
<p>I want to know how to use variables for objects and function names in Python. In PHP, you can do this:</p> <pre><code>$className = "MyClass"; $newObject = new $className(); </code></pre> <p>How do you do this sort of thing in Python? Or, am I totally not appreciating some fundamental difference with Python, and i...
27
2008-10-21T21:24:24Z
223,566
<p>In Python,</p> <pre><code>className = MyClass newObject = className() </code></pre> <p>The first line makes the variable <code>className</code> refer to the same thing as <code>MyClass</code>. Then the next line calls the <code>MyClass</code> constructor through the <code>className</code> variable.</p> <p>As a co...
27
2008-10-21T21:26:09Z
[ "python", "dynamic-typing" ]
Using Variables for Class Names in Python?
223,559
<p>I want to know how to use variables for objects and function names in Python. In PHP, you can do this:</p> <pre><code>$className = "MyClass"; $newObject = new $className(); </code></pre> <p>How do you do this sort of thing in Python? Or, am I totally not appreciating some fundamental difference with Python, and i...
27
2008-10-21T21:24:24Z
223,584
<p>If you have this:</p> <pre><code>class MyClass: def __init__(self): print "MyClass" </code></pre> <p>Then you usually do this:</p> <pre><code>&gt;&gt;&gt; x = MyClass() MyClass </code></pre> <p>But you could also do this, which is what I think you're asking:</p> <pre><code>&gt;&gt;&gt; a = "MyClass"...
3
2008-10-21T21:32:34Z
[ "python", "dynamic-typing" ]
Using Variables for Class Names in Python?
223,559
<p>I want to know how to use variables for objects and function names in Python. In PHP, you can do this:</p> <pre><code>$className = "MyClass"; $newObject = new $className(); </code></pre> <p>How do you do this sort of thing in Python? Or, am I totally not appreciating some fundamental difference with Python, and i...
27
2008-10-21T21:24:24Z
223,586
<p>Assuming that some_module has a class named "class_name":</p> <pre><code>import some_module klass = getattr(some_module, "class_name") some_object = klass() </code></pre> <p>I should note that you should be careful here: turning strings into code can be dangerous if the string came from the user, so you should ke...
41
2008-10-21T21:33:05Z
[ "python", "dynamic-typing" ]
Using Variables for Class Names in Python?
223,559
<p>I want to know how to use variables for objects and function names in Python. In PHP, you can do this:</p> <pre><code>$className = "MyClass"; $newObject = new $className(); </code></pre> <p>How do you do this sort of thing in Python? Or, am I totally not appreciating some fundamental difference with Python, and i...
27
2008-10-21T21:24:24Z
2,875,113
<p>If you need to create a dynamic class in Python (i.e. one whose name is a variable) you can use type() which takes 3 params: name, bases, attrs</p> <pre><code>&gt;&gt;&gt; class_name = 'MyClass' &gt;&gt;&gt; klass = type(class_name, (object,), {'msg': 'foobarbaz'}) &lt;class '__main__.MyClass'&gt; &gt;&gt;&gt; in...
15
2010-05-20T15:14:38Z
[ "python", "dynamic-typing" ]
Elegant structured text file parsing
223,866
<p>I need to parse a transcript of a live chat conversation. My first thought on seeing the file was to throw regular expressions at the problem but I was wondering what other approaches people have used. </p> <p>I put elegant in the title as i've previously found that this type of task has a danger of getting hard to...
19
2008-10-21T23:00:20Z
223,904
<p>Using multiline, commented regexs can mitigate the maintainance problem somewhat. Try and avoid the one line super regex!</p> <p>Also, consider breaking the regex down into individual tasks, one for each 'thing' you want to get. eg.</p> <pre><code>visitor = text.find(/Visitor:(.*)/) operator = text.find(/Operator:...
4
2008-10-21T23:18:14Z
[ "python", "ruby", "perl", "text-parsing" ]
Elegant structured text file parsing
223,866
<p>I need to parse a transcript of a live chat conversation. My first thought on seeing the file was to throw regular expressions at the problem but I was wondering what other approaches people have used. </p> <p>I put elegant in the title as i've previously found that this type of task has a danger of getting hard to...
19
2008-10-21T23:00:20Z
223,925
<p>No and in fact, for the specific type of task you describe, I doubt there's a "cleaner" way to do it than regular expressions. It looks like your files have embedded line breaks so typically what we'll do here is make the line your unit of decomposition, applying per-line regexes. Meanwhile, you create a small state...
12
2008-10-21T23:25:53Z
[ "python", "ruby", "perl", "text-parsing" ]
Elegant structured text file parsing
223,866
<p>I need to parse a transcript of a live chat conversation. My first thought on seeing the file was to throw regular expressions at the problem but I was wondering what other approaches people have used. </p> <p>I put elegant in the title as i've previously found that this type of task has a danger of getting hard to...
19
2008-10-21T23:00:20Z
224,014
<p><a href="http://pyparsing.wikispaces.com/" rel="nofollow">Build a parser</a>? I can't decide if your data is regular enough for that, but it might be worth looking into.</p>
5
2008-10-22T00:03:23Z
[ "python", "ruby", "perl", "text-parsing" ]
Elegant structured text file parsing
223,866
<p>I need to parse a transcript of a live chat conversation. My first thought on seeing the file was to throw regular expressions at the problem but I was wondering what other approaches people have used. </p> <p>I put elegant in the title as i've previously found that this type of task has a danger of getting hard to...
19
2008-10-21T23:00:20Z
224,033
<p>Just a quick post, I've only glanced at your transcript example but I've recently also had to look into text parsing and hoped to avoid going the route of hand rolled parsing. I did happen across <a href="http://www.complang.org/ragel/" rel="nofollow">Ragel</a> which I've only started to get my head around but it's ...
0
2008-10-22T00:11:12Z
[ "python", "ruby", "perl", "text-parsing" ]
Elegant structured text file parsing
223,866
<p>I need to parse a transcript of a live chat conversation. My first thought on seeing the file was to throw regular expressions at the problem but I was wondering what other approaches people have used. </p> <p>I put elegant in the title as i've previously found that this type of task has a danger of getting hard to...
19
2008-10-21T23:00:20Z
224,052
<p>You might want to consider a full parser generator. </p> <p>Regular expressions are good for searching text for small substrings but they're woefully under-powered if you're really interested in parsing the entire file into meaningful data. </p> <p>They are especially insufficient if the context of the substring i...
5
2008-10-22T00:23:33Z
[ "python", "ruby", "perl", "text-parsing" ]
Elegant structured text file parsing
223,866
<p>I need to parse a transcript of a live chat conversation. My first thought on seeing the file was to throw regular expressions at the problem but I was wondering what other approaches people have used. </p> <p>I put elegant in the title as i've previously found that this type of task has a danger of getting hard to...
19
2008-10-21T23:00:20Z
224,073
<p>Consider using Ragel <a href="http://www.complang.org/ragel/" rel="nofollow">http://www.complang.org/ragel/</a></p> <p>That's what powers mongrel under the hood. Parsing a string multiple times is going to slow things down dramatically. </p>
2
2008-10-22T00:36:12Z
[ "python", "ruby", "perl", "text-parsing" ]
Elegant structured text file parsing
223,866
<p>I need to parse a transcript of a live chat conversation. My first thought on seeing the file was to throw regular expressions at the problem but I was wondering what other approaches people have used. </p> <p>I put elegant in the title as i've previously found that this type of task has a danger of getting hard to...
19
2008-10-21T23:00:20Z
224,344
<p>With Perl, you can use <a href="http://search.cpan.org/perldoc?Parse::RecDescent" rel="nofollow">Parse::RecDescent</a></p> <p>It is simple, and your grammar will be maintainable later on.</p>
11
2008-10-22T03:01:20Z
[ "python", "ruby", "perl", "text-parsing" ]
Elegant structured text file parsing
223,866
<p>I need to parse a transcript of a live chat conversation. My first thought on seeing the file was to throw regular expressions at the problem but I was wondering what other approaches people have used. </p> <p>I put elegant in the title as i've previously found that this type of task has a danger of getting hard to...
19
2008-10-21T23:00:20Z
226,711
<p>I have used Paul McGuire's pyParsing class library and I continue to be impressed by it, in that it's well-documented, easy to get started, and the rules are easy to tweak and maintain. BTW, the rules are expressed in your python code. It certainly appears that the log file has enough regularity to parse each line a...
2
2008-10-22T17:05:41Z
[ "python", "ruby", "perl", "text-parsing" ]
Elegant structured text file parsing
223,866
<p>I need to parse a transcript of a live chat conversation. My first thought on seeing the file was to throw regular expressions at the problem but I was wondering what other approaches people have used. </p> <p>I put elegant in the title as i've previously found that this type of task has a danger of getting hard to...
19
2008-10-21T23:00:20Z
1,657,561
<p>Here's two parsers based on <a href="http://www.acooke.org/lepl/" rel="nofollow"><code>lepl</code></a> parser generator library. They both produce the same result.</p> <pre><code>from pprint import pprint from lepl import AnyBut, Drop, Eos, Newline, Separator, SkipTo, Space # field = name , ":" , value name, value...
6
2009-11-01T16:17:57Z
[ "python", "ruby", "perl", "text-parsing" ]
How do I perform query filtering in django templates
223,990
<p>I need to perform a filtered query from within a django template, to get a set of objects equivalent to python code within a view:</p> <pre><code>queryset = Modelclass.objects.filter(somekey=foo) </code></pre> <p>In my template I would like to do</p> <pre><code>{% for object in data.somekey_set.FILTER %} </code><...
50
2008-10-21T23:55:57Z
224,003
<p>You can't do this, which is by design. The Django framework authors intended a strict separation of presentation code from data logic. Filtering models is data logic, and outputting HTML is presentation logic.</p> <p>So you have several options. The easiest is to do the filtering, then pass the result to <code>r...
83
2008-10-22T00:00:27Z
[ "python", "django", "django-templates" ]
How do I perform query filtering in django templates
223,990
<p>I need to perform a filtered query from within a django template, to get a set of objects equivalent to python code within a view:</p> <pre><code>queryset = Modelclass.objects.filter(somekey=foo) </code></pre> <p>In my template I would like to do</p> <pre><code>{% for object in data.somekey_set.FILTER %} </code><...
50
2008-10-21T23:55:57Z
230,615
<p>I run into this problem on a regular basis and often use the "add a method" solution. However, there are definitely cases where "add a method" or "compute it in the view" don't work (or don't work well). E.g. when you are caching template fragments and need some non-trivial DB computation to produce it. You don't wa...
10
2008-10-23T17:22:35Z
[ "python", "django", "django-templates" ]
How do I perform query filtering in django templates
223,990
<p>I need to perform a filtered query from within a django template, to get a set of objects equivalent to python code within a view:</p> <pre><code>queryset = Modelclass.objects.filter(somekey=foo) </code></pre> <p>In my template I would like to do</p> <pre><code>{% for object in data.somekey_set.FILTER %} </code><...
50
2008-10-21T23:55:57Z
12,350,892
<p>The other option is that if you have a filter that you always want applied, to add a <a href="https://docs.djangoproject.com/en/1.4/topics/db/managers/#custom-managers">custom manager</a> on the model in question which always applies the filter to the results returned.</p> <p>A good example of this is a <code>Event...
5
2012-09-10T11:37:01Z
[ "python", "django", "django-templates" ]
How do I perform query filtering in django templates
223,990
<p>I need to perform a filtered query from within a django template, to get a set of objects equivalent to python code within a view:</p> <pre><code>queryset = Modelclass.objects.filter(somekey=foo) </code></pre> <p>In my template I would like to do</p> <pre><code>{% for object in data.somekey_set.FILTER %} </code><...
50
2008-10-21T23:55:57Z
14,010,929
<p>This can be solved with an assignment tag:</p> <pre><code>from django import template register = template.Library() @register.assignment_tag def query(qs, **kwargs): """ template tag which allows queryset filtering. Usage: {% query books author=author as mybooks %} {% for book in mybooks %...
7
2012-12-23T12:27:28Z
[ "python", "django", "django-templates" ]
How do I perform query filtering in django templates
223,990
<p>I need to perform a filtered query from within a django template, to get a set of objects equivalent to python code within a view:</p> <pre><code>queryset = Modelclass.objects.filter(somekey=foo) </code></pre> <p>In my template I would like to do</p> <pre><code>{% for object in data.somekey_set.FILTER %} </code><...
50
2008-10-21T23:55:57Z
16,429,027
<p>I just add an extra template tag like this:</p> <pre><code>@register.filter def in_category(things, category): return things.filter(category=category) </code></pre> <p>Then I can do:</p> <pre><code>{% for category in categories %} {% for thing in things|in_category:category %} {{ thing }} {% endfor %}...
14
2013-05-07T21:41:18Z
[ "python", "django", "django-templates" ]
Javascript style dot notation for dictionary keys unpythonic?
224,026
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
25
2008-10-22T00:08:01Z
224,051
<p>As far as I know, Python classes use dictionaries to store their attributes anyway (that's hidden from the programmer), so it looks to me that what you've done there is effectively emulate a Python class... using a python class. </p>
3
2008-10-22T00:22:11Z
[ "python", "coding-style" ]
Javascript style dot notation for dictionary keys unpythonic?
224,026
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
25
2008-10-22T00:08:01Z
224,071
<p>I like dot notation a lot better than dictionary fields personally. The reason being that it makes autocompletion work a lot better.</p>
1
2008-10-22T00:34:59Z
[ "python", "coding-style" ]
Javascript style dot notation for dictionary keys unpythonic?
224,026
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
25
2008-10-22T00:08:01Z
224,080
<p>With regards to the <code>DictObj</code>, would the following work for you? A blank class will allow you to arbitrarily add to or replace stuff in a container object.</p> <pre><code>class Container(object): pass &gt;&gt;&gt; myContainer = Container() &gt;&gt;&gt; myContainer.spam = "in a can" &gt;&gt;&gt; myC...
12
2008-10-22T00:40:31Z
[ "python", "coding-style" ]
Javascript style dot notation for dictionary keys unpythonic?
224,026
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
25
2008-10-22T00:08:01Z
224,722
<p>This is a simpler version of your DictObj class:</p> <pre><code>class DictObj(object): def __getattr__(self, attr): return self.__dict__.get(attr) &gt;&gt;&gt; d = DictObj() &gt;&gt;&gt; d.something = 'one' &gt;&gt;&gt; print d.something one &gt;&gt;&gt; print d.somethingelse None &gt;&gt;&gt; </code><...
8
2008-10-22T07:06:02Z
[ "python", "coding-style" ]
Javascript style dot notation for dictionary keys unpythonic?
224,026
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
25
2008-10-22T00:08:01Z
224,787
<p>It's not bad if it serves your purpose. "Practicality beats purity".</p> <p>I saw such approach elserwhere (eg. in <a href="http://www.blueskyonmars.com/projects/paver/" rel="nofollow">Paver</a>), so this can be considered <em>common need</em> (or desire).</p>
1
2008-10-22T07:55:24Z
[ "python", "coding-style" ]
Javascript style dot notation for dictionary keys unpythonic?
224,026
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
25
2008-10-22T00:08:01Z
224,876
<p>Your DictObj example is actually quite common. Object-style dot-notation access can be a win if you are dealing with ‘things that resemble objects’, ie. they have fixed property names containing only characters valid in Python identifiers. Stuff like database rows or form submissions can be usefully stored in th...
22
2008-10-22T08:29:47Z
[ "python", "coding-style" ]
Javascript style dot notation for dictionary keys unpythonic?
224,026
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
25
2008-10-22T00:08:01Z
235,675
<p>The one major disadvantage of using something like your DictObj is you either have to limit allowable keys or you can't have methods on your DictObj such as <code>.keys()</code>, <code>.values()</code>, <code>.items()</code>, etc.</p>
2
2008-10-25T00:17:16Z
[ "python", "coding-style" ]
Javascript style dot notation for dictionary keys unpythonic?
224,026
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
25
2008-10-22T00:08:01Z
235,686
<p>It's not "wrong" to do this, and it can be nicer if your dictionaries have a strong possibility of turning into objects at some point, but be wary of the reasons for having bracket access in the first place:</p> <ol> <li>Dot access can't use keywords as keys.</li> <li>Dot access has to use Python-identifier-valid c...
3
2008-10-25T00:33:25Z
[ "python", "coding-style" ]
Javascript style dot notation for dictionary keys unpythonic?
224,026
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
25
2008-10-22T00:08:01Z
11,350,835
<p>Because you ask for undesirable side-effects:</p> <p>A disadvantage is that in visual editors like eclipse+pyDev, you will see many undefined variable errors on lines using the dot notation. Pydef will not be able to find such runtime "object" definitions. Whereas in the case of a normal dictionary, it knows that y...
0
2012-07-05T19:01:28Z
[ "python", "coding-style" ]
Javascript style dot notation for dictionary keys unpythonic?
224,026
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
25
2008-10-22T00:08:01Z
11,620,531
<p>There's a symmetry between <a href="http://stackoverflow.com/a/224876/1413374">this</a> and <a href="http://stackoverflow.com/a/224080/1413374">this</a> answer:</p> <pre><code>class dotdict(dict): __getattr__= dict.__getitem__ __setattr__= dict.__setitem__ __delattr__= dict.__delitem__ </code></pre> <p...
2
2012-07-23T21:07:16Z
[ "python", "coding-style" ]
Javascript style dot notation for dictionary keys unpythonic?
224,026
<p>I've started to use constructs like these:</p> <pre><code>class DictObj(object): def __init__(self): self.d = {} def __getattr__(self, m): return self.d.get(m, None) def __setattr__(self, m, v): super.__setattr__(self, m, v) </code></pre> <p>Update: based on this thread, I've re...
25
2008-10-22T00:08:01Z
26,553,870
<p>Don't overlook <a href="https://pypi.python.org/pypi/bunch/1.0.1" rel="nofollow" title="Bunch">Bunch</a>. </p> <p>It is a child of dictionary and can import YAML or JSON, or convert any existing dictionary to a Bunch and vice-versa. Once "bunchify"'d, a dictionary gains dot notations without losing any other dicti...
0
2014-10-24T18:15:52Z
[ "python", "coding-style" ]
What would be a better implementation of all combinations in lexicographic order of a jagged list?
224,145
<p>I was put in a position today in which I needed to enumerate all possible combinations of jagged list. For instance, a naive approach would be:</p> <pre><code>for a in [1,2,3]: for b in [4,5,6,7,8,9]: for c in [1,2]: yield (a,b,c) </code></pre> <p>This is functional, but not general in term...
2
2008-10-22T01:19:39Z
224,187
<p>The naive approach can be written more compactly as a generator expression:</p> <pre><code>((a,b,c) for a in [1,2,3] for b in [4,5,6,7,8,9] for c in [1,2]) </code></pre> <p>The general approach can be written much more simply using a recursive function:</p> <pre><code>def combinations(*seqs): if not seqs: retur...
6
2008-10-22T01:49:15Z
[ "python", "algorithm" ]
Alternatives to a wizard
224,337
<p>I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game.</p> <p>However, I'm realizing that the limitations of the wizard are making it difficult to design "elegant" logic flow. For example, because all pages of the wizard are initalized at th...
3
2008-10-22T02:54:17Z
224,800
<p>Here is a simple example. This way you can make your "wizard" work like a finite state machine where states are different pages that are initialized on demand. Also, the data is shared between pages.</p> <pre><code>import wx import wx.lib.newevent (PageChangeEvent, EVT_PAGE_CHANGE) = wx.lib.newevent.NewEvent() ...
5
2008-10-22T08:04:52Z
[ "python", "wxpython", "wizard" ]
Alternatives to a wizard
224,337
<p>I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game.</p> <p>However, I'm realizing that the limitations of the wizard are making it difficult to design "elegant" logic flow. For example, because all pages of the wizard are initalized at th...
3
2008-10-22T02:54:17Z
225,479
<p>You could try using a workflow engine like <a href="http://www.vivtek.com/wftk/" rel="nofollow">WFTK</a>. In this particular case author has done some work on wx-based apps using WFTK and can probably direct you to examples.</p>
0
2008-10-22T12:06:03Z
[ "python", "wxpython", "wizard" ]
Alternatives to a wizard
224,337
<p>I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game.</p> <p>However, I'm realizing that the limitations of the wizard are making it difficult to design "elegant" logic flow. For example, because all pages of the wizard are initalized at th...
3
2008-10-22T02:54:17Z
247,409
<p>The wxPython demo has an example of a "dynamic" wizard. Pages override GetNext() and GetPrev() to show pages dynamically. This shows the basic technique; you can extend it to add and remove pages, change pages on the fly, and rearrange pages dynamically.</p> <p>The wizard class is just a convenience, though. You ca...
1
2008-10-29T16:09:32Z
[ "python", "wxpython", "wizard" ]
Alternatives to a wizard
224,337
<p>I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game.</p> <p>However, I'm realizing that the limitations of the wizard are making it difficult to design "elegant" logic flow. For example, because all pages of the wizard are initalized at th...
3
2008-10-22T02:54:17Z
247,633
<p>I'd get rid of wizard in whole. They are the most unpleasant things I've ever used.</p> <p>The problem that requires a wizard-application where you click 'next' is perhaps a problem where you could apply a better user interface in a bit different manner. Instead of bringing up a dialog with annoying 'next' -button....
0
2008-10-29T17:14:33Z
[ "python", "wxpython", "wizard" ]
Alternatives to a wizard
224,337
<p>I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game.</p> <p>However, I'm realizing that the limitations of the wizard are making it difficult to design "elegant" logic flow. For example, because all pages of the wizard are initalized at th...
3
2008-10-22T02:54:17Z
247,711
<p>It should be noted that a Wizard should be the interface for mutli-step, infrequently-performed tasks. The wizard is used to guide the user through something they don't really understand, because they almost never do it.</p> <p>And if some users might do the task frequently, you want to give those power users a lig...
0
2008-10-29T17:38:48Z
[ "python", "wxpython", "wizard" ]
Incoming poplib refactoring using windows python 2.3
224,660
<p>Hi Guys could you please help me refactor this so that it is sensibly pythonic.</p> <pre><code>import sys import poplib import string import StringIO, rfc822 import datetime import logging def _dump_pop_emails(self): self.logger.info("open pop account %s with username: %s" % (self.account[0], self.account[1]))...
1
2008-10-22T06:26:33Z
224,713
<p>I don't see anything significant wrong with that code -- is it behaving incorrectly, or are you just looking for general style guidelines?</p> <p>A few notes:</p> <ol> <li>Instead of <code>logger.info ("foo %s %s" % (bar, baz))</code>, use <code>"foo %s %s", bar, baz</code>. This avoids the overhead of string form...
3
2008-10-22T06:58:57Z
[ "python", "email", "refactoring", "poplib" ]
Incoming poplib refactoring using windows python 2.3
224,660
<p>Hi Guys could you please help me refactor this so that it is sensibly pythonic.</p> <pre><code>import sys import poplib import string import StringIO, rfc822 import datetime import logging def _dump_pop_emails(self): self.logger.info("open pop account %s with username: %s" % (self.account[0], self.account[1]))...
1
2008-10-22T06:26:33Z
224,752
<p>Further to my comment on John's answer</p> <p>I found out what the issue was, there were illegal characters in the name field and Subject field, which caused python to get the hiccups, as it tried to write the email as a directory, after seeing ":" and "/".</p> <p>John point number 4 doesnt work! so I left it as b...
0
2008-10-22T07:30:20Z
[ "python", "email", "refactoring", "poplib" ]
Incoming poplib refactoring using windows python 2.3
224,660
<p>Hi Guys could you please help me refactor this so that it is sensibly pythonic.</p> <pre><code>import sys import poplib import string import StringIO, rfc822 import datetime import logging def _dump_pop_emails(self): self.logger.info("open pop account %s with username: %s" % (self.account[0], self.account[1]))...
1
2008-10-22T06:26:33Z
225,029
<p>This isn't refactoring (it doesn't need refactoring as far as I can see), but some suggestions:</p> <p>You should use the email package rather than rfc822. Replace rfc822.Message with email.Message, and use email.Utils.parseaddr(msg["From"]) to get the name and email address, and msg["Subject"] to get the subject....
1
2008-10-22T09:32:26Z
[ "python", "email", "refactoring", "poplib" ]
Open Source Profiling Frameworks?
224,735
<p>Have you ever wanted to test and quantitatively show whether your application would perform better as a static build or shared build, stripped or non-stripped, upx or no upx, gcc -O2 or gcc -O3, hash or btree, etc etc. If so this is the thread for you. There are hundreds of ways to tune an application, but how do we...
6
2008-10-22T07:16:23Z
225,649
<p>I'm not sure what your question is precisely, but for profiling Java (web)applications you can use the netbeans profiler and profiler4j (available on sourceforge). I have used both and can recommend them over eclipse tptp.</p> <p>See <a href="http://stackoverflow.com/questions/186615/how-to-set-up-eclipse-tptp">htt...
0
2008-10-22T13:05:50Z
[ "python", "mozilla", "profiling" ]
Open Source Profiling Frameworks?
224,735
<p>Have you ever wanted to test and quantitatively show whether your application would perform better as a static build or shared build, stripped or non-stripped, upx or no upx, gcc -O2 or gcc -O3, hash or btree, etc etc. If so this is the thread for you. There are hundreds of ways to tune an application, but how do we...
6
2008-10-22T07:16:23Z
696,151
<p>There was a talk at PyCon this week discussing the various profiling methods on Python today. I don't think anything is as complete as what your looking for, but it may be worth a look. <a href="http://us.pycon.org/2009/conference/schedule/event/15/" rel="nofollow">http://us.pycon.org/2009/conference/schedule/event...
2
2009-03-30T06:14:29Z
[ "python", "mozilla", "profiling" ]
Open Source Profiling Frameworks?
224,735
<p>Have you ever wanted to test and quantitatively show whether your application would perform better as a static build or shared build, stripped or non-stripped, upx or no upx, gcc -O2 or gcc -O3, hash or btree, etc etc. If so this is the thread for you. There are hundreds of ways to tune an application, but how do we...
6
2008-10-22T07:16:23Z
1,649,316
<p>You may have to build what you're looking for, but you might start from</p> <ul> <li><a href="http://stackoverflow.com/questions/tagged/valgrind">Valgrind</a></li> <li>Luke Stackwalker</li> <li>lots of other open-source projects</li> </ul> <p>Also, when the purpose is not so much to <em>measure</em> performance as...
0
2009-10-30T11:37:11Z
[ "python", "mozilla", "profiling" ]
How do you use the cursor for reading multiple files in database in python
224,771
<p>In python how do you read multiple files from a mysql database using the cursor or loop one by one and store the output in a separate table?</p>
0
2008-10-22T07:41:50Z
224,801
<p>I don't understand your question (what are files?, what's your table structure?), but here goes a simple sample:</p> <pre><code>&gt;&gt;&gt; import MySQLdb &gt;&gt;&gt; conn = MySQLdb.connect(host="localhost", user="root", password="merlin", ...
1
2008-10-22T08:05:50Z
[ "python", "mysql" ]
How do you use the cursor for reading multiple files in database in python
224,771
<p>In python how do you read multiple files from a mysql database using the cursor or loop one by one and store the output in a separate table?</p>
0
2008-10-22T07:41:50Z
224,844
<p>Here is an example, assuming you have created the table you want to move to, with descriptive names:</p> <pre><code>&gt;&gt;&gt; import MySQLdb &gt;&gt;&gt; conn = MySQLdb.connect(user='username', db='dbname') &gt;&gt;&gt; cur = conn.cursor() &gt;&gt;&gt; cur.execute('select files from old_table where conditions=me...
0
2008-10-22T08:19:48Z
[ "python", "mysql" ]
How can I generate a report file (ODF, PDF) from a django view
224,796
<p>I would like to generate a report file from a view&amp;template in django. Preferred file formats would be OpenOffice/ODF or PDF.</p> <p>What is the best way to do this?</p> <p>I do want to reuse the page layout defined in the template, possibly by redefining some blocks in a derived template.</p> <p>Ideally, the...
6
2008-10-22T08:02:06Z
224,951
<p><a href="http://www.htmltopdf.org/" rel="nofollow">pisa/xhtml2pdf</a> should get you covered for PDF. It even includes an example Django project.</p>
4
2008-10-22T09:05:22Z
[ "python", "django", "pdf", "pdf-generation" ]
How can I generate a report file (ODF, PDF) from a django view
224,796
<p>I would like to generate a report file from a view&amp;template in django. Preferred file formats would be OpenOffice/ODF or PDF.</p> <p>What is the best way to do this?</p> <p>I do want to reuse the page layout defined in the template, possibly by redefining some blocks in a derived template.</p> <p>Ideally, the...
6
2008-10-22T08:02:06Z
226,168
<p>Try ReportLab for PDF output:</p> <p><a href="http://www.reportlab.org/" rel="nofollow">http://www.reportlab.org/</a></p>
3
2008-10-22T15:05:08Z
[ "python", "django", "pdf", "pdf-generation" ]
RFC 1123 Date Representation in Python?
225,086
<p>Is there a fairly easy way to convert a datetime object into an RFC 1123 (HTTP/1.1) date/time string, i.e. a string with the format</p> <pre><code>Sun, 06 Nov 1994 08:49:37 GMT </code></pre> <p>Using <code>strftime</code> does not work, since the strings are locale-dependant. Do I have to build the string by hand?...
45
2008-10-22T09:59:21Z
225,101
<p>You can set LC_TIME to force stftime() to use a specific locale:</p> <pre><code>&gt;&gt;&gt; locale.setlocale(locale.LC_TIME, 'en_US') 'en_US' &gt;&gt;&gt; datetime.datetime.now().strftime(locale.nl_langinfo(locale.D_T_FMT)) 'Wed 22 Oct 2008 06:05:39 AM ' </code></pre>
1
2008-10-22T10:05:46Z
[ "python", "http", "datetime" ]
RFC 1123 Date Representation in Python?
225,086
<p>Is there a fairly easy way to convert a datetime object into an RFC 1123 (HTTP/1.1) date/time string, i.e. a string with the format</p> <pre><code>Sun, 06 Nov 1994 08:49:37 GMT </code></pre> <p>Using <code>strftime</code> does not work, since the strings are locale-dependant. Do I have to build the string by hand?...
45
2008-10-22T09:59:21Z
225,106
<p>You can use wsgiref.handlers.format_date_time from the stdlib which does not rely on locale settings</p> <pre><code>from wsgiref.handlers import format_date_time from datetime import datetime from time import mktime now = datetime.now() stamp = mktime(now.timetuple()) print format_date_time(stamp) #--&gt; Wed, 22 ...
66
2008-10-22T10:07:19Z
[ "python", "http", "datetime" ]
RFC 1123 Date Representation in Python?
225,086
<p>Is there a fairly easy way to convert a datetime object into an RFC 1123 (HTTP/1.1) date/time string, i.e. a string with the format</p> <pre><code>Sun, 06 Nov 1994 08:49:37 GMT </code></pre> <p>Using <code>strftime</code> does not work, since the strings are locale-dependant. Do I have to build the string by hand?...
45
2008-10-22T09:59:21Z
225,177
<p>You can use the formatdate() function from the Python standard email module:</p> <pre><code>from email.utils import formatdate print formatdate(timeval=None, localtime=False, usegmt=True) </code></pre> <p>Gives the current time in the desired format:</p> <pre><code>Wed, 22 Oct 2008 10:32:33 GMT </code></pre> <p>...
26
2008-10-22T10:34:04Z
[ "python", "http", "datetime" ]
RFC 1123 Date Representation in Python?
225,086
<p>Is there a fairly easy way to convert a datetime object into an RFC 1123 (HTTP/1.1) date/time string, i.e. a string with the format</p> <pre><code>Sun, 06 Nov 1994 08:49:37 GMT </code></pre> <p>Using <code>strftime</code> does not work, since the strings are locale-dependant. Do I have to build the string by hand?...
45
2008-10-22T09:59:21Z
225,191
<p>Well, here is a manual function to format it:</p> <pre><code>def httpdate(dt): """Return a string representation of a date according to RFC 1123 (HTTP/1.1). The supplied date must be in UTC. """ weekday = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][dt.weekday()] month = ["Jan", "Feb"...
1
2008-10-22T10:40:11Z
[ "python", "http", "datetime" ]
RFC 1123 Date Representation in Python?
225,086
<p>Is there a fairly easy way to convert a datetime object into an RFC 1123 (HTTP/1.1) date/time string, i.e. a string with the format</p> <pre><code>Sun, 06 Nov 1994 08:49:37 GMT </code></pre> <p>Using <code>strftime</code> does not work, since the strings are locale-dependant. Do I have to build the string by hand?...
45
2008-10-22T09:59:21Z
37,191,167
<p>If anybody reading this is working on a <strong>Django</strong> project, Django provides a function <a href="https://docs.djangoproject.com/en/stable/ref/utils/#django.utils.http.http_date" rel="nofollow"><code>django.utils.http.http_date(epoch_seconds)</code></a>.</p> <pre><code>from django.utils.http import http_...
1
2016-05-12T15:18:56Z
[ "python", "http", "datetime" ]
Parsing different date formats from feedparser in python?
225,274
<p>I'm trying to get the dates from entries in two different RSS feeds through <a href="http://feedparser.org">feedparser</a>.</p> <p>Here is what I'm doing:</p> <pre><code>import feedparser as fp reddit = fp.parse("http://www.reddit.com/.rss") cc = fp.parse("http://contentconsumer.com/feed") print reddit.entries[0]....
8
2008-10-22T11:09:20Z
225,382
<p>Parsing of dates is a pain with RSS feeds in-the-wild, and that's where <code>feedparser</code> can be a big help.</p> <p>If you use the <code>*_parsed</code> properties (like <code>updated_parsed</code>), <code>feedparser</code> will have done the work and will return a 9-tuple Python date in UTC.</p> <p>See <a h...
14
2008-10-22T11:35:42Z
[ "python", "datetime", "parsing", "rss", "feedparser" ]
"Pretty" Continuous Integration for Python
225,598
<p>This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at..</p> <p>For example, compared to..</p> <ul> <li><a href="http://phpundercontrol.org/about.html">phpUnderControl</a></li> <li><a href="http://jenkins-ci.org/content/about-jenkins-ci">Jenkins</a> <ul> <li><a href="http://bl...
112
2008-10-22T12:49:54Z
225,788
<p>Don't know if it would do : <a href="http://bitten.edgewall.org/">Bitten</a> is made by the guys who write Trac and is integrated with Trac. <a href="http://gump.apache.org/">Apache Gump</a> is the CI tool used by Apache. It is written in Python.</p>
10
2008-10-22T13:46:55Z
[ "python", "jenkins", "continuous-integration", "buildbot" ]
"Pretty" Continuous Integration for Python
225,598
<p>This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at..</p> <p>For example, compared to..</p> <ul> <li><a href="http://phpundercontrol.org/about.html">phpUnderControl</a></li> <li><a href="http://jenkins-ci.org/content/about-jenkins-ci">Jenkins</a> <ul> <li><a href="http://bl...
112
2008-10-22T12:49:54Z
228,196
<p>We've had great success with <a href="http://www.jetbrains.com/teamcity/">TeamCity</a> as our CI server and using nose as our test runner. <a href="http://pypi.python.org/pypi/teamcity-nose">Teamcity plugin for nosetests</a> gives you count pass/fail, readable display for failed test( that can be E-Mailed). You ca...
9
2008-10-23T01:30:17Z
[ "python", "jenkins", "continuous-integration", "buildbot" ]
"Pretty" Continuous Integration for Python
225,598
<p>This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at..</p> <p>For example, compared to..</p> <ul> <li><a href="http://phpundercontrol.org/about.html">phpUnderControl</a></li> <li><a href="http://jenkins-ci.org/content/about-jenkins-ci">Jenkins</a> <ul> <li><a href="http://bl...
112
2008-10-22T12:49:54Z
667,800
<p>You might want to check out <a href="http://somethingaboutorange.com/mrl/projects/nose/">Nose</a> and <a href="http://nose.readthedocs.org/en/latest/plugins/xunit.html">the Xunit output plugin</a>. You can have it run your unit tests, and coverage checks with this command:</p> <pre><code>nosetests --with-xunit --e...
40
2009-03-20T20:13:24Z
[ "python", "jenkins", "continuous-integration", "buildbot" ]
"Pretty" Continuous Integration for Python
225,598
<p>This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at..</p> <p>For example, compared to..</p> <ul> <li><a href="http://phpundercontrol.org/about.html">phpUnderControl</a></li> <li><a href="http://jenkins-ci.org/content/about-jenkins-ci">Jenkins</a> <ul> <li><a href="http://bl...
112
2008-10-22T12:49:54Z
2,026,520
<p>Buildbot's waterfall page can be considerably prettified. Here's a nice example <a href="http://build.chromium.org/buildbot/waterfall/waterfall">http://build.chromium.org/buildbot/waterfall/waterfall</a></p>
8
2010-01-08T09:16:55Z
[ "python", "jenkins", "continuous-integration", "buildbot" ]
"Pretty" Continuous Integration for Python
225,598
<p>This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at..</p> <p>For example, compared to..</p> <ul> <li><a href="http://phpundercontrol.org/about.html">phpUnderControl</a></li> <li><a href="http://jenkins-ci.org/content/about-jenkins-ci">Jenkins</a> <ul> <li><a href="http://bl...
112
2008-10-22T12:49:54Z
2,213,516
<p>We have used bitten quite a bit. It is pretty and integrates well with Trac, but it is a pain in the butt to customize if you have any nonstandard workflow. Also there just aren't as many plugins as there are for the more popular tools. Currently we are evaluating Hudson as a replacement.</p>
0
2010-02-06T15:03:28Z
[ "python", "jenkins", "continuous-integration", "buildbot" ]
"Pretty" Continuous Integration for Python
225,598
<p>This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at..</p> <p>For example, compared to..</p> <ul> <li><a href="http://phpundercontrol.org/about.html">phpUnderControl</a></li> <li><a href="http://jenkins-ci.org/content/about-jenkins-ci">Jenkins</a> <ul> <li><a href="http://bl...
112
2008-10-22T12:49:54Z
2,535,738
<p>Signal is another option. You can know more about it and watch a video also <a href="http://www.diegocarrion.com/2009/10/30/really-easy-continuous-integration-with-signal/" rel="nofollow">here</a>.</p>
2
2010-03-29T04:05:02Z
[ "python", "jenkins", "continuous-integration", "buildbot" ]
"Pretty" Continuous Integration for Python
225,598
<p>This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at..</p> <p>For example, compared to..</p> <ul> <li><a href="http://phpundercontrol.org/about.html">phpUnderControl</a></li> <li><a href="http://jenkins-ci.org/content/about-jenkins-ci">Jenkins</a> <ul> <li><a href="http://bl...
112
2008-10-22T12:49:54Z
5,119,040
<p>I guess this thread is quite old but here is my take on it with hudson:</p> <p>I decided to go with pip and set up a repo (the painful to get working but nice looking eggbasket), which hudson auto uploads to with a successful tests. Here is my rough and ready script for use with a hudson config execute script like:...
6
2011-02-25T15:25:37Z
[ "python", "jenkins", "continuous-integration", "buildbot" ]
"Pretty" Continuous Integration for Python
225,598
<p>This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at..</p> <p>For example, compared to..</p> <ul> <li><a href="http://phpundercontrol.org/about.html">phpUnderControl</a></li> <li><a href="http://jenkins-ci.org/content/about-jenkins-ci">Jenkins</a> <ul> <li><a href="http://bl...
112
2008-10-22T12:49:54Z
6,511,097
<p>Atlassian's <a href="http://www.atlassian.com/software/bamboo">Bamboo</a> is also definitely worth checking out. The entire Atlassian suite (JIRA, Confluence, FishEye, etc) is pretty sweet.</p>
5
2011-06-28T18:08:12Z
[ "python", "jenkins", "continuous-integration", "buildbot" ]
"Pretty" Continuous Integration for Python
225,598
<p>This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at..</p> <p>For example, compared to..</p> <ul> <li><a href="http://phpundercontrol.org/about.html">phpUnderControl</a></li> <li><a href="http://jenkins-ci.org/content/about-jenkins-ci">Jenkins</a> <ul> <li><a href="http://bl...
112
2008-10-22T12:49:54Z
8,572,594
<p>another one : <a href="https://www.shiningpanda.com/" rel="nofollow">Shining Panda</a> is a hosted tool for python</p>
3
2011-12-20T08:28:42Z
[ "python", "jenkins", "continuous-integration", "buildbot" ]
"Pretty" Continuous Integration for Python
225,598
<p>This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at..</p> <p>For example, compared to..</p> <ul> <li><a href="http://phpundercontrol.org/about.html">phpUnderControl</a></li> <li><a href="http://jenkins-ci.org/content/about-jenkins-ci">Jenkins</a> <ul> <li><a href="http://bl...
112
2008-10-22T12:49:54Z
10,363,583
<p>If you're considering hosted CI solution, and doing open source, you should look into <a href="http://travis-ci.org/" rel="nofollow">Travis CI</a> as well - it has very nice integration with GitHub. While it started as a Ruby tool, they have <a href="http://about.travis-ci.org/blog/announcing_python_and_perl_suppor...
3
2012-04-28T12:43:00Z
[ "python", "jenkins", "continuous-integration", "buildbot" ]