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
Executing server-side Unix scripts asynchronously
1,897,748
<p>We have a collection of Unix scripts (and/or Python modules) that each perform a long running task. I would like to provide a web interface for them that does the following:</p> <ul> <li>Asks for relevant data to pass into scripts.</li> <li>Allows for starting/stopping/killing them.</li> <li>Allows for monitoring t...
2
2009-12-13T21:07:43Z
1,922,296
<p>I would use <a href="http://gridengine.sunsource.net/" rel="nofollow">SGE</a>, but I think it could be overkill for your need...</p>
0
2009-12-17T14:59:34Z
[ "python", "http", "unix", "asynchronous" ]
Executing server-side Unix scripts asynchronously
1,897,748
<p>We have a collection of Unix scripts (and/or Python modules) that each perform a long running task. I would like to provide a web interface for them that does the following:</p> <ul> <li>Asks for relevant data to pass into scripts.</li> <li>Allows for starting/stopping/killing them.</li> <li>Allows for monitoring t...
2
2009-12-13T21:07:43Z
2,257,715
<p>Answering my own question, I recently saw the announcement of <a href="http://ask.github.com/celery/getting-started/introduction.html" rel="nofollow">Celery</a> 1.0, which seems to do much of what I am looking for.</p>
1
2010-02-13T13:39:20Z
[ "python", "http", "unix", "asynchronous" ]
Test if point is in some rectangle
1,897,779
<p>I have a large collection of rectangles, all of the same size. I am generating random points that should not fall in these rectangles, so what I wish to do is test if the generated point lies in one of the rectangles, and if it does, generate a new point.</p> <p>Using R-trees seem to work, but they are really meant...
10
2009-12-13T21:17:30Z
1,897,789
<p>This Reddit thread addresses your problem: </p> <p><a href="http://www.reddit.com/r/programming/comments/80dlc/i_have_a_set_of_rectangles_and_need_to_determine/" rel="nofollow">I have a set of rectangles, and need to determine whether a point is contained within any of them. What are some good data structures to do...
8
2009-12-13T21:20:42Z
[ "python", "algorithm", "point" ]
Test if point is in some rectangle
1,897,779
<p>I have a large collection of rectangles, all of the same size. I am generating random points that should not fall in these rectangles, so what I wish to do is test if the generated point lies in one of the rectangles, and if it does, generate a new point.</p> <p>Using R-trees seem to work, but they are really meant...
10
2009-12-13T21:17:30Z
1,897,807
<p>I suggest you take a look at <a href="http://en.wikipedia.org/wiki/BSP%5Ftree" rel="nofollow">BSP trees</a> (and possible quadtrees or octrees, links available on that page as well). They are used to partition the whole space recursively and allow you to quickly check for a point which rectangles you need to check a...
0
2009-12-13T21:25:25Z
[ "python", "algorithm", "point" ]
Test if point is in some rectangle
1,897,779
<p>I have a large collection of rectangles, all of the same size. I am generating random points that should not fall in these rectangles, so what I wish to do is test if the generated point lies in one of the rectangles, and if it does, generate a new point.</p> <p>Using R-trees seem to work, but they are really meant...
10
2009-12-13T21:17:30Z
1,897,910
<p>Your R-tree approach is the best approach I know of (that's the approach I would choose over quadtrees, B+ trees, or BSP trees, as R-trees seem convenient to build in your case). Caveat: I'm no expert, even though I remember a few things from my senior year university class of algorithmic!</p>
0
2009-12-13T21:55:06Z
[ "python", "algorithm", "point" ]
Test if point is in some rectangle
1,897,779
<p>I have a large collection of rectangles, all of the same size. I am generating random points that should not fall in these rectangles, so what I wish to do is test if the generated point lies in one of the rectangles, and if it does, generate a new point.</p> <p>Using R-trees seem to work, but they are really meant...
10
2009-12-13T21:17:30Z
1,897,932
<p>Why not try this. It seems rather light on both computation and memory.</p> <p>Consider the projections of all the rectangles onto the base line of your space. Denote that set of line intervals as</p> <pre><code> {[Rl1, Rr1], [Rl2, Rr2],..., [Rln, Rrn]}, ordered by increasing left coordinates. </code></pre> <p>...
1
2009-12-13T22:00:38Z
[ "python", "algorithm", "point" ]
Test if point is in some rectangle
1,897,779
<p>I have a large collection of rectangles, all of the same size. I am generating random points that should not fall in these rectangles, so what I wish to do is test if the generated point lies in one of the rectangles, and if it does, generate a new point.</p> <p>Using R-trees seem to work, but they are really meant...
10
2009-12-13T21:17:30Z
1,897,962
<p>For rectangles that are aligned with the axes, you only need two points (four numbers) to identify the rectangle - conventionally, bottom-left and top-right corners. To establish whether a given point (X<sub>test</sub>, Y<sub>test</sub>) overlaps with a rectangle (X<sub>BL</sub>, Y<sub>BL</sub>, X<sub>TR</sub>, Y<s...
2
2009-12-13T22:08:50Z
[ "python", "algorithm", "point" ]
Does anyone know of a asynchronous mysql lib for python?
1,897,799
<p>I've been looking into non-blocking servers for python (tornado, twisted etc) but a lot of the benefits seems to be lost if there's no non-blocking connection to the database. Does anyone know if there are any projects that take care of this? (by non-blocking a la node.js)</p> <p>Edit: Clarified my question</p>
11
2009-12-13T21:23:32Z
1,897,927
<p>The way you do that is by spawning database queries in a separate thread. With Twisted you can use <code>deferToThread()</code> or <code>deferToThreadPool()</code> (see the API docs[1]).</p>
1
2009-12-13T21:58:08Z
[ "python", "mysql", "twisted", "asynchronous", "tornado" ]
Does anyone know of a asynchronous mysql lib for python?
1,897,799
<p>I've been looking into non-blocking servers for python (tornado, twisted etc) but a lot of the benefits seems to be lost if there's no non-blocking connection to the database. Does anyone know if there are any projects that take care of this? (by non-blocking a la node.js)</p> <p>Edit: Clarified my question</p>
11
2009-12-13T21:23:32Z
1,898,320
<p>You can use Twisted's <a href="http://twistedmatrix.com/documents/8.2.0/api/twisted.enterprise.adbapi.html">ADBAPI</a> to wrap a synchronous DBAPI implementation.</p> <p>E.g.:</p> <pre><code>from twisted.internet import reactor from twisted.enterprise import adbapi def result(rows): for row in rows: p...
13
2009-12-14T00:15:05Z
[ "python", "mysql", "twisted", "asynchronous", "tornado" ]
Does anyone know of a asynchronous mysql lib for python?
1,897,799
<p>I've been looking into non-blocking servers for python (tornado, twisted etc) but a lot of the benefits seems to be lost if there's no non-blocking connection to the database. Does anyone know if there are any projects that take care of this? (by non-blocking a la node.js)</p> <p>Edit: Clarified my question</p>
11
2009-12-13T21:23:32Z
4,948,086
<p>Check out our new <a href="https://github.com/hybridlogic/txMySQL" rel="nofollow">txMySQL project</a> which can do this now.</p> <p>This is a native asynchronous implementation of the binary MySQL protocol.</p>
4
2011-02-09T17:05:54Z
[ "python", "mysql", "twisted", "asynchronous", "tornado" ]
How do you you run a Twisted application via Python (instead of via Twisted)?
1,897,939
<p>I am working my way through learning Twisted, and have stumbled across something I'm not sure I'm terribly fond of - the "Twisted Command Prompt". I am fiddling around with Twisted on my Windows machine, and tried running the "Chat" example:</p> <pre><code>from twisted.protocols import basic class MyChat(basic.Li...
19
2009-12-13T22:03:32Z
1,897,968
<p>I haven't used twisted myself. However, you may try seeing if the twistd is a python file itself. I would take a guess that it is simply managing loading the appropriate twisted libraries from the correct path.</p>
1
2009-12-13T22:11:15Z
[ "python", "networking", "sockets", "twisted" ]
How do you you run a Twisted application via Python (instead of via Twisted)?
1,897,939
<p>I am working my way through learning Twisted, and have stumbled across something I'm not sure I'm terribly fond of - the "Twisted Command Prompt". I am fiddling around with Twisted on my Windows machine, and tried running the "Chat" example:</p> <pre><code>from twisted.protocols import basic class MyChat(basic.Li...
19
2009-12-13T22:03:32Z
1,898,013
<p>On windows you can create .bat file with your command in it, use full paths, then just click on it to start up.</p> <p>For example I use:</p> <pre><code>runfileserver.bat: C:\program_files\python26\Scripts\twistd.py -y C:\source\python\twisted\fileserver.tac </code></pre>
2
2009-12-13T22:23:27Z
[ "python", "networking", "sockets", "twisted" ]
How do you you run a Twisted application via Python (instead of via Twisted)?
1,897,939
<p>I am working my way through learning Twisted, and have stumbled across something I'm not sure I'm terribly fond of - the "Twisted Command Prompt". I am fiddling around with Twisted on my Windows machine, and tried running the "Chat" example:</p> <pre><code>from twisted.protocols import basic class MyChat(basic.Li...
19
2009-12-13T22:03:32Z
1,898,102
<p>Don't confuse "Twisted" with "<code>twistd</code>". When you use "<code>twistd</code>", you <em>are</em> running the program with Python. "<code>twistd</code>" is a Python program that, among other things, can load an application from a <code>.tac</code> file (as you're doing here).</p> <p>The "Twisted Command Pr...
15
2009-12-13T22:56:12Z
[ "python", "networking", "sockets", "twisted" ]
How do you you run a Twisted application via Python (instead of via Twisted)?
1,897,939
<p>I am working my way through learning Twisted, and have stumbled across something I'm not sure I'm terribly fond of - the "Twisted Command Prompt". I am fiddling around with Twisted on my Windows machine, and tried running the "Chat" example:</p> <pre><code>from twisted.protocols import basic class MyChat(basic.Li...
19
2009-12-13T22:03:32Z
1,898,145
<p>Maybe one of <code>run</code> or <code>runApp</code> in <a href="http://twistedmatrix.com/documents/9.0.0/api/twisted.scripts.twistd.html" rel="nofollow">twisted.scripts.twistd</a> modules will work for you. Please let me know if it does, it will be nice to know!</p>
2
2009-12-13T23:11:57Z
[ "python", "networking", "sockets", "twisted" ]
How do you you run a Twisted application via Python (instead of via Twisted)?
1,897,939
<p>I am working my way through learning Twisted, and have stumbled across something I'm not sure I'm terribly fond of - the "Twisted Command Prompt". I am fiddling around with Twisted on my Windows machine, and tried running the "Chat" example:</p> <pre><code>from twisted.protocols import basic class MyChat(basic.Li...
19
2009-12-13T22:03:32Z
1,898,188
<p>I don't know if it's the best way to do this but what I do is instead of:</p> <pre><code>application = service.Application("chatserver") internet.TCPServer(1025, factory).setServiceParent(application) </code></pre> <p>you can do:</p> <pre><code>from twisted.internet import reactor reactor.listenTCP(1025, factory)...
20
2009-12-13T23:25:31Z
[ "python", "networking", "sockets", "twisted" ]
How do I check the methods that an object has, in Python?
1,897,960
<p>For example, a list.</p> <p>l1 = [1, 5 , 7] How do I check the methods that it has?</p> <p>(l1.append, for example)</p> <p>Or a string... string.lower(</p>
5
2009-12-13T22:08:46Z
1,897,967
<p>You can use <code>dir</code> to get a list the methods of any object. This is very useful in the interactive prompt:</p> <pre><code>&gt;&gt;&gt; dir(l1) ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__', '__getslic...
20
2009-12-13T22:11:08Z
[ "python", "object", "methods" ]
How do I check the methods that an object has, in Python?
1,897,960
<p>For example, a list.</p> <p>l1 = [1, 5 , 7] How do I check the methods that it has?</p> <p>(l1.append, for example)</p> <p>Or a string... string.lower(</p>
5
2009-12-13T22:08:46Z
1,897,981
<p>If you install <a href="http://ipython.scipy.org/" rel="nofollow">IPython</a>, then you can do this:</p> <pre><code>% ipython Python 2.6.4 (r264:75706, Nov 2 2009, 14:38:03) Type "copyright", "credits" or "license" for more information. IPython 0.10 -- An enhanced Interactive Python. ? -&gt; Introduction...
1
2009-12-13T22:15:27Z
[ "python", "object", "methods" ]
How do I check the methods that an object has, in Python?
1,897,960
<p>For example, a list.</p> <p>l1 = [1, 5 , 7] How do I check the methods that it has?</p> <p>(l1.append, for example)</p> <p>Or a string... string.lower(</p>
5
2009-12-13T22:08:46Z
1,897,992
<p>As it happens, all the members of list instances are methods. If that weren't the case, you could use this:</p> <pre><code>l1 = [1, 5 , 7] print [name for name in dir(l1) if type(getattr(l1, name) == type(l1.append))] </code></pre> <p>That will exclude members that aren't methods.</p>
1
2009-12-13T22:17:45Z
[ "python", "object", "methods" ]
How do I check the methods that an object has, in Python?
1,897,960
<p>For example, a list.</p> <p>l1 = [1, 5 , 7] How do I check the methods that it has?</p> <p>(l1.append, for example)</p> <p>Or a string... string.lower(</p>
5
2009-12-13T22:08:46Z
1,898,005
<p>You might want to look at the <code>getmembers</code> function in the <code>inspect</code> module</p> <pre><code>In [1]: import inspect In [2]: inspect? Type: module Base Class: &lt;type 'module'&gt; String Form: &lt;module 'inspect' from '/usr/lib/python2.6/inspect.pyc'&gt; Namespace: Interactive File: ...
4
2009-12-13T22:21:34Z
[ "python", "object", "methods" ]
How do I check the methods that an object has, in Python?
1,897,960
<p>For example, a list.</p> <p>l1 = [1, 5 , 7] How do I check the methods that it has?</p> <p>(l1.append, for example)</p> <p>Or a string... string.lower(</p>
5
2009-12-13T22:08:46Z
1,898,025
<p>Interactive Python has a <code>help</code> function you can use with anything:</p> <pre><code>&gt;&gt;&gt; help(list) Help on class list in module __builtin__: class list(object) | list() -&gt; new list | list(sequence) -&gt; new list initialized from sequence´s items | | Methods defined here: | | __add...
2
2009-12-13T22:26:41Z
[ "python", "object", "methods" ]
How do I check the methods that an object has, in Python?
1,897,960
<p>For example, a list.</p> <p>l1 = [1, 5 , 7] How do I check the methods that it has?</p> <p>(l1.append, for example)</p> <p>Or a string... string.lower(</p>
5
2009-12-13T22:08:46Z
2,775,317
<p>If the object (which often might be a module) has many methods or attributes using dir or the TAB completion of ipython can get to complex to keep track.</p> <p>In such cases I use filter like in the following example:</p> <pre><code>filter(lambda s: 'sin' in s.lower(), dir(numpy)) </code></pre> <p>which results ...
0
2010-05-05T17:12:28Z
[ "python", "object", "methods" ]
paster errors after installing distribute 0.6.10
1,898,055
<p>Been working on a Plone site for the last few weeks, it's the first time I've worked on one using buildout for recipes and paster for template generation, and it's been a learning curve. </p> <p>two days ago, everything was working fine.</p> <p>Yesterday, I started working from my known good source and used past...
1
2009-12-13T22:35:42Z
1,898,449
<p>Maybe this helps?</p> <p><a href="http://reinout.vanrees.org/weblog/2009/12/12/new-buildout-and-distribute-without-recursion.html" rel="nofollow">New distribute release: use new zc.buildout to prevent recursion</a></p> <p>I don't know that much about that particular part of the stack, but might be related?</p>
0
2009-12-14T01:05:31Z
[ "python", "plone", "paster", "distribute" ]
paster errors after installing distribute 0.6.10
1,898,055
<p>Been working on a Plone site for the last few weeks, it's the first time I've worked on one using buildout for recipes and paster for template generation, and it's been a learning curve. </p> <p>two days ago, everything was working fine.</p> <p>Yesterday, I started working from my known good source and used past...
1
2009-12-13T22:35:42Z
1,904,936
<p>Turns out, the problem had to do with the new version of distribute apparently doesn't squash the old version correctly. I had to manually rename the old egg, delete teh new one, then re-install the new one.</p>
3
2009-12-15T03:02:19Z
[ "python", "plone", "paster", "distribute" ]
paster errors after installing distribute 0.6.10
1,898,055
<p>Been working on a Plone site for the last few weeks, it's the first time I've worked on one using buildout for recipes and paster for template generation, and it's been a learning curve. </p> <p>two days ago, everything was working fine.</p> <p>Yesterday, I started working from my known good source and used past...
1
2009-12-13T22:35:42Z
2,472,978
<p>You're spot on to delete the distribute egg and reinstall.</p> <p>If your easy_install produces a similar issue (mine did after deleting my setuptools egg) you can manually reinstall distribute with:</p> <pre><code>$ curl -O http://python-distribute.org/distribute_setup.py $ python distribute_setup.py </code></pre...
1
2010-03-18T20:01:33Z
[ "python", "plone", "paster", "distribute" ]
python csv into dictionary
1,898,305
<p>I am pretty new to python. I need to create a class that loads csv data into a dictionary.</p> <p>I want to be able to control the keys and value So let say the following code, I can pull out worker1.name or worker1.age anytime i want.</p> <pre><code>class ageName(object): '''class to represent a person''' def __i...
9
2009-12-14T00:08:45Z
1,898,314
<p>Have you looked at the csv module?</p> <pre><code>import csv </code></pre>
2
2009-12-14T00:12:39Z
[ "python", "csv" ]
python csv into dictionary
1,898,305
<p>I am pretty new to python. I need to create a class that loads csv data into a dictionary.</p> <p>I want to be able to control the keys and value So let say the following code, I can pull out worker1.name or worker1.age anytime i want.</p> <pre><code>class ageName(object): '''class to represent a person''' def __i...
9
2009-12-14T00:08:45Z
1,898,324
<pre><code>import csv reader = csv.reader(open('workers.csv', newline=''), delimiter=',', quotechar='"') workers = [ageName(row[0], row[1]) for row in reader] </code></pre> <p>workers now has a list of all the workers</p> <pre><code>&gt;&gt;&gt; workers[0].name 'jon' </code></pre> <p><strong>added edit after questi...
12
2009-12-14T00:15:36Z
[ "python", "csv" ]
python csv into dictionary
1,898,305
<p>I am pretty new to python. I need to create a class that loads csv data into a dictionary.</p> <p>I want to be able to control the keys and value So let say the following code, I can pull out worker1.name or worker1.age anytime i want.</p> <pre><code>class ageName(object): '''class to represent a person''' def __i...
9
2009-12-14T00:08:45Z
2,545,452
<p>I second Mark's suggestion. In particular, look at DictReader from csv module that allows reading a comma separated (or delimited in general) file as a dictionary.</p> <p>Look at <a href="http://www.doughellmann.com/PyMOTW/csv/">PyMotW's coverage of csv module</a> for a quick reference and examples of usage of Dict...
8
2010-03-30T13:19:24Z
[ "python", "csv" ]
python csv into dictionary
1,898,305
<p>I am pretty new to python. I need to create a class that loads csv data into a dictionary.</p> <p>I want to be able to control the keys and value So let say the following code, I can pull out worker1.name or worker1.age anytime i want.</p> <pre><code>class ageName(object): '''class to represent a person''' def __i...
9
2009-12-14T00:08:45Z
18,079,331
<p>I know this is a pretty old question, but it's impossible to read this, and not think of the amazing new(ish) Python library, <code>pandas</code>. Its main unit of analysis is a think called a DataFrame which is modelled after the way R handles data.</p> <p>Let's say you have a (very silly) csv file called <code>ex...
9
2013-08-06T11:48:06Z
[ "python", "csv" ]
What is the difference between the __int__ and __index__ methods in Python 3?
1,898,310
<p><a href="http://docs.python.org/release/3.2.1/reference/datamodel.html">The Data Model section of the Python 3.2 documentation</a> provides the following descriptions for the <code>__int__</code> and <code>__index__</code> methods:</p> <blockquote> <h3><code>object.__int__(self)</code></h3> <p>Called to impl...
16
2009-12-14T00:11:34Z
1,898,323
<p>I believe you'll find the answer in <a href="http://www.python.org/dev/peps/pep-0357/" rel="nofollow">PEP 357</a>, which has this abstract:</p> <blockquote> <p>This PEP proposes adding an nb_index slot in PyNumberMethods and an __index__ special method so that arbitrary objects can be used whenever integers...
2
2009-12-14T00:15:30Z
[ "python", "casting" ]
What is the difference between the __int__ and __index__ methods in Python 3?
1,898,310
<p><a href="http://docs.python.org/release/3.2.1/reference/datamodel.html">The Data Model section of the Python 3.2 documentation</a> provides the following descriptions for the <code>__int__</code> and <code>__index__</code> methods:</p> <blockquote> <h3><code>object.__int__(self)</code></h3> <p>Called to impl...
16
2009-12-14T00:11:34Z
1,898,333
<p>See <a href="http://www.python.org/dev/peps/pep-0357/" rel="nofollow">PEP 357</a>: Allowing Any Object to be Used for Slicing.</p> <blockquote> <p>The <code>nb_int</code> method is used for coercion and so means something fundamentally different than what is requested here. This PEP proposes a method for som...
12
2009-12-14T00:18:21Z
[ "python", "casting" ]
Twisted ignoring data sent from MUD Clients?
1,898,411
<p>I have the following code (almost an exact copy of the Chat server example listed <a href="http://twistedmatrix.com/documents/current/core/examples/#auto1" rel="nofollow">here</a>:</p> <p>import twisted.scripts.twistd from twisted.protocols import basic from twisted.internet import protocol, reactor from twisted.ap...
2
2009-12-14T00:49:12Z
1,898,430
<p>Are you sure that the MUD clients send line ending chars after each line? The <em>lineReceived</em> will only be called after line ending char has been sent.</p> <p>EDIT:</p> <p>Here I found API docs for <a href="http://twistedmatrix.com/documents/8.1.0/api/twisted.protocols.basic.LineReceiver.html" rel="nofollow"...
1
2009-12-14T00:55:17Z
[ "python", "networking", "sockets", "tcp", "twisted" ]
Twisted ignoring data sent from MUD Clients?
1,898,411
<p>I have the following code (almost an exact copy of the Chat server example listed <a href="http://twistedmatrix.com/documents/current/core/examples/#auto1" rel="nofollow">here</a>:</p> <p>import twisted.scripts.twistd from twisted.protocols import basic from twisted.internet import protocol, reactor from twisted.ap...
2
2009-12-14T00:49:12Z
1,898,485
<p>In case anyone stumbles across this question with similar problems, I'm leaving my findings as the accepted answer so that people don't have to hunt the way I did.</p> <p>I fixed the issue by changing the delimiter value from in my Twisted protocol from "\r\n" (default), to just "\n" (which is what my MUD clients s...
3
2009-12-14T01:26:39Z
[ "python", "networking", "sockets", "tcp", "twisted" ]
Django Template Slice - Reversing Order
1,898,544
<p>Thanks to a very helpful hint from another question I learned I can limit the amount of values in a list by slicing it in the template as such:</p> <pre><code>{% for comment in thread.comment_set.all|slice:":3" %} </code></pre> <p>Now I would like to get the last 3 results of my comments so I figured a simple ":-3...
8
2009-12-14T01:50:50Z
1,898,587
<p>I haven't seen the dictsortreversed filter used too often, and according to the docs it takes a key to sort by</p> <pre><code>{% for comment in thread.comment_set.all|dictsortreversed:"name"|slice:"3" %} </code></pre>
8
2009-12-14T02:04:34Z
[ "python", "django", "django-templates" ]
Django Template Slice - Reversing Order
1,898,544
<p>Thanks to a very helpful hint from another question I learned I can limit the amount of values in a list by slicing it in the template as such:</p> <pre><code>{% for comment in thread.comment_set.all|slice:":3" %} </code></pre> <p>Now I would like to get the last 3 results of my comments so I figured a simple ":-3...
8
2009-12-14T01:50:50Z
1,898,692
<p>Django's database queries are evaluated lazily, so the result of <code>thread.comment_set.all</code> is a QuerySet, not a list. A QuerySet supports many list-like functions, but not negative slicing, so the indexing error is not coming from the template filter itself. (If you're curious, slices on QuerySet objects g...
11
2009-12-14T03:00:43Z
[ "python", "django", "django-templates" ]
Django Template Slice - Reversing Order
1,898,544
<p>Thanks to a very helpful hint from another question I learned I can limit the amount of values in a list by slicing it in the template as such:</p> <pre><code>{% for comment in thread.comment_set.all|slice:":3" %} </code></pre> <p>Now I would like to get the last 3 results of my comments so I figured a simple ":-3...
8
2009-12-14T01:50:50Z
1,898,951
<p>Can't you just slice the list before passing it to your template?</p>
0
2009-12-14T04:36:55Z
[ "python", "django", "django-templates" ]
Django Template Slice - Reversing Order
1,898,544
<p>Thanks to a very helpful hint from another question I learned I can limit the amount of values in a list by slicing it in the template as such:</p> <pre><code>{% for comment in thread.comment_set.all|slice:":3" %} </code></pre> <p>Now I would like to get the last 3 results of my comments so I figured a simple ":-3...
8
2009-12-14T01:50:50Z
1,899,278
<p>Use the "ordering" attribute of Meta class of the Comment class to set the required ordering of elements.</p> <p>IMO templates is not the proper place to order your dataset. Ordering should be done in either Models or Views.</p>
1
2009-12-14T06:37:08Z
[ "python", "django", "django-templates" ]
Django Template Slice - Reversing Order
1,898,544
<p>Thanks to a very helpful hint from another question I learned I can limit the amount of values in a list by slicing it in the template as such:</p> <pre><code>{% for comment in thread.comment_set.all|slice:":3" %} </code></pre> <p>Now I would like to get the last 3 results of my comments so I figured a simple ":-3...
8
2009-12-14T01:50:50Z
13,872,983
<p>You can reverse a queryset if it is already ordered by "created". So here is a faster solution.</p> <pre><code>{% for comment in thread.comment_set.all.reverse|slice:":3" %} </code></pre> <p>Also if you don't want in reversed order.</p> <pre><code>{% for comment in thread.comment_set.all.reverse|slice:":3"|dictso...
0
2012-12-14T05:06:09Z
[ "python", "django", "django-templates" ]
Django Template Slice - Reversing Order
1,898,544
<p>Thanks to a very helpful hint from another question I learned I can limit the amount of values in a list by slicing it in the template as such:</p> <pre><code>{% for comment in thread.comment_set.all|slice:":3" %} </code></pre> <p>Now I would like to get the last 3 results of my comments so I figured a simple ":-3...
8
2009-12-14T01:50:50Z
28,307,244
<p>I needed just this and made a more complete solution, I think. Hope people find it useful. The view needs to find the id of the <a href="http://python.6.x6.nabble.com/How-to-find-out-the-id-of-the-last-record-in-a-table-td78782.html" rel="nofollow">last inserted record (example here)</a>. You have to reverse orde...
0
2015-02-03T19:34:26Z
[ "python", "django", "django-templates" ]
Remove whitespace in Python using string.whitespace
1,898,656
<p>Python's string.whitespace is great:</p> <pre><code>&gt;&gt;&gt; string.whitespace '\t\n\x0b\x0c\r ' </code></pre> <p>How do I use this with a string without resorting to manually typing in '\t|\n|... etc for regex? </p> <p>For example, it should be able to turn: "Please \n don't \t hurt \x0b me."</p> <p>into</p...
45
2009-12-14T02:30:34Z
1,898,685
<p>a starting point .. (although it's not shorter than manually assembling the whitespace circus) ..</p> <pre><code>&gt;&gt;&gt; from string import whitespace as ws &gt;&gt;&gt; import re &gt;&gt;&gt; p = re.compile('(%s)' % ('|'.join([c for c in ws]))) &gt;&gt;&gt; s = "Please \n don't \t hurt \x0b me." &gt;&gt;&gt...
1
2009-12-14T02:49:24Z
[ "python", "string", "whitespace" ]
Remove whitespace in Python using string.whitespace
1,898,656
<p>Python's string.whitespace is great:</p> <pre><code>&gt;&gt;&gt; string.whitespace '\t\n\x0b\x0c\r ' </code></pre> <p>How do I use this with a string without resorting to manually typing in '\t|\n|... etc for regex? </p> <p>For example, it should be able to turn: "Please \n don't \t hurt \x0b me."</p> <p>into</p...
45
2009-12-14T02:30:34Z
1,898,689
<p>You could use the translate method</p> <pre><code>import string s = "Please \n don't \t hurt \x0b me." s = s.translate(None, string.whitespace[:-1]) # python 2.6 and up s = s.translate(string.maketrans('',''), string.whitespace[:-1]) # python 2.5, dunno further down &gt;&gt;&gt; s "Please don't hurt me." </code...
1
2009-12-14T02:58:29Z
[ "python", "string", "whitespace" ]
Remove whitespace in Python using string.whitespace
1,898,656
<p>Python's string.whitespace is great:</p> <pre><code>&gt;&gt;&gt; string.whitespace '\t\n\x0b\x0c\r ' </code></pre> <p>How do I use this with a string without resorting to manually typing in '\t|\n|... etc for regex? </p> <p>For example, it should be able to turn: "Please \n don't \t hurt \x0b me."</p> <p>into</p...
45
2009-12-14T02:30:34Z
1,898,835
<p>There is a special-case shortcut for exactly this use case!</p> <p>If you call <code>str.split</code> without an argument, it splits on runs of whitespace instead of single characters. So:</p> <pre><code>&gt;&gt;&gt; ' '.join("Please \n don't \t hurt \x0b me.".split()) "Please don't hurt me." </code></pre>
139
2009-12-14T03:59:41Z
[ "python", "string", "whitespace" ]
Remove whitespace in Python using string.whitespace
1,898,656
<p>Python's string.whitespace is great:</p> <pre><code>&gt;&gt;&gt; string.whitespace '\t\n\x0b\x0c\r ' </code></pre> <p>How do I use this with a string without resorting to manually typing in '\t|\n|... etc for regex? </p> <p>For example, it should be able to turn: "Please \n don't \t hurt \x0b me."</p> <p>into</p...
45
2009-12-14T02:30:34Z
1,898,927
<p>What's wrong with the <code>\s</code> character class?</p> <pre><code>&gt;&gt;&gt; import re &gt;&gt;&gt; pattern = re.compile(r'\s+') &gt;&gt;&gt; re.sub(pattern, ' ', "Please \n don't \t hurt \x0b me.") "Please don't hurt me." </code></pre>
13
2009-12-14T04:29:39Z
[ "python", "string", "whitespace" ]
Remove whitespace in Python using string.whitespace
1,898,656
<p>Python's string.whitespace is great:</p> <pre><code>&gt;&gt;&gt; string.whitespace '\t\n\x0b\x0c\r ' </code></pre> <p>How do I use this with a string without resorting to manually typing in '\t|\n|... etc for regex? </p> <p>For example, it should be able to turn: "Please \n don't \t hurt \x0b me."</p> <p>into</p...
45
2009-12-14T02:30:34Z
1,900,041
<p>Let's make some reasonable assumptions:</p> <p>(1) You really want to replace any run of whitespace characters with a single space (a run is of length 1 or greater).</p> <p>(2) You would like the same code to work with minimal changes under Python 2.X with unicode objects.</p> <p>(3) You don't want your code to a...
9
2009-12-14T10:09:26Z
[ "python", "string", "whitespace" ]
Tree Transformations Using Visitor Pattern
1,898,967
<p>(Disclaimer: these examples are given in the context of building a compiler, but this question is all about the Visitor pattern and does not require any knowledge of compiler theory.) I'm going through Andrew Appel's Modern Compiler Implementation in Java to try to teach myself compiler theory (so no, this isn't h...
7
2009-12-14T04:41:00Z
1,899,011
<p>Caveat: I haven't read that book.</p> <p>The method may be void-typed, but in Java (which the book was written for) it is also part of an object. So, the visitor method can build up the structure in a local member variable, thus maintaining the necessary context between calls.</p> <p>So, for instance, your print ...
0
2009-12-14T05:02:54Z
[ "java", "python", "tree", "abstract-syntax-tree", "visitor-pattern" ]
Tree Transformations Using Visitor Pattern
1,898,967
<p>(Disclaimer: these examples are given in the context of building a compiler, but this question is all about the Visitor pattern and does not require any knowledge of compiler theory.) I'm going through Andrew Appel's Modern Compiler Implementation in Java to try to teach myself compiler theory (so no, this isn't h...
7
2009-12-14T04:41:00Z
1,899,049
<p>Look at source code of <a href="http://people.cs.uchicago.edu/~varmaa/mini%5Fc/" rel="nofollow">THIS</a> compiler. I think that the guy has used Visitor pattern.</p>
1
2009-12-14T05:18:06Z
[ "java", "python", "tree", "abstract-syntax-tree", "visitor-pattern" ]
Tree Transformations Using Visitor Pattern
1,898,967
<p>(Disclaimer: these examples are given in the context of building a compiler, but this question is all about the Visitor pattern and does not require any knowledge of compiler theory.) I'm going through Andrew Appel's Modern Compiler Implementation in Java to try to teach myself compiler theory (so no, this isn't h...
7
2009-12-14T04:41:00Z
1,900,050
<p>A SAX parser is a kind of visitor. To avoid adding a return value to the method, you can use a stack:</p> <pre><code>class Visitor { Stack&lt;Node&gt; stack = new Stack&lt;Node&gt;(); // . . . void visitPlus(PlusExp pe) { pe.left.accept(this); pe.right.accept(this); Node b = sta...
8
2009-12-14T10:11:11Z
[ "java", "python", "tree", "abstract-syntax-tree", "visitor-pattern" ]
Tools for implementing a watchdog timer in python
1,899,015
<p>I'm writing some code for testing multithreaded programs (student homework--likely buggy), and want to be able to detect when they deadlock. When running properly, the programs regularly produce output to stdout, so that makes it fairly straightforward: if no output for X seconds, kill it and report deadlock. Here...
2
2009-12-14T05:04:20Z
1,899,112
<p>You can use expect (tcl) or pexpect (python) to do this.</p> <pre><code>import pexpect c=pexpect.spawn('your_command') c.expect("expected_output_regular_expression", timeout=10) </code></pre>
5
2009-12-14T05:41:00Z
[ "python", "unix", "multithreading", "deadlock", "watchdog" ]
Tools for implementing a watchdog timer in python
1,899,015
<p>I'm writing some code for testing multithreaded programs (student homework--likely buggy), and want to be able to detect when they deadlock. When running properly, the programs regularly produce output to stdout, so that makes it fairly straightforward: if no output for X seconds, kill it and report deadlock. Here...
2
2009-12-14T05:04:20Z
1,899,345
<p>Here's a very slightly tested, but seemingly working, solution:</p> <pre><code>import sys import time import pexpect # From http://pypi.python.org/pypi/pexpect/ DEADLOCK = 1 def run_with_watchdog(shell_command, timeout): """Run &lt;shell_command&gt;, watching for output, and echoing it to stdout. If the p...
1
2009-12-14T06:57:45Z
[ "python", "unix", "multithreading", "deadlock", "watchdog" ]
Tools for implementing a watchdog timer in python
1,899,015
<p>I'm writing some code for testing multithreaded programs (student homework--likely buggy), and want to be able to detect when they deadlock. When running properly, the programs regularly produce output to stdout, so that makes it fairly straightforward: if no output for X seconds, kill it and report deadlock. Here...
2
2009-12-14T05:04:20Z
16,148,643
<p>Another solution:</p> <pre><code>class Watchdog: def __init__(self, timeout, userHandler=None): # timeout in seconds self.timeout = timeout if userHandler != None: self.timer = Timer(self.timeout, userHandler) else: self.timer = Timer(self.timeout, self.handler) def reset(self): sel...
0
2013-04-22T13:42:33Z
[ "python", "unix", "multithreading", "deadlock", "watchdog" ]
Serializing resultset returned from mysqldb in python
1,899,110
<p>Can anyone please help me in serializing resultset returned using mysqldb in python?</p> <p>I get typeerror: <code>datetime.date(2007, 11, 15) is not JSON serializable</code></p> <p>What is the best way to do serialize into Json object in python?</p> <p>I am using json.dumps(resultset) to serialize resultset...</...
0
2009-12-14T05:40:24Z
1,899,118
<p>You can use <a href="http://www.ietf.org/rfc/rfc3339.txt" rel="nofollow">rfc3339</a> strings instead:</p> <pre><code> json.dump(datetime.now().strftime('%Y-%m-%dT%H:%M:%S')) </code></pre> <p>See: <a href="http://stackoverflow.com/questions/455580/json-datetime-between-python-and-javascript">http://stackoverflow.c...
1
2009-12-14T05:43:01Z
[ "python", "django", "json", "mysql" ]
Serializing resultset returned from mysqldb in python
1,899,110
<p>Can anyone please help me in serializing resultset returned using mysqldb in python?</p> <p>I get typeerror: <code>datetime.date(2007, 11, 15) is not JSON serializable</code></p> <p>What is the best way to do serialize into Json object in python?</p> <p>I am using json.dumps(resultset) to serialize resultset...</...
0
2009-12-14T05:40:24Z
1,899,219
<p><a href="http://docs.djangoproject.com/en/dev/topics/serialization/" rel="nofollow">Serializing Django objects (Django Docs)</a></p> <p><a href="http://diveintopython3.org/serializing.html" rel="nofollow">Serializing Python Objects (Dive Into Python 3)</a></p>
0
2009-12-14T06:21:34Z
[ "python", "django", "json", "mysql" ]
Serializing resultset returned from mysqldb in python
1,899,110
<p>Can anyone please help me in serializing resultset returned using mysqldb in python?</p> <p>I get typeerror: <code>datetime.date(2007, 11, 15) is not JSON serializable</code></p> <p>What is the best way to do serialize into Json object in python?</p> <p>I am using json.dumps(resultset) to serialize resultset...</...
0
2009-12-14T05:40:24Z
1,930,210
<p>Set the "default" function passed to json.dump:</p> <pre><code>&gt;&gt;&gt; d=datetime.datetime.now() &gt;&gt;&gt; json.dumps(d,default=str) '"2009-12-18 14:22:21.405095"' </code></pre>
3
2009-12-18T19:24:20Z
[ "python", "django", "json", "mysql" ]
Python login script
1,899,174
<p>I have the following script to logon to a url,but on submit in the webpage i call</p> <pre><code>&lt;input type=button value="go" onclick="Search()";&gt; </code></pre> <p>How to do the same in the following script instead of submit......</p> <pre><code>import urllib, urllib2, time username = "sumname" password =...
0
2009-12-14T06:07:35Z
1,899,251
<p>urllib and urllib2 are not the best ways to simulate browser interaction! You should rather be looking at <a href="http://wwwsearch.sourceforge.net/mechanize/" rel="nofollow">mechanize</a> (which does plug into urllib2). It's possible to simulate such interaction on "bare" urllib2, but it's just too much work and ...
2
2009-12-14T06:30:00Z
[ "python", "scripting" ]
How can I pass my ID and my password to a website in Python using Google App Engine?
1,899,259
<p>Here is a piece of code that I use to fetch a web page HTML source (code) by its URL using Google App Engine:</p> <pre><code>from google.appengine.api import urlfetch url = "http://www.google.com/" result = urlfetch.fetch(url) if result.status_code == 200: print "content-type: text/plain" print print resul...
1
2009-12-14T06:31:26Z
1,899,320
<p>You can check for an HTTP status code of 401, "authorization required", and provide the kind of HTTP authorization (basic, digest, whatever) that the site is asking for -- see e.g. <a href="http://www.checkupdown.com/status/E401.html" rel="nofollow">here</a> for more details (there's not much that's GAE specific her...
3
2009-12-14T06:50:44Z
[ "python", "google-app-engine", "passwords" ]
How can I pass my ID and my password to a website in Python using Google App Engine?
1,899,259
<p>Here is a piece of code that I use to fetch a web page HTML source (code) by its URL using Google App Engine:</p> <pre><code>from google.appengine.api import urlfetch url = "http://www.google.com/" result = urlfetch.fetch(url) if result.status_code == 200: print "content-type: text/plain" print print resul...
1
2009-12-14T06:31:26Z
1,899,719
<p>As Alex said you can check for status code and see what type of autorization it wants, but you can not generalize it as some sites will not give any hint or only allow login thru a non standard form, in those cases you may have to automate the login process using forms, for that you can use library like twill (<a hr...
1
2009-12-14T08:46:07Z
[ "python", "google-app-engine", "passwords" ]
django urlencode filter
1,899,407
<p>I have a problem with encoding urls using build-in django urlencode filter. When I use it on default django server everything is fine. But on apache2 it doesn`t work, ie. i have a tag called C#. On localhost my url is encoded to ...tags/C%23/ but on apache2 it is tags/C/</p> <p>What should I do?</p>
0
2009-12-14T07:15:00Z
1,900,849
<p>I guess this is a bug with <a href="https://issues.apache.org/bugzilla/show%5Fbug.cgi?id=34602" rel="nofollow">apache</a>, simplest solution would be do url encoding twice or do a base64 encoding. </p>
0
2009-12-14T13:10:57Z
[ "python", "django", "urlencode" ]
python url fetch help - regex
1,899,412
<p>I have a web site where there are links like <code>&lt;a href="http://www.example.com?read.php=123"&gt;</code> Can anybody show me how to get all the numbers (123, in this case) in such links using python? I don't know how to construct a regex. Thanks in advance.</p>
0
2009-12-14T07:15:35Z
1,899,417
<pre><code>import re re.findall("\?read\.php=(\d+)",data) </code></pre>
3
2009-12-14T07:17:22Z
[ "python", "regex" ]
python url fetch help - regex
1,899,412
<p>I have a web site where there are links like <code>&lt;a href="http://www.example.com?read.php=123"&gt;</code> Can anybody show me how to get all the numbers (123, in this case) in such links using python? I don't know how to construct a regex. Thanks in advance.</p>
0
2009-12-14T07:15:35Z
1,899,461
<p>/[0-9]/</p> <p>thats the regex sytax you want</p> <p>for reference see</p> <p><a href="http://gnosis.cx/publish/programming/regular%5Fexpressions.html" rel="nofollow">http://gnosis.cx/publish/programming/regular%5Fexpressions.html</a></p>
-1
2009-12-14T07:30:28Z
[ "python", "regex" ]
python url fetch help - regex
1,899,412
<p>I have a web site where there are links like <code>&lt;a href="http://www.example.com?read.php=123"&gt;</code> Can anybody show me how to get all the numbers (123, in this case) in such links using python? I don't know how to construct a regex. Thanks in advance.</p>
0
2009-12-14T07:15:35Z
1,899,657
<p>One without the need for regex</p> <pre><code>&gt;&gt;&gt; s='&lt;a href="http://www.example.com?read.php=123"&gt;' &gt;&gt;&gt; for item in s.split("&gt;"): ... if "href" in item: ... print item[item.index("a href")+len("a href="): ] ... "http://www.example.com?read.php=123" </code></pre> <p>if you wa...
-1
2009-12-14T08:29:59Z
[ "python", "regex" ]
python url fetch help - regex
1,899,412
<p>I have a web site where there are links like <code>&lt;a href="http://www.example.com?read.php=123"&gt;</code> Can anybody show me how to get all the numbers (123, in this case) in such links using python? I don't know how to construct a regex. Thanks in advance.</p>
0
2009-12-14T07:15:35Z
1,899,726
<p>While the other answers are sort of correct, you should probably use the urllib2 library instead;</p> <pre><code>from urllib2 import urlparse import re urlre = re.compile('&lt;a[^&gt;]+href="([^"]+)"[^&gt;]*&gt;',re.IGNORECASE) links = urlre.findall('&lt;a href="http://www.example.com?read.php=123"&gt;') for link i...
1
2009-12-14T08:47:55Z
[ "python", "regex" ]
python url fetch help - regex
1,899,412
<p>I have a web site where there are links like <code>&lt;a href="http://www.example.com?read.php=123"&gt;</code> Can anybody show me how to get all the numbers (123, in this case) in such links using python? I don't know how to construct a regex. Thanks in advance.</p>
0
2009-12-14T07:15:35Z
1,899,743
<p>"If you have a problem, and decide to use regex, now you have two problems..." </p> <p>If you are reading one particular web page and you know how it is formatted, then regex is fine - you can use S. Mark's answer. To parse a particular link, you can use Kimvai's answer. However, to get all the links from a page, y...
2
2009-12-14T08:52:25Z
[ "python", "regex" ]
python url fetch help - regex
1,899,412
<p>I have a web site where there are links like <code>&lt;a href="http://www.example.com?read.php=123"&gt;</code> Can anybody show me how to get all the numbers (123, in this case) in such links using python? I don't know how to construct a regex. Thanks in advance.</p>
0
2009-12-14T07:15:35Z
1,902,543
<p>This will work irrespective of how your links are formatted (e.g. if some look like <code>&lt;a href="foo=123"/&gt;</code> and some look like <code>&lt;A TARGET="_blank" HREF='foo=123'/&gt;</code>).</p> <pre><code>import re from BeautifulSoup import BeautifulSoup soup = BeautifulSoup(html) p = re.compile('^.*=([\d]...
1
2009-12-14T18:15:11Z
[ "python", "regex" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
1,899,506
<p>Do you have an empty <code>__init__.py</code> file in both directories to let python know that the dirs are modules?</p> <p>The basic outline when you are not running from within the folder (ie maybe from pylint's, though I haven't used that) is:</p> <pre><code>topdir\ __init__.py functions_etc.py subdir\ ...
8
2009-12-14T07:45:20Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
1,907,001
<p>Maybe by manually appending the dir inside the PYTHONPATH?</p> <pre><code>sys.path.append(dirname) </code></pre>
2
2009-12-15T12:08:13Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
1,912,664
<p>One workaround that I only just discovered is to actually just run PyLint for the entire package, rather than a single file. Somehow, it manages to find imported module then.</p>
2
2009-12-16T06:15:10Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
3,065,082
<p>There are two options I'm aware of.</p> <p>One, change the <code>PYTHONPATH</code> environment variable to include the directory above your module.</p> <p>Alternatively, edit <code>~/.pylintrc</code> to include the directory above your module, like this:</p> <pre><code>[General] init-hook='import sys; sys.path.ap...
43
2010-06-17T19:46:38Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
3,065,203
<p><strike>Try</p> <pre><code>if __name__ == '__main__': from [whatever the name of your package is] import one else: import one </code></pre> <p>Note that in Python 3, the syntax for the part in the <code>else</code> clause would be</p> <pre><code>from .. import one </code></pre> <p></strike></p> <p>On se...
1
2010-06-17T20:03:20Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
4,162,709
<p>I don't know how it works with WingIDE, but for using PyLint with Geany, I set my external command to:</p> <pre><code>PYTHONPATH=${PYTHONPATH}:$(dirname %d) pylint --output-format=parseable --reports=n "%f" </code></pre> <p>where %f is the filename, and %d is the path. Might be useful for someone :)</p>
5
2010-11-12T08:12:32Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
19,884,292
<p>I had the same problem and since i could not find a answer I hope this can help anyone with a similar problem. </p> <p>I use flymake with epylint. Basically what i did was add a dired-mode-hook that check if the dired directory is a python package directory. If it is I add it to the PYTHONPATH. In my case I conside...
1
2013-11-09T23:11:44Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
23,375,283
<p>1) sys.path is a list. </p> <p>2) <strong>The problem is sometimes the sys.path is not your virtualenv.path</strong> and you want use pylint in your virtualenv</p> <p>3) So like said, use init-hook (pay attetion in ' and " the parse of pylint is strict)</p> <pre><code>[Master] init-hook='sys.path = ["/path/myapps...
6
2014-04-29T21:06:38Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
36,986,942
<p>In case anybody is looking for a way to run pylint as an external tool in PyCharm and have it work with their virtual environments (why I came to this question), here's how I solved it:</p> <ol> <li>In PyCharm > Preferences > Tools > External Tools, Add or Edit an item for pylint.</li> <li>In the Tool Settings of t...
1
2016-05-02T16:15:43Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
37,238,692
<p>The key is to add your project directory to <code>sys.path</code> without considering about the env variable.</p> <p>For someone who use VSCode, here's a one-line solution for you if there's a base directory of your project:</p> <pre><code>[MASTER] init-hook='base_dir="my_spider"; import sys,os,re; _re=re.search(r...
0
2016-05-15T13:09:15Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
38,596,160
<p>I had this same issue and fixed it by installing pylint in my virtualenv and then adding a .pylintrc file to my project directory with the following in the file:</p> <pre><code>[Master] init-hook='sys.path = list(); sys.path.append("./Lib/site-packages/")' </code></pre>
0
2016-07-26T17:17:15Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
39,207,275
<p>The solution to alter path in init-hook is good, but I dislike the fact that I had to add absolute path there, as result I can not share this pylintrc file among the developers of the project. This solution using relative path to pylintrc file works better for me:</p> <pre><code>[MASTER] init-hook="from pylint.conf...
0
2016-08-29T13:15:26Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
PyLint "Unable to import" error - how to set PYTHONPATH?
1,899,436
<p>I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.</p> <pre><code>__init__.py myapp.py one.py subdir\ __init__.py two.py </code></pre> <p>Inside <code>two.py</code> I have <code>import one</code...
50
2009-12-14T07:22:05Z
39,437,713
<p>I had to update the system <code>PYTHONPATH</code> variable to add my App Engine path. In my case I just had to edit my <code>~/.bashrc</code> file and add the following line:</p> <p><code>export PYTHONPATH=$PYTHONPATH:/path/to/google_appengine_folder</code></p> <p>In fact, I tried setting the <code>init-hook</cod...
0
2016-09-11T15:30:25Z
[ "python", "virtualenv", "pylint", "pythonpath" ]
Design pattern help
1,899,503
<p>I have some algorithms to do that are very similar in very aspects but are all different. </p> <p>I'll try to give an example of what I mean.</p> <p>Let's assume I have a Robot class. This class should be the "base" of all classes. It provides basic mechanisms to make the robot work in its environment. It might or...
3
2009-12-14T07:42:30Z
1,899,521
<p>I'm not a Python guy, but a quick look indicates they support multiple inheritance which can be used like Java Interfaces (Python does not seem to support interfaces). So you can have essentially superclasses for RobotHand then RobotHumanHand, RobotBladeHand, etc, Same with eyes, feet what have you. This is a rea...
1
2009-12-14T07:49:56Z
[ "python", "design-patterns" ]
Design pattern help
1,899,503
<p>I have some algorithms to do that are very similar in very aspects but are all different. </p> <p>I'll try to give an example of what I mean.</p> <p>Let's assume I have a Robot class. This class should be the "base" of all classes. It provides basic mechanisms to make the robot work in its environment. It might or...
3
2009-12-14T07:42:30Z
1,899,527
<p>I think your robot should have a list of ports i.e. a number of injected components each robot may have. Your <code>Robot</code> class will be a container of <code>RobotPart</code>s. You can have specific parts to have specific interfaces. <code>RobotHand</code> extends <code>RobotPart</code> and <code>Robot</code> ...
4
2009-12-14T07:51:18Z
[ "python", "design-patterns" ]
Design pattern help
1,899,503
<p>I have some algorithms to do that are very similar in very aspects but are all different. </p> <p>I'll try to give an example of what I mean.</p> <p>Let's assume I have a Robot class. This class should be the "base" of all classes. It provides basic mechanisms to make the robot work in its environment. It might or...
3
2009-12-14T07:42:30Z
1,899,536
<p>The design patterns I'd probably go with for such a problem are: <a href="http://stackoverflow.com/questions/130794/what-is-dependency-injection">Dependency Injection</a> and a framework to go with it, the Composite pattern, and the Builder pattern. They should basically let you separate the creation of your Robots ...
5
2009-12-14T07:53:42Z
[ "python", "design-patterns" ]
Design pattern help
1,899,503
<p>I have some algorithms to do that are very similar in very aspects but are all different. </p> <p>I'll try to give an example of what I mean.</p> <p>Let's assume I have a Robot class. This class should be the "base" of all classes. It provides basic mechanisms to make the robot work in its environment. It might or...
3
2009-12-14T07:42:30Z
8,545,397
<p>If you are seeking for a design pattern, then I suggest you strategy pattern.Because Implementing this pattern you can dynamically interchange the components of robot.</p>
3
2011-12-17T14:30:00Z
[ "python", "design-patterns" ]
Python urllib proxy
1,899,901
<p>I'm trying to fetch some urls via urllib and mechanize through my proxy.</p> <p>With mechanize I try the following:</p> <pre><code>from mechanize import Browser import re br = Browser() br.set_proxies({"http": "MYUSERNAME:*******@itmalsproxy.italy.local:8080"}) br.open("http://www.example.com/") </code></pre> <p...
2
2009-12-14T09:31:19Z
1,899,914
<p>Maybe the proxy is using NTLM authentication?</p> <p>If that is the case, you can try using the <a href="http://ntlmaps.sourceforge.net/" rel="nofollow">NTLM Authorization Proxy Server</a> (see also <a href="http://stackoverflow.com/questions/1130857/following-a-javascript-postback-using-com-ie-automation-to-save-t...
0
2009-12-14T09:36:12Z
[ "python", "proxy", "mechanize" ]
Python urllib proxy
1,899,901
<p>I'm trying to fetch some urls via urllib and mechanize through my proxy.</p> <p>With mechanize I try the following:</p> <pre><code>from mechanize import Browser import re br = Browser() br.set_proxies({"http": "MYUSERNAME:*******@itmalsproxy.italy.local:8080"}) br.open("http://www.example.com/") </code></pre> <p...
2
2009-12-14T09:31:19Z
1,925,655
<p>you might get more info from the response headers</p> <p><code>print br.response().info()</code></p>
0
2009-12-18T01:04:06Z
[ "python", "proxy", "mechanize" ]
Python urllib proxy
1,899,901
<p>I'm trying to fetch some urls via urllib and mechanize through my proxy.</p> <p>With mechanize I try the following:</p> <pre><code>from mechanize import Browser import re br = Browser() br.set_proxies({"http": "MYUSERNAME:*******@itmalsproxy.italy.local:8080"}) br.open("http://www.example.com/") </code></pre> <p...
2
2009-12-14T09:31:19Z
2,400,908
<p>When your web browser uses proxy server to surf the Web from within your local network your may be required to authenticate youself to use proxy. Google ntlmaps.</p>
0
2010-03-08T11:29:22Z
[ "python", "proxy", "mechanize" ]
Python: Amount of wall time a process has been running
1,899,922
<p>I want to do something like this:</p> <pre><code>try: pid = int(file(lock_file, "r").read()) print "%s exists with pid: %s" % (lock_file, pid) if not check_pid(pid): print "%s not running. Phantom lock file? Continuing anyways" % pid elif wall_time(pid) &gt; 60 * 5: print "%s has bee...
3
2009-12-14T09:40:15Z
1,899,939
<p>Perhaps you could look at the creation time of the lock file. This wouldn't be guaranteed correct, but it would be correct in most cases (and the consequences of getting it wrong are minimal).</p>
1
2009-12-14T09:44:57Z
[ "python", "process" ]
Python: Amount of wall time a process has been running
1,899,922
<p>I want to do something like this:</p> <pre><code>try: pid = int(file(lock_file, "r").read()) print "%s exists with pid: %s" % (lock_file, pid) if not check_pid(pid): print "%s not running. Phantom lock file? Continuing anyways" % pid elif wall_time(pid) &gt; 60 * 5: print "%s has bee...
3
2009-12-14T09:40:15Z
1,899,964
<p>If you do not want to use the modify time of the lockfile for some reason, you could just write it down in the file:</p> <pre><code>pid, start_time = map(int, file(lock_file, "r").read().split()) ... lock.write("%s %d" % (os.getpid(), time.time())) </code></pre>
1
2009-12-14T09:51:28Z
[ "python", "process" ]
Why is SQLAlchemy/associationproxy duplicating my tags?
1,899,984
<p>I'm trying to use association proxy for tags, in a very similar scenario to <a href="http://www.sqlalchemy.org/docs/05/reference/ext/associationproxy.html" rel="nofollow">the example in the docs</a>. Here is a subset of my schema (it's a blog), using declarative:</p> <pre><code>class Tag(Base): __tablename__ = ...
4
2009-12-14T09:55:54Z
1,900,122
<p>Disclaimer: it's been ages since I used SQLAlchemy so this is more of a guess than anything.</p> <p>It looks like you're expecting SQLAlchemy to magically take the string 'bar' and look up the relevant Tag for it when performing the insert on the many-to-many table. I expect this is invalid, because the field in qu...
3
2009-12-14T10:31:32Z
[ "python", "orm", "tags", "sqlalchemy", "declarative" ]
Why is SQLAlchemy/associationproxy duplicating my tags?
1,899,984
<p>I'm trying to use association proxy for tags, in a very similar scenario to <a href="http://www.sqlalchemy.org/docs/05/reference/ext/associationproxy.html" rel="nofollow">the example in the docs</a>. Here is a subset of my schema (it's a blog), using declarative:</p> <pre><code>class Tag(Base): __tablename__ = ...
4
2009-12-14T09:55:54Z
1,900,145
<p>I've never used SQLAlchemy 0.5 yet (my last app using it was 0.4 based) but I can see one quirk in your code: you should <em>modify</em> the association_proxy object, not reassign it.</p> <p>Try doing something like:</p> <pre><code>e.tags.append(u"bar") </code></pre> <p>Instead of</p> <pre><code>e.tags = ... </c...
0
2009-12-14T10:37:41Z
[ "python", "orm", "tags", "sqlalchemy", "declarative" ]
[GAE]How to set `inline` if in template
1,900,175
<p>Coming from PHP world, I used to create select box like this:</p> <pre><code>&lt;select&gt; &lt;?php foreach($arrField as $idx=&gt;$val){?&gt; &lt;option &lt;?php echo ($fieldVal == $idx ? "selected='selected'" : ''); ?&gt;&gt;&lt;?php echo $val; ?&gt;&lt;/option&gt; &lt;?php } ?&gt; &lt;/select&gt; </code></pre...
1
2009-12-14T10:44:59Z
1,900,767
<p>You will need to use (if you are using Django):</p> <pre><code>{% ifequal id "something"%}selected='selected'{% endifequal %} </code></pre> <p>You will also need to make sure "id" is a variable you pass into templates.Render()</p> <p>P</p>
2
2009-12-14T12:55:14Z
[ "python", "google-app-engine", "templates", "web-applications" ]
How to access a standard-library module in Python when there is a local module with the same name?
1,900,189
<p>How can a standard-library module (say math) be accessed when a file prog.py is placed in the same directory as a local module with the same name (math.py)?</p> <p>I'm asking this question because I would like to create a package <code>uncertainties</code> that one can use as</p> <pre><code>import uncertainties fr...
12
2009-12-14T10:49:52Z
1,900,318
<p>Why can't you rename your local module again? </p> <p>Clearly, it's not a "total" replacement, if you still need things from the installed <code>uncertainties</code>. </p> <p>Since it's a partial replacement, you should not give it the same name. </p> <p>What's different? What's the same? Pick a better name ...
5
2009-12-14T11:18:05Z
[ "python", "import", "module", "standard-library" ]
How to access a standard-library module in Python when there is a local module with the same name?
1,900,189
<p>How can a standard-library module (say math) be accessed when a file prog.py is placed in the same directory as a local module with the same name (math.py)?</p> <p>I'm asking this question because I would like to create a package <code>uncertainties</code> that one can use as</p> <pre><code>import uncertainties fr...
12
2009-12-14T10:49:52Z
1,900,333
<p>You are looking for Absolute/Relative imports from <a href="https://www.python.org/dev/peps/pep-0328/">PEP 328</a>, available with <a href="http://docs.python.org/whatsnew/2.5.html#pep-328">2.5 and upward</a>.</p> <blockquote>In Python 2.5, you can switch import‘s behaviour to absolute imports using a from __futu...
17
2009-12-14T11:21:00Z
[ "python", "import", "module", "standard-library" ]
What's a neater, more pythonic way to do the following enumeration?
1,900,195
<pre><code>for row, instrument in enumerate(instruments): for col, value in enumerate(instrument): self.table.SetValue(row, col, value) </code></pre>
1
2009-12-14T10:52:17Z
1,900,278
<p>One option is using a list comprehension:</p> <pre><code>[self.table.setValue(row, col, value) for row, instrument in enumerate(instruments) for col, value in enumerate(instrument)] </code></pre> <p>Not sure if it is any neater or more pythonic... But it is another way of expressing the loop.</p> <p...
-3
2009-12-14T11:10:14Z
[ "python", "enumeration" ]
What's a neater, more pythonic way to do the following enumeration?
1,900,195
<pre><code>for row, instrument in enumerate(instruments): for col, value in enumerate(instrument): self.table.SetValue(row, col, value) </code></pre>
1
2009-12-14T10:52:17Z
1,900,289
<p>What you are calling <code>row</code> is not a row, it is a row index. <code>instrument</code> is a row. Apart from that:</p> <p>If the only tool that you have is a <code>SetValue(row_index, column_index, value)</code> method <em>and that method does more than help replicate the structure of <code>instruments</code...
4
2009-12-14T11:12:40Z
[ "python", "enumeration" ]
What's a neater, more pythonic way to do the following enumeration?
1,900,195
<pre><code>for row, instrument in enumerate(instruments): for col, value in enumerate(instrument): self.table.SetValue(row, col, value) </code></pre>
1
2009-12-14T10:52:17Z
1,900,721
<p>The fundamental question is not regarding this loop.</p> <p>The fundamental questions are these:</p> <p>1) Where does this <code>instruments</code> structure come from, and why do you need to reorganize it?</p> <p>2) What is this <code>self.table</code> structure on which you're calling <code>SetValue</code>?</p...
2
2009-12-14T12:44:13Z
[ "python", "enumeration" ]
What's a neater, more pythonic way to do the following enumeration?
1,900,195
<pre><code>for row, instrument in enumerate(instruments): for col, value in enumerate(instrument): self.table.SetValue(row, col, value) </code></pre>
1
2009-12-14T10:52:17Z
1,901,463
<p>You've mentioned in the comments that this loop is a part of asynchronous function (in terms of twisted framework). In this case you don't want to block for a long time:</p> <pre><code>from twisted.internet import task for i, row in enumerate(instruments): task.coiterate(self.table.SetValue(i, j, v) for j, v i...
2
2009-12-14T15:13:44Z
[ "python", "enumeration" ]
Is there a function that gives me a file name without path?
1,900,216
<p>I want to turn <code>C:\abc.bmp</code> into <code>abc.bmp</code>, or even better, if possible, in <code>abc</code>. That is easy to do with .NET as there are functions for both goals. Is there anything similar in python?</p>
1
2009-12-14T10:58:50Z
1,900,222
<pre><code>&gt;&gt;&gt; os.path.basename(r'C:\abc.txt') 'abc.txt' </code></pre> <p>for basename only:</p> <pre><code>&gt;&gt;&gt; base, ext = os.path.splitext(os.path.basename(r'C:\abc.txt')) &gt;&gt;&gt; base 'abc' </code></pre>
11
2009-12-14T10:59:47Z
[ "python", "path" ]
Is there a function that gives me a file name without path?
1,900,216
<p>I want to turn <code>C:\abc.bmp</code> into <code>abc.bmp</code>, or even better, if possible, in <code>abc</code>. That is easy to do with .NET as there are functions for both goals. Is there anything similar in python?</p>
1
2009-12-14T10:58:50Z
1,900,226
<p>Try <code><a href="http://docs.python.org/library/os.path.html#os.path.basename" rel="nofollow">os.path.basename()</a></code>.</p>
3
2009-12-14T11:00:31Z
[ "python", "path" ]
Compile a string to Ruby bytecode for better performance -- like compile() in Python
1,900,327
<p>I have a string (authenticated, trusted, etc.) containing source code intended to run within a Ruby loop, quickly. In Python, I would compile the string into an abstract syntax tree and <code>eval()</code> or <code>exec()</code> it later:</p> <pre><code># Python 3 example given_code = 'n % 2 == 1' pred = compile(g...
4
2009-12-14T11:19:25Z
1,900,346
<p>I wrap the whole string in a lambda (still as a string), eval that, and then call the resultant Proc object.</p> <pre><code># XXX: Only runs on Ruby 1.8.7 and up. given_code = 'n % 2 == 1' pred = eval "lambda { |n| #{given_code} }" puts 1.upto(10).select { |x| pred.call(x) } .inspect # Or (1..10).select for Ruby &l...
1
2009-12-14T11:23:27Z
[ "python", "ruby", "compilation", "eval" ]
Compile a string to Ruby bytecode for better performance -- like compile() in Python
1,900,327
<p>I have a string (authenticated, trusted, etc.) containing source code intended to run within a Ruby loop, quickly. In Python, I would compile the string into an abstract syntax tree and <code>eval()</code> or <code>exec()</code> it later:</p> <pre><code># Python 3 example given_code = 'n % 2 == 1' pred = compile(g...
4
2009-12-14T11:19:25Z
1,900,489
<p>Based on the solution of jhs, but directly using the lambda as the loop body (the <code>&amp;</code> calls <code>to_proc</code> on the lambda and passes it as block to the select function).</p> <pre><code>given_code = 'n % 2 == 1' pred = eval "lambda { |n| #{given_code} }" p all = (1..10).select(&amp;pred) </code><...
7
2009-12-14T11:55:25Z
[ "python", "ruby", "compilation", "eval" ]
How to have `pip install --editable` to run sdist instead of develop?
1,900,775
<p>This <a href="http://stackoverflow.com/questions/1033897/python-package-install-using-pip-or-easyinstall-from-repos">http://stackoverflow.com/questions/1033897/python-package-install-using-pip-or-easyinstall-from-repos</a> points out a very interesting features of pip.</p> <p>However, sometimes you just want it to ...
2
2009-12-14T12:57:03Z
1,904,900
<p>Have you tried just omitting the --editable? If I run</p> <pre><code>pip install hg+http://bitbucket.org/carljm/django-markitup/ </code></pre> <p>it clones the repo to a temporary build directory and installs normally (via setup.py install rather than setup.py develop).</p> <p>Of course, if you then freeze this e...
3
2009-12-15T02:45:19Z
[ "python", "build-automation", "install", "pip" ]
Transitioning from desktop app written in C++ to a web-based app
1,900,868
<p>We have a mature Windows desktop application written in C++. The application's GUI sits on top of a windows DLL that does most of the work for the GUI (it's kind of the engine). It, too, is written in C++. We are considering transitioning the Windows app to be a web-based app for various reasons. </p> <p>What I ...
5
2009-12-14T13:16:34Z
1,900,917
<p>I would say option 2 is the way to go. Provided that you create an interface in .Net to your DLL to make sure you correctly release your memory etc. when needed I don't see an issue. If you can reuse your business logic in your DLL and basically make a web call into your DLL then great.</p> <p>My only concern wou...
2
2009-12-14T13:26:55Z
[ "c#", "c++", "python", "dll", "web-based" ]
Transitioning from desktop app written in C++ to a web-based app
1,900,868
<p>We have a mature Windows desktop application written in C++. The application's GUI sits on top of a windows DLL that does most of the work for the GUI (it's kind of the engine). It, too, is written in C++. We are considering transitioning the Windows app to be a web-based app for various reasons. </p> <p>What I ...
5
2009-12-14T13:16:34Z
1,900,952
<blockquote> <p>See also <a href="http://stackoverflow.com/questions/1025042/can-a-huge-existing-application-be-ported-to-the-web-how/1027917#1027917">Can a huge existing application be ported to the web? How?</a></p> </blockquote> <p>Sorry there are no good solutions, just less bad ones....</p> <p>Firstly as y...
10
2009-12-14T13:33:09Z
[ "c#", "c++", "python", "dll", "web-based" ]