title
stringlengths
10
172
question_id
int64
469
40.1M
question_body
stringlengths
22
48.2k
question_score
int64
-44
5.52k
question_date
stringlengths
20
20
answer_id
int64
497
40.1M
answer_body
stringlengths
18
33.9k
answer_score
int64
-38
8.38k
answer_date
stringlengths
20
20
tags
listlengths
1
5
What's the easiest way to escape HTML in Python?
1,061,697
<p>cgi.escape seems like one possible choice. Does it work well? Is there something that is considered better?</p>
93
2009-06-30T04:15:54Z
33,940,254
<p>There is also the excellent <a href="https://github.com/mitsuhiko/markupsafe" rel="nofollow">markupsafe package</a>.</p> <pre><code>&gt;&gt;&gt; from markupsafe import Markup, escape &gt;&gt;&gt; escape("&lt;script&gt;alert(document.cookie);&lt;/script&gt;") Markup(u'&amp;lt;script&amp;gt;alert(document.cookie);&am...
2
2015-11-26T13:43:50Z
[ "python", "html" ]
Django with system timezone setting vs user's individual timezones
1,061,911
<p>How well does Django handle the case of different timezones for each user? Ideally I would like to run the server in the UTC timezone (eg, in settings.py set TIME_ZONE="UTC") so all datetimes were stored in the database as UTC. Stuff like <a href="http://stackoverflow.com/questions/689831/changing-timezone-on-an-e...
15
2009-06-30T05:45:08Z
1,061,921
<p>You could start by taking a look at the <a href="http://code.google.com/p/django-timezones/" rel="nofollow">django-timezones</a> application. It makes available a number of timezone-based model fields (and their corresponding form fields, and some decorators), which you could use to at least <em>store</em> different...
1
2009-06-30T05:50:47Z
[ "python", "django", "timezone" ]
Django with system timezone setting vs user's individual timezones
1,061,911
<p>How well does Django handle the case of different timezones for each user? Ideally I would like to run the server in the UTC timezone (eg, in settings.py set TIME_ZONE="UTC") so all datetimes were stored in the database as UTC. Stuff like <a href="http://stackoverflow.com/questions/689831/changing-timezone-on-an-e...
15
2009-06-30T05:45:08Z
1,061,967
<p>Not a Django expert here, but afaik Django has no magic, and I can't even imagine any such magic that would work. </p> <p>For example: you don't always want to save times in UTC. In a calendar application, for example, you want to save the datetime in the local time that the calendar event happens. Which can be dif...
2
2009-06-30T06:02:52Z
[ "python", "django", "timezone" ]
Django with system timezone setting vs user's individual timezones
1,061,911
<p>How well does Django handle the case of different timezones for each user? Ideally I would like to run the server in the UTC timezone (eg, in settings.py set TIME_ZONE="UTC") so all datetimes were stored in the database as UTC. Stuff like <a href="http://stackoverflow.com/questions/689831/changing-timezone-on-an-e...
15
2009-06-30T05:45:08Z
1,064,928
<p><strong>Update, January 2013</strong>: Django 1.4 now has <a href="https://docs.djangoproject.com/en/1.4/topics/i18n/timezones/" rel="nofollow">time zone support</a>!!</p> <hr> <p>Old answer for historical reasons:</p> <p>I'm going to be working on this problem myself for my application. My first approach to this...
7
2009-06-30T17:24:47Z
[ "python", "django", "timezone" ]
Django with system timezone setting vs user's individual timezones
1,061,911
<p>How well does Django handle the case of different timezones for each user? Ideally I would like to run the server in the UTC timezone (eg, in settings.py set TIME_ZONE="UTC") so all datetimes were stored in the database as UTC. Stuff like <a href="http://stackoverflow.com/questions/689831/changing-timezone-on-an-e...
15
2009-06-30T05:45:08Z
4,719,790
<p>Looking at the <a href="https://github.com/brosner/django-timezones" rel="nofollow">django-timezones</a> application I found that it doesn't support MySQL DBMS, since MySQL doesn't store any timezone reference within datetimes.</p> <p>Well, I think I manage to work around this by forking the <a href="https://github...
1
2011-01-18T01:52:20Z
[ "python", "django", "timezone" ]
Django with system timezone setting vs user's individual timezones
1,061,911
<p>How well does Django handle the case of different timezones for each user? Ideally I would like to run the server in the UTC timezone (eg, in settings.py set TIME_ZONE="UTC") so all datetimes were stored in the database as UTC. Stuff like <a href="http://stackoverflow.com/questions/689831/changing-timezone-on-an-e...
15
2009-06-30T05:45:08Z
5,806,918
<p>It's not that hard to write timezone aware code in django:</p> <p>I've written simple django application which helps handle timezones issue in django projects: <a href="https://github.com/paluh/django-tz" rel="nofollow">https://github.com/paluh/django-tz</a>. It's based on Brosner (django-timezone) code but takes d...
4
2011-04-27T15:51:12Z
[ "python", "django", "timezone" ]
Django with system timezone setting vs user's individual timezones
1,061,911
<p>How well does Django handle the case of different timezones for each user? Ideally I would like to run the server in the UTC timezone (eg, in settings.py set TIME_ZONE="UTC") so all datetimes were stored in the database as UTC. Stuff like <a href="http://stackoverflow.com/questions/689831/changing-timezone-on-an-e...
15
2009-06-30T05:45:08Z
6,051,905
<p>Django doesn't handle it at all, largely because Python doesn't either. Python (Guido?) has so far decided not to support timezones since although a reality of the world are "<a href="http://docs.python.org/library/datetime.html#module-datetime" rel="nofollow">more political than rational, and there is no standard s...
3
2011-05-18T22:49:15Z
[ "python", "django", "timezone" ]
Modifying list contents in Python
1,061,937
<p>I have a list like:</p> <pre><code>list = [[1,2,3],[4,5,6],[7,8,9]] </code></pre> <p>I want to append a number at the start of every value in the list programmatically, say the number is 9. I want the new list to be like:</p> <pre><code>list = [[9,1,2,3],[9,4,5,6],[9,7,8,9]] </code></pre> <p>How do I go about do...
3
2009-06-30T05:55:24Z
1,061,956
<p>Use the insert method, which <strong>modifies the list in place</strong>:</p> <pre><code>&gt;&gt;&gt; numberlists = [[1,2,3],[4,5,6]] &gt;&gt;&gt; for numberlist in numberlists: ... numberlist.insert(0,9) ... &gt;&gt;&gt; numberlists [[9, 1, 2, 3], [9, 4, 5, 6]] </code></pre> <p>or, more succintly</p> <pre><code...
2
2009-06-30T06:00:05Z
[ "python", "list" ]
Modifying list contents in Python
1,061,937
<p>I have a list like:</p> <pre><code>list = [[1,2,3],[4,5,6],[7,8,9]] </code></pre> <p>I want to append a number at the start of every value in the list programmatically, say the number is 9. I want the new list to be like:</p> <pre><code>list = [[9,1,2,3],[9,4,5,6],[9,7,8,9]] </code></pre> <p>How do I go about do...
3
2009-06-30T05:55:24Z
1,061,957
<pre><code>&gt;&gt;&gt; someList = [[1,2,3],[4,5,6],[7,8,9]] &gt;&gt;&gt; someList = [[9] + i for i in someList] &gt;&gt;&gt; someList [[9, 1, 2, 3], [9, 4, 5, 6], [9, 7, 8, 9]] </code></pre> <p>(someList because list is already used by python)</p>
11
2009-06-30T06:00:08Z
[ "python", "list" ]
Modifying list contents in Python
1,061,937
<p>I have a list like:</p> <pre><code>list = [[1,2,3],[4,5,6],[7,8,9]] </code></pre> <p>I want to append a number at the start of every value in the list programmatically, say the number is 9. I want the new list to be like:</p> <pre><code>list = [[9,1,2,3],[9,4,5,6],[9,7,8,9]] </code></pre> <p>How do I go about do...
3
2009-06-30T05:55:24Z
1,061,960
<pre><code>for sublist in thelist: sublist.insert(0, 9) </code></pre> <p><strong>don't</strong> use built-in names such as <code>list</code> for your own stuff, that's just a stupid accident in the making -- call YOUR stuff <code>mylist</code> or <code>thelist</code> or the like, <strong>not</strong> <code>list</cod...
16
2009-06-30T06:01:22Z
[ "python", "list" ]
Modifying list contents in Python
1,061,937
<p>I have a list like:</p> <pre><code>list = [[1,2,3],[4,5,6],[7,8,9]] </code></pre> <p>I want to append a number at the start of every value in the list programmatically, say the number is 9. I want the new list to be like:</p> <pre><code>list = [[9,1,2,3],[9,4,5,6],[9,7,8,9]] </code></pre> <p>How do I go about do...
3
2009-06-30T05:55:24Z
1,062,017
<pre><code>#!/usr/bin/env python def addNine(val): val.insert(0,9) return val if __name__ == '__main__': s = [[1,2,3],[4,5,6],[7,8,9]] print map(addNine,s) </code></pre> <p>Output:</p> <pre><code>[[9, 1, 2, 3], [9, 4, 5, 6], [9, 7, 8, 9]] </code></pre>
0
2009-06-30T06:22:33Z
[ "python", "list" ]
Modifying list contents in Python
1,061,937
<p>I have a list like:</p> <pre><code>list = [[1,2,3],[4,5,6],[7,8,9]] </code></pre> <p>I want to append a number at the start of every value in the list programmatically, say the number is 9. I want the new list to be like:</p> <pre><code>list = [[9,1,2,3],[9,4,5,6],[9,7,8,9]] </code></pre> <p>How do I go about do...
3
2009-06-30T05:55:24Z
1,062,138
<p>If you're going to be doing a lot of prepending, <br /> perhaps consider using <a href="http://docs.python.org/library/collections.html#deque-objects" rel="nofollow">deques</a>* instead of lists:</p> <pre><code>&gt;&gt;&gt; mylist = [[1,2,3],[4,5,6],[7,8,9]] &gt;&gt;&gt; from collections import deque &gt;&gt;&gt; ...
2
2009-06-30T07:03:33Z
[ "python", "list" ]
python decimal comparison
1,062,008
<p>python decimal comparison</p> <pre><code>&gt;&gt;&gt; from decimal import Decimal &gt;&gt;&gt; Decimal('1.0') &gt; 2.0 True </code></pre> <p>I was expecting it to convert 2.0 correctly, but after reading thru <a href="http://www.python.org/dev/peps/pep-0327">PEP 327</a> I understand there were some reason for not ...
12
2009-06-30T06:18:56Z
1,062,024
<p>If it's "right" is a matter of opinion, but the rationale of why there is no automatic conversion exists in the PEP, and that was the decision taken. The caveat basically is that you can't always exactly convert between float and decimal. Therefore the conversion should not be implicit. If you in your application kn...
1
2009-06-30T06:24:55Z
[ "python", "comparison", "decimal" ]
python decimal comparison
1,062,008
<p>python decimal comparison</p> <pre><code>&gt;&gt;&gt; from decimal import Decimal &gt;&gt;&gt; Decimal('1.0') &gt; 2.0 True </code></pre> <p>I was expecting it to convert 2.0 correctly, but after reading thru <a href="http://www.python.org/dev/peps/pep-0327">PEP 327</a> I understand there were some reason for not ...
12
2009-06-30T06:18:56Z
1,062,027
<p>The greater-than comparison works because, by default, it works for all objects.</p> <pre><code>&gt;&gt;&gt; 'abc' &gt; 123 True </code></pre> <p><code>Decimal</code> is right merely because it correctly follows the spec. Whether the spec was the correct approach is a separate question. :)</p> <p>Only the normal ...
2
2009-06-30T06:25:40Z
[ "python", "comparison", "decimal" ]
python decimal comparison
1,062,008
<p>python decimal comparison</p> <pre><code>&gt;&gt;&gt; from decimal import Decimal &gt;&gt;&gt; Decimal('1.0') &gt; 2.0 True </code></pre> <p>I was expecting it to convert 2.0 correctly, but after reading thru <a href="http://www.python.org/dev/peps/pep-0327">PEP 327</a> I understand there were some reason for not ...
12
2009-06-30T06:18:56Z
1,062,030
<p>Re 1, it's indeed the behavior we designed -- right or wrong as it may be (sorry if that trips your use case up, but we were trying to be general!).</p> <p>Specifically, it's long been the case that every Python object could be subject to inequality comparison with every other -- objects of types that aren't really...
22
2009-06-30T06:26:26Z
[ "python", "comparison", "decimal" ]
Python NotImplemented constant
1,062,096
<p>Looking through <code>decimal.py</code>, it uses <code>NotImplemented</code> in many special methods. e.g.</p> <pre><code>class A(object): def __lt__(self, a): return NotImplemented def __add__(self, a): return NotImplemented </code></pre> <p>The <a href="http://docs.python.org/library/con...
22
2009-06-30T06:52:12Z
1,062,124
<p><code>NotImplemented</code> allows you to indicate that a comparison between the two given operands has not been implemented (rather than indicating that the comparison is valid, but yields <code>False</code>, for the two operands).</p> <p>From the <a href="http://www.network-theory.co.uk/docs/pylang/Coercionrules....
25
2009-06-30T07:00:04Z
[ "python" ]
Python NotImplemented constant
1,062,096
<p>Looking through <code>decimal.py</code>, it uses <code>NotImplemented</code> in many special methods. e.g.</p> <pre><code>class A(object): def __lt__(self, a): return NotImplemented def __add__(self, a): return NotImplemented </code></pre> <p>The <a href="http://docs.python.org/library/con...
22
2009-06-30T06:52:12Z
1,062,128
<p>It actually has the same meaning when returned from <code>__add__</code> as from <code>__lt__</code>, the difference is Python 2.x is trying other ways of comparing the objects before giving up. Python 3.x does raise a TypeError. In fact, Python can try other things for <code>__add__</code> as well, look at <code>__...
3
2009-06-30T07:00:46Z
[ "python" ]
Python NotImplemented constant
1,062,096
<p>Looking through <code>decimal.py</code>, it uses <code>NotImplemented</code> in many special methods. e.g.</p> <pre><code>class A(object): def __lt__(self, a): return NotImplemented def __add__(self, a): return NotImplemented </code></pre> <p>The <a href="http://docs.python.org/library/con...
22
2009-06-30T06:52:12Z
1,062,147
<p>If you return it from <code>__add__</code> it will behave like the object has no <code>__add__</code> method, and raise a <code>TypeError</code>.</p> <p>If you return <code>NotImplemented</code> from a rich comparison function, Python will behave like the method wasn't implemented, that is, it will defer to using <...
0
2009-06-30T07:05:34Z
[ "python" ]
obtain collection_name from parent's key in GAE
1,062,108
<p>is it possible to ask parent for its refered collection_name based on one of its keys, lets say i have a parent db model and its key, can i know ths children who refer to this parent through collection name or otherwise</p> <pre><code>class Parent(db.Model): user = db.UserProperty() class Childs(db.Model): re...
0
2009-06-30T06:56:31Z
1,062,184
<p>I think you're asking "can I get the set of all the children that refer to a given parent".</p> <p>In which case, yes you can, it's a property of the Parent class.</p> <p>Assuming you have a Parent object p then the children that reference it will be in p.children</p> <p>If you hadn't specified the collection_nam...
1
2009-06-30T07:15:24Z
[ "python", "google-app-engine" ]
obtain collection_name from parent's key in GAE
1,062,108
<p>is it possible to ask parent for its refered collection_name based on one of its keys, lets say i have a parent db model and its key, can i know ths children who refer to this parent through collection name or otherwise</p> <pre><code>class Parent(db.Model): user = db.UserProperty() class Childs(db.Model): re...
0
2009-06-30T06:56:31Z
1,062,267
<p>Yes, you can.</p> <blockquote> <p><a href="http://code.google.com/appengine/docs/python/datastore/entitiesandmodels.html#References" rel="nofollow">ReferenceProperty has another handy feature: back-references. When a model has a ReferenceProperty to another model, each referenced entity gets a property whose valu...
0
2009-06-30T07:38:13Z
[ "python", "google-app-engine" ]
Python win32 com : how to handle 'out' parameter?
1,062,129
<p>I need to access a third-party COM server with following interface definition (idl):</p> <pre><code>interface IDisplay : IDispatch { HRESULT getFramebuffer ( [in] ULONG aScreenId, [out] IFramebuffer * * aFramebuffer, [out] LONG * aXOrigin, [out] LONG * aYOrigin ); }; </code></pre> <p>As you can s...
5
2009-06-30T07:00:50Z
1,062,295
<p>Since those are out parameters, can't you simply do the following?</p> <pre><code>Framebuffer, XOrigin, YOrigin = display.getFrameBuffer(ScreenId) </code></pre> <p>There is some good references in <a href="http://oreilly.com/catalog/pythonwin32/chapter/ch12.html">Python Programming on Win32 Chapter 12 Advanced Pyt...
7
2009-06-30T07:48:48Z
[ "python", "com" ]
Python win32 com : how to handle 'out' parameter?
1,062,129
<p>I need to access a third-party COM server with following interface definition (idl):</p> <pre><code>interface IDisplay : IDispatch { HRESULT getFramebuffer ( [in] ULONG aScreenId, [out] IFramebuffer * * aFramebuffer, [out] LONG * aXOrigin, [out] LONG * aYOrigin ); }; </code></pre> <p>As you can s...
5
2009-06-30T07:00:50Z
1,062,546
<p>Use the <code>makepy</code> module, invoking it as follows:</p> <pre><code>&gt;&gt;&gt; import win32com.client.makepy as makepy &gt;&gt;&gt; makepy.main() </code></pre> <p>A window will open with a list of type libraries. Scroll to "Virtual Box Type Library" and select it, then click "OK". A Python module will be ...
3
2009-06-30T08:53:18Z
[ "python", "com" ]
Python - Reading multiple lines into list
1,062,171
<p>OK guys/gals stuck again on something simple<br /> I have a text file which has multiple lines per entry, the data is in the following format </p> <p>firstword word word word<br /> wordx word word word <strong>interesting1</strong> word word word word<br /> wordy word word word<br /> wordz word word word <strong>i...
1
2009-06-30T07:11:37Z
1,062,200
<p>In that case, make a regexp that matches the repeating text, and has groups for the interesting bits. Then you should be able to use findall to find all cases of interesting1 and interesting2.</p> <p>Like so: import re</p> <pre><code>text = open("foo.txt").read() RE = re.compile('firstword.*?wordx word word wo...
0
2009-06-30T07:20:54Z
[ "python", "text", "parsing", "line" ]
Python - Reading multiple lines into list
1,062,171
<p>OK guys/gals stuck again on something simple<br /> I have a text file which has multiple lines per entry, the data is in the following format </p> <p>firstword word word word<br /> wordx word word word <strong>interesting1</strong> word word word word<br /> wordy word word word<br /> wordz word word word <strong>i...
1
2009-06-30T07:11:37Z
1,062,288
<pre><code>from itertools import izip, tee, islice i1, i2 = tee(open("foo.txt")) for line2, line4 in izip(islice(i1,1, None, 4), islice(i2, 3, None, 4)) : print line2.split(" ")[4], "=", line4.split(" ")[4] </code></pre>
6
2009-06-30T07:46:01Z
[ "python", "text", "parsing", "line" ]
Python - Reading multiple lines into list
1,062,171
<p>OK guys/gals stuck again on something simple<br /> I have a text file which has multiple lines per entry, the data is in the following format </p> <p>firstword word word word<br /> wordx word word word <strong>interesting1</strong> word word word word<br /> wordy word word word<br /> wordz word word word <strong>i...
1
2009-06-30T07:11:37Z
1,062,363
<p>I've thrown in a bagful of assertions to check the regularity of your data layout.</p> <pre><code>C:\SO&gt;type words.py # sample pseudo-file contents guff = """\ firstword word word word wordx word word word interesting1-1 word word word word wordy word word word wordz word word word interesting2-1 word word word...
0
2009-06-30T08:08:57Z
[ "python", "text", "parsing", "line" ]
Python Script Executed with Makefile
1,062,436
<p>I am writing python scripts and execute them in a Makefile. The python script is used to process data in a pipeline. I would like Makefile to execute the script every time I make a change to my python scripts.</p> <p>Does anyone have an idea of how to do this?</p>
7
2009-06-30T08:28:39Z
1,062,466
<p>That's not a lot of information, so this answer is a bit vague. The basic principle of Makefiles is to list dependencies for each target; in this case, your target (let's call it foo) depends on your python script (let's call it do-foo.py):</p> <pre><code>foo: do-foo.py python do-foo.py &gt; foo </code></pre> ...
14
2009-06-30T08:38:17Z
[ "python", "makefile" ]
Python Script Executed with Makefile
1,062,436
<p>I am writing python scripts and execute them in a Makefile. The python script is used to process data in a pipeline. I would like Makefile to execute the script every time I make a change to my python scripts.</p> <p>Does anyone have an idea of how to do this?</p>
7
2009-06-30T08:28:39Z
1,062,484
<p>If you want that Makefile to be automatically "maked" immediately after saving, <a href="http://pyinotify.sourceforge.net/" rel="nofollow"><code>pyinotify</code></a>, which is a wrapper for <a href="http://en.wikipedia.org/wiki/Inotify" rel="nofollow"><code>inotify</code></a>, might be the only possibility under Lin...
0
2009-06-30T08:42:56Z
[ "python", "makefile" ]
Python Script Executed with Makefile
1,062,436
<p>I am writing python scripts and execute them in a Makefile. The python script is used to process data in a pipeline. I would like Makefile to execute the script every time I make a change to my python scripts.</p> <p>Does anyone have an idea of how to do this?</p>
7
2009-06-30T08:28:39Z
1,062,502
<p>And in case when the scripts that need to be run don't produce any useful output file that can be used as a target, you can just use a dummy target:</p> <pre><code>scripts=a.py b.py c.py checkfile=.pipeline_up_to_date $(checkfile): $(scripts) touch $(checkfile) echo "Launching some commands now." default:...
3
2009-06-30T08:45:54Z
[ "python", "makefile" ]
Python Script Executed with Makefile
1,062,436
<p>I am writing python scripts and execute them in a Makefile. The python script is used to process data in a pipeline. I would like Makefile to execute the script every time I make a change to my python scripts.</p> <p>Does anyone have an idea of how to do this?</p>
7
2009-06-30T08:28:39Z
1,179,141
<p>This is not a direct answer to your question, but I suggest you to read this tutorial dedicated to scientists approaching bioinformatics: - <a href="http://swc.scipy.org/lec/build.html" rel="nofollow">http://swc.scipy.org/lec/build.html</a></p> <p>And all the info related to this page: - <a href="http://biowiki.o...
0
2009-07-24T17:49:51Z
[ "python", "makefile" ]
Calling a non-returning python function from a python script
1,062,562
<p>I want to call a wrapped C++ function from a python script which is not returning immediately (in detail: it is a function which starts a QApplication window and the last line in that function is QApplication->exec()). So after that function call I want to move on to my next line in the python script but on executin...
0
2009-06-30T08:57:54Z
1,062,584
<p>Use a thread (<a href="http://www.wellho.net/solutions/python-python-threads-a-first-example.html" rel="nofollow">longer example here</a>):</p> <pre><code>from threading import Thread class WindowThread(Thread): def run(self): callCppFunctionHere() WindowThread().start() </code></pre>
2
2009-06-30T09:04:22Z
[ "c++", "python", "function", "scripting" ]
Calling a non-returning python function from a python script
1,062,562
<p>I want to call a wrapped C++ function from a python script which is not returning immediately (in detail: it is a function which starts a QApplication window and the last line in that function is QApplication->exec()). So after that function call I want to move on to my next line in the python script but on executin...
0
2009-06-30T08:57:54Z
1,062,590
<p>QApplication::exec() starts the main loop of the application and will only return after the application quits. If you want to run code after the application has been started, you should resort to Qt's event handling mechanism.</p> <p>From <a href="http://doc.trolltech.com/4.5/qapplication.html#exec" rel="nofollow">...
1
2009-06-30T09:05:40Z
[ "c++", "python", "function", "scripting" ]
Calling a non-returning python function from a python script
1,062,562
<p>I want to call a wrapped C++ function from a python script which is not returning immediately (in detail: it is a function which starts a QApplication window and the last line in that function is QApplication->exec()). So after that function call I want to move on to my next line in the python script but on executin...
0
2009-06-30T08:57:54Z
1,062,839
<p>I assume you're already using <a href="http://www.riverbankcomputing.co.uk/software/pyqt/intro" rel="nofollow">PyQT</a>?</p>
0
2009-06-30T10:04:18Z
[ "c++", "python", "function", "scripting" ]
Get the items not repeated in a list
1,062,803
<p>Take two lists, second with same items than first plus some more:</p> <pre><code>a = [1,2,3] b = [1,2,3,4,5] </code></pre> <p>I want to get a third one, containing only the new items (the ones not repeated):</p> <pre><code>c = [4,5] </code></pre> <p>The solution I have right now is:</p> <pre><code>&gt;&gt;&gt; ...
1
2009-06-30T09:57:34Z
1,062,824
<p>at the very least use a list comprehension:</p> <pre><code>[x for x in a + b if (a + b).count(x) == 1] </code></pre> <p>otherwise use the <a href="http://docs.python.org/library/stdtypes.html#set-types-set-frozenset" rel="nofollow">set</a> class:</p> <pre><code>list(set(a).symmetric_difference(set(b))) </code></p...
11
2009-06-30T10:01:15Z
[ "python" ]
Get the items not repeated in a list
1,062,803
<p>Take two lists, second with same items than first plus some more:</p> <pre><code>a = [1,2,3] b = [1,2,3,4,5] </code></pre> <p>I want to get a third one, containing only the new items (the ones not repeated):</p> <pre><code>c = [4,5] </code></pre> <p>The solution I have right now is:</p> <pre><code>&gt;&gt;&gt; ...
1
2009-06-30T09:57:34Z
1,062,853
<p>If the order is not important and you can ignore repetitions within <code>a</code> and <code>b</code>, I would simply use sets:</p> <pre><code>&gt;&gt;&gt; set(b) - set(a) set([4, 5]) </code></pre> <p>Sets are iterable, so most of the times you do not need to explicitly convert them back to list. If you have to, t...
8
2009-06-30T10:10:01Z
[ "python" ]
Get the items not repeated in a list
1,062,803
<p>Take two lists, second with same items than first plus some more:</p> <pre><code>a = [1,2,3] b = [1,2,3,4,5] </code></pre> <p>I want to get a third one, containing only the new items (the ones not repeated):</p> <pre><code>c = [4,5] </code></pre> <p>The solution I have right now is:</p> <pre><code>&gt;&gt;&gt; ...
1
2009-06-30T09:57:34Z
1,062,860
<p>Items in b that aren't in a, if you need to preserve order or duplicates in b:</p> <pre><code>&gt;&gt;&gt; a = [1, 2, 3] &gt;&gt;&gt; b = [1, 2, 3, 4, 4, 5] &gt;&gt;&gt; a_set = set(a) &gt;&gt;&gt; [x for x in b if x not in a_set] [4, 4, 5] </code></pre> <p>Items in b that aren't in a, not preserving order, and no...
4
2009-06-30T10:12:26Z
[ "python" ]
Get the items not repeated in a list
1,062,803
<p>Take two lists, second with same items than first plus some more:</p> <pre><code>a = [1,2,3] b = [1,2,3,4,5] </code></pre> <p>I want to get a third one, containing only the new items (the ones not repeated):</p> <pre><code>c = [4,5] </code></pre> <p>The solution I have right now is:</p> <pre><code>&gt;&gt;&gt; ...
1
2009-06-30T09:57:34Z
1,062,980
<p>I'd say go for the set variant, where</p> <pre><code> set(b) ^ set(a) (set.symmetric_difference()) </code></pre> <p>only applies if you can be certain that a is always a subset of b, but in that case has the advantage of being commutative, ie. you don't have to worry about calculating set(b) ^ set(a) or set(a) ...
3
2009-06-30T10:38:20Z
[ "python" ]
Get the items not repeated in a list
1,062,803
<p>Take two lists, second with same items than first plus some more:</p> <pre><code>a = [1,2,3] b = [1,2,3,4,5] </code></pre> <p>I want to get a third one, containing only the new items (the ones not repeated):</p> <pre><code>c = [4,5] </code></pre> <p>The solution I have right now is:</p> <pre><code>&gt;&gt;&gt; ...
1
2009-06-30T09:57:34Z
1,063,320
<p>Another solution using only lists:</p> <pre><code>a = [1, 2, 3] b = [1, 2, 3, 4, 5] c = [n for n in a + b if n not in a or n not in b] </code></pre>
0
2009-06-30T12:15:09Z
[ "python" ]
Get the items not repeated in a list
1,062,803
<p>Take two lists, second with same items than first plus some more:</p> <pre><code>a = [1,2,3] b = [1,2,3,4,5] </code></pre> <p>I want to get a third one, containing only the new items (the ones not repeated):</p> <pre><code>c = [4,5] </code></pre> <p>The solution I have right now is:</p> <pre><code>&gt;&gt;&gt; ...
1
2009-06-30T09:57:34Z
1,063,343
<p>Here are some different possibilities with the sets</p> <pre> >>> a = [1, 2, 3, 4, 5, 1, 2] >>> b = [1, 2, 5, 6] >>> print list(set(a)^set(b)) [3, 4, 6] >>> print list(set(a)-set(b)) [3, 4] >>> print list(set(b)-set(a)) [6] >>> print list(set(a)-set(b))+list(set(b)-set(a)) [3, 4, 6] >>> </pre>
1
2009-06-30T12:20:25Z
[ "python" ]
Python Encryption: Encrypting password using PGP public key
1,063,014
<p>I have the key pair generated by the GPG. Now I want to use the public key for encrypting the password. I need to make a function in Python. Can somebody guide me on how to do this?</p> <p>I studied the Crypto package but was unable to find out how to encrypt the password using the public key.</p> <p>I also read a...
1
2009-06-30T10:44:23Z
1,063,050
<p>Have a look at <a href="https://www.ohloh.net/p/pygpgme" rel="nofollow" title="PyGPGME">PyGPGME</a></p>
2
2009-06-30T10:51:41Z
[ "python", "encryption", "cryptography", "gnupg" ]
Python Encryption: Encrypting password using PGP public key
1,063,014
<p>I have the key pair generated by the GPG. Now I want to use the public key for encrypting the password. I need to make a function in Python. Can somebody guide me on how to do this?</p> <p>I studied the Crypto package but was unable to find out how to encrypt the password using the public key.</p> <p>I also read a...
1
2009-06-30T10:44:23Z
1,063,080
<p>See also the answers provided to the following questions found in this search <code>Python Encryption</code> questions at <a href="http://stackoverflow.com/questions/tagged/encryption+python">Stack Overflow</a> :</p> <ul> <li><a href="http://stackoverflow.com/questions/1048722">Python and PGP/encryption</a></li> <l...
0
2009-06-30T11:02:10Z
[ "python", "encryption", "cryptography", "gnupg" ]
How can I make a list of files, modification dates and paths?
1,063,037
<p>I have directory with subdirectories and I have to make a list like:</p> <pre><code>file_name1 modification_date1 path1 file_name2 modification_date2 path2 </code></pre> <p>and write the list into text file how can i do it in python?</p>
1
2009-06-30T10:48:42Z
1,063,063
<p>For traversing the subdirectories, use os.walk().</p> <p>For getting modification date, use os.stat()</p> <p>The modification time will be a timestamp counting seconds from epoch, there are various methods in the time module that help you convert those to something easier to use.</p>
3
2009-06-30T10:56:05Z
[ "python" ]
How can I make a list of files, modification dates and paths?
1,063,037
<p>I have directory with subdirectories and I have to make a list like:</p> <pre><code>file_name1 modification_date1 path1 file_name2 modification_date2 path2 </code></pre> <p>and write the list into text file how can i do it in python?</p>
1
2009-06-30T10:48:42Z
1,063,120
<pre><code>import os import time for root, dirs, files in os.walk('your_root_directory'): for f in files: modification_time_seconds = os.stat(os.path.join(root, f)).st_mtime local_mod_time = time.localtime(modification_time_seconds) print '%s %s.%s.%s %s' % (f, local_mod_time.tm_mon, local_mod_time.tm_m...
3
2009-06-30T11:15:01Z
[ "python" ]
Custom Python exception with different include paths
1,063,228
<p><strong>Update:</strong> This is, as I was told, no principle Python related problem, but seems to be more specific. See below for more explanations to my problem.</p> <p>I have a custom exception (let's call it <code>CustomException</code>), that lives in a file named <code>exceptions.py</code>. Now imagine, that ...
1
2009-06-30T11:45:32Z
1,063,249
<p>Why that would be a problem? exception would me matched based on class type and it would be same however it is imported e.g.</p> <pre><code>import exceptions l=[] try: l[1] except exceptions.IndexError,e: print e try: l[1] except IndexError,e: print e </code></pre> <p>both catch the same exception...
1
2009-06-30T11:51:36Z
[ "python", "django", "exception" ]
Custom Python exception with different include paths
1,063,228
<p><strong>Update:</strong> This is, as I was told, no principle Python related problem, but seems to be more specific. See below for more explanations to my problem.</p> <p>I have a custom exception (let's call it <code>CustomException</code>), that lives in a file named <code>exceptions.py</code>. Now imagine, that ...
1
2009-06-30T11:45:32Z
1,063,250
<p>Even if the same module is imported several times and in different ways, the CustomException class is still the same object, so it doesn't matter how you refer to it.</p>
0
2009-06-30T11:51:41Z
[ "python", "django", "exception" ]
Custom Python exception with different include paths
1,063,228
<p><strong>Update:</strong> This is, as I was told, no principle Python related problem, but seems to be more specific. See below for more explanations to my problem.</p> <p>I have a custom exception (let's call it <code>CustomException</code>), that lives in a file named <code>exceptions.py</code>. Now imagine, that ...
1
2009-06-30T11:45:32Z
1,063,253
<p>I don't know if there is a way to handle this inclusion path issue. My suggestion would be to use the 'as' keyword in your import</p> <p>Something like:</p> <p><code>import some.application.exceptions as my_exceptions</code></p> <p>or </p> <p><code>import application.exceptions as my_exceptions</code></p>
0
2009-06-30T11:52:38Z
[ "python", "django", "exception" ]
Custom Python exception with different include paths
1,063,228
<p><strong>Update:</strong> This is, as I was told, no principle Python related problem, but seems to be more specific. See below for more explanations to my problem.</p> <p>I have a custom exception (let's call it <code>CustomException</code>), that lives in a file named <code>exceptions.py</code>. Now imagine, that ...
1
2009-06-30T11:45:32Z
1,063,297
<p>"If not, what would be best practices to avoid these name clashes?"</p> <p>That depends entirely on why they happen. In a normal installation, you can not import from both application.exceptions and somepath.application.exceptions, unless the first case is a relative path from within the module somepath. And in tha...
1
2009-06-30T12:09:29Z
[ "python", "django", "exception" ]
Reversible dictionary for python
1,063,319
<p>I'd like to store some data in Python in a similar form to a dictionary: <code>{1:'a', 2:'b'}</code>. Every value will be unique, not just among other values, but among keys too.</p> <p>Is there a simple data structure that I can use to get the corresponding object no matter if I ask using the 'key' or the 'value'?...
6
2009-06-30T12:15:07Z
1,063,356
<p>Related posts:</p> <p><a href="http://stackoverflow.com/questions/483666/python-reverse-inverse-a-mapping/483833">Python mapping inverse</a></p> <p><a href="http://stackoverflow.com/questions/863935/a-data-structure-for-11-mappings-in-python">Python 1:1 mappings</a></p> <p>Of course, if all values and keys are un...
7
2009-06-30T12:22:31Z
[ "python", "dictionary", "hashtable" ]
Reversible dictionary for python
1,063,319
<p>I'd like to store some data in Python in a similar form to a dictionary: <code>{1:'a', 2:'b'}</code>. Every value will be unique, not just among other values, but among keys too.</p> <p>Is there a simple data structure that I can use to get the corresponding object no matter if I ask using the 'key' or the 'value'?...
6
2009-06-30T12:15:07Z
1,063,390
<p>Insert reversed pair of (key, value) into same dict:</p> <pre><code>a = {1:'a', 2:'b'} a.update(dict((v, k) for k, v in a.iteritems())) </code></pre> <p>Then you will be able to do both, as you required:</p> <pre><code>print a[1] print a['a'] </code></pre>
0
2009-06-30T12:30:10Z
[ "python", "dictionary", "hashtable" ]
Reversible dictionary for python
1,063,319
<p>I'd like to store some data in Python in a similar form to a dictionary: <code>{1:'a', 2:'b'}</code>. Every value will be unique, not just among other values, but among keys too.</p> <p>Is there a simple data structure that I can use to get the corresponding object no matter if I ask using the 'key' or the 'value'?...
6
2009-06-30T12:15:07Z
1,063,393
<p>If your keys and values are non-overlapping, one obvious approach is to simply store them in the same dict. ie:</p> <pre><code>class BidirectionalDict(dict): def __setitem__(self, key, val): dict.__setitem__(self, key, val) dict.__setitem__(self, val, key) def __delitem__(self, key): ...
9
2009-06-30T12:30:19Z
[ "python", "dictionary", "hashtable" ]
Reversible dictionary for python
1,063,319
<p>I'd like to store some data in Python in a similar form to a dictionary: <code>{1:'a', 2:'b'}</code>. Every value will be unique, not just among other values, but among keys too.</p> <p>Is there a simple data structure that I can use to get the corresponding object no matter if I ask using the 'key' or the 'value'?...
6
2009-06-30T12:15:07Z
1,063,408
<p>Here's <a href="http://www.daniweb.com/code/snippet806.html" rel="nofollow">another solution</a> using a user defined class.</p> <p>And the code...</p> <pre><code># search a dictionary for key or value # using named functions or a class # tested with Python25 by Ene Uran 01/19/2008 def find_key(dic, val): """...
0
2009-06-30T12:33:17Z
[ "python", "dictionary", "hashtable" ]
Reversible dictionary for python
1,063,319
<p>I'd like to store some data in Python in a similar form to a dictionary: <code>{1:'a', 2:'b'}</code>. Every value will be unique, not just among other values, but among keys too.</p> <p>Is there a simple data structure that I can use to get the corresponding object no matter if I ask using the 'key' or the 'value'?...
6
2009-06-30T12:15:07Z
1,063,463
<p>In The Art of Computer Programming, Vokume 3 Knuth has a section on lookups of secondary keys. For purposes of your question, the value could be considered the secondary key.</p> <p>The first suggestion is to do what you have done: make an efficient index of the keys by value.</p> <p>The second suggestion is to s...
2
2009-06-30T12:46:10Z
[ "python", "dictionary", "hashtable" ]
Reversible dictionary for python
1,063,319
<p>I'd like to store some data in Python in a similar form to a dictionary: <code>{1:'a', 2:'b'}</code>. Every value will be unique, not just among other values, but among keys too.</p> <p>Is there a simple data structure that I can use to get the corresponding object no matter if I ask using the 'key' or the 'value'?...
6
2009-06-30T12:15:07Z
1,529,173
<p>It shouldn't use "twice the space". Dictionaries just store references to data, not the data itself. So, if you have a million strings taking up a billion bytes, then each dictionary takes maybe an extra 10-20 million bytes--a tiny fraction of the overall storage. Using two dictionaries is the right thing to do.<...
1
2009-10-07T02:21:03Z
[ "python", "dictionary", "hashtable" ]
Python IRC client: write from scratch or write plugin for existing framework?
1,063,409
<p>For our company I'd like to have a Python based IRC bot which checks whether the websites of our clients are still up and running. More specific: I want to list a number of URL which should be visited every, say, 15 minutes. If it fails, the URL should be checked again after 5 minutes. If retrieving the URL still do...
4
2009-06-30T12:33:19Z
1,063,480
<p>To me it sounds like a case of your application wanting to talk IRC, and my gut reaction would be to use Twisted, which has IRC clients. This may or may not be the right solution for you, but at least it's worth investigating.</p>
3
2009-06-30T12:48:53Z
[ "python", "irc" ]
Python IRC client: write from scratch or write plugin for existing framework?
1,063,409
<p>For our company I'd like to have a Python based IRC bot which checks whether the websites of our clients are still up and running. More specific: I want to list a number of URL which should be visited every, say, 15 minutes. If it fails, the URL should be checked again after 5 minutes. If retrieving the URL still do...
4
2009-06-30T12:33:19Z
1,063,485
<p>I vote for a completely new plugin for Supybot. Learn more ;)</p> <p>If you won't do so much, try <strong>python <a href="http://sourceforge.net/project/showfiles.php?group%5Fid=38297" rel="nofollow">irclib</a></strong>. It's a (still maintained) python lib for IRC.</p> <p><a href="http://twistedmatrix.com/trac/" ...
4
2009-06-30T12:49:25Z
[ "python", "irc" ]
Python IRC client: write from scratch or write plugin for existing framework?
1,063,409
<p>For our company I'd like to have a Python based IRC bot which checks whether the websites of our clients are still up and running. More specific: I want to list a number of URL which should be visited every, say, 15 minutes. If it fails, the URL should be checked again after 5 minutes. If retrieving the URL still do...
4
2009-06-30T12:33:19Z
1,063,724
<p>Writing a simple IRC bot isn't that hard. I have a template I keep using for my bots, which range from SVN bots to voting-status bots to bots which check connections to certain IPs and change the channel's topic according to the result.</p> <p>I can share the source if you'd like, though there's nothing like writin...
1
2009-06-30T13:33:44Z
[ "python", "irc" ]
Python IRC client: write from scratch or write plugin for existing framework?
1,063,409
<p>For our company I'd like to have a Python based IRC bot which checks whether the websites of our clients are still up and running. More specific: I want to list a number of URL which should be visited every, say, 15 minutes. If it fails, the URL should be checked again after 5 minutes. If retrieving the URL still do...
4
2009-06-30T12:33:19Z
1,129,917
<p>I finally decided to create use <a href="http://twistedmatrix.com/trac/" rel="nofollow">Twisted</a> for my bot. As to the why:</p> <ul> <li><p><a href="http://sourceforge.net/projects/supybot/" rel="nofollow">Supybot</a> already has a lot of functionality. And that can be a good thing: just create a simple plugin, ...
2
2009-07-15T07:29:39Z
[ "python", "irc" ]
Python IRC client: write from scratch or write plugin for existing framework?
1,063,409
<p>For our company I'd like to have a Python based IRC bot which checks whether the websites of our clients are still up and running. More specific: I want to list a number of URL which should be visited every, say, 15 minutes. If it fails, the URL should be checked again after 5 minutes. If retrieving the URL still do...
4
2009-06-30T12:33:19Z
23,969,017
<p>irc3 is a plugable irc client library based on asyncio and venusian <a href="https://irc3.readthedocs.org/" rel="nofollow">https://irc3.readthedocs.org/</a></p>
1
2014-05-31T10:36:14Z
[ "python", "irc" ]
Equivalent to Python’s findall() method in Ruby?
1,063,593
<p>I need to extract all MP3 titles from a fuzzy list in a list.</p> <p>With Python this works for me fine:</p> <pre><code>import re for i in re.compile('mmc.+?mp3').findall(open("tracklist.txt").read()): print i </code></pre> <p>How can I do that in Ruby?</p>
2
2009-06-30T13:09:06Z
1,063,674
<p>I don't know python very well, but it should be</p> <pre><code>File.read("tracklist.txt").matches(/mmc.+?mp3/).to_a.each { |match| puts match } </code></pre> <p>or</p> <pre><code>File.read("tracklist.txt").scan(/mmc.+?mp3/) { |match| puts match } </code></pre>
3
2009-06-30T13:25:17Z
[ "python", "ruby", "regex" ]
Equivalent to Python’s findall() method in Ruby?
1,063,593
<p>I need to extract all MP3 titles from a fuzzy list in a list.</p> <p>With Python this works for me fine:</p> <pre><code>import re for i in re.compile('mmc.+?mp3').findall(open("tracklist.txt").read()): print i </code></pre> <p>How can I do that in Ruby?</p>
2
2009-06-30T13:09:06Z
1,063,684
<pre><code>f = File.new("tracklist.txt", "r") s = f.read s.scan(/mmc.+?mp3/) do |track| puts track end </code></pre> <p>What this code does is open the file for reading and reads the contents as a string into variable <code>s</code>. Then the string is scanned for the regular expression <code>/mmc.+?mp3/</code> (<a ...
5
2009-06-30T13:26:05Z
[ "python", "ruby", "regex" ]
Equivalent to Python’s findall() method in Ruby?
1,063,593
<p>I need to extract all MP3 titles from a fuzzy list in a list.</p> <p>With Python this works for me fine:</p> <pre><code>import re for i in re.compile('mmc.+?mp3').findall(open("tracklist.txt").read()): print i </code></pre> <p>How can I do that in Ruby?</p>
2
2009-06-30T13:09:06Z
10,491,306
<p>even more simply:</p> <pre><code>puts File.read('tracklist.txt').scan /mmc.+?mp3/ </code></pre>
0
2012-05-08T01:23:15Z
[ "python", "ruby", "regex" ]
Python SQL Select with possible NULL values
1,063,601
<p>I'm new to python and have hit a problem with an SQL query I'm trying to perform.</p> <p>I am creating an SQL SELECT statement that is populated with values from an array as follows:</p> <pre><code>ret = conn.execute('SELECT * FROM TestTable WHERE a = ? b = ? c = ?', *values) </code></pre> <p>This works ok where ...
1
2009-06-30T13:10:06Z
1,063,624
<p>Use : "Select * from testtable where (a = ? or a is null) and (b=? or b is null) "</p> <p>This will select cases where a exactly matches the supplied value and will include the null values in the column - if that is what you want.</p>
3
2009-06-30T13:14:49Z
[ "python", "sql", null ]
Python SQL Select with possible NULL values
1,063,601
<p>I'm new to python and have hit a problem with an SQL query I'm trying to perform.</p> <p>I am creating an SQL SELECT statement that is populated with values from an array as follows:</p> <pre><code>ret = conn.execute('SELECT * FROM TestTable WHERE a = ? b = ? c = ?', *values) </code></pre> <p>This works ok where ...
1
2009-06-30T13:10:06Z
1,063,740
<p>If you're feeling adventurous, you could also check out SQLAlchemy. It provides amongst a lot of other things an SQL construction toolkit that automatically converts comparisons to None into IS NULL operations.</p>
0
2009-06-30T13:37:28Z
[ "python", "sql", null ]
Python SQL Select with possible NULL values
1,063,601
<p>I'm new to python and have hit a problem with an SQL query I'm trying to perform.</p> <p>I am creating an SQL SELECT statement that is populated with values from an array as follows:</p> <pre><code>ret = conn.execute('SELECT * FROM TestTable WHERE a = ? b = ? c = ?', *values) </code></pre> <p>This works ok where ...
1
2009-06-30T13:10:06Z
1,063,764
<p>You can always use the ternary operator to switch '=' for 'IS':<br/></p> <pre><code>("=","IS")[var is None] </code></pre> <p>Would return "IS" if var is None and "=" otherwise.</p> <p>It's not very elegant to do this in one line though, but just for demonstrating:</p> <pre><code>query = "SELECT * FROM testTable ...
1
2009-06-30T13:43:51Z
[ "python", "sql", null ]
Python SQL Select with possible NULL values
1,063,601
<p>I'm new to python and have hit a problem with an SQL query I'm trying to perform.</p> <p>I am creating an SQL SELECT statement that is populated with values from an array as follows:</p> <pre><code>ret = conn.execute('SELECT * FROM TestTable WHERE a = ? b = ? c = ?', *values) </code></pre> <p>This works ok where ...
1
2009-06-30T13:10:06Z
1,063,964
<p>If you are using SQL Server then as long as you set ANSI_NULLS off for the session '= null' comparison will work. </p> <p><a href="http://msdn.microsoft.com/en-us/library/ms188048.aspx" rel="nofollow">SET ANSI_NULLS</a></p>
1
2009-06-30T14:22:56Z
[ "python", "sql", null ]
Python SQL Select with possible NULL values
1,063,601
<p>I'm new to python and have hit a problem with an SQL query I'm trying to perform.</p> <p>I am creating an SQL SELECT statement that is populated with values from an array as follows:</p> <pre><code>ret = conn.execute('SELECT * FROM TestTable WHERE a = ? b = ? c = ?', *values) </code></pre> <p>This works ok where ...
1
2009-06-30T13:10:06Z
6,719,784
<p>First and foremost, I would strongly caution you against using <code>SELECT * FROM tbl WHERE (col = :x OR col IS NULL)</code> as this will most likely disqualify your query from indexing (use a query profiler). <code>SET ANSI_NULLS</code> is also one of those things that may not be supported in your particular data...
0
2011-07-16T19:42:59Z
[ "python", "sql", null ]
Python SQL Select with possible NULL values
1,063,601
<p>I'm new to python and have hit a problem with an SQL query I'm trying to perform.</p> <p>I am creating an SQL SELECT statement that is populated with values from an array as follows:</p> <pre><code>ret = conn.execute('SELECT * FROM TestTable WHERE a = ? b = ? c = ?', *values) </code></pre> <p>This works ok where ...
1
2009-06-30T13:10:06Z
33,132,828
<p>The following was tested on python sqlite3 by now, however it should work in other DB types since it quite general. The approach is the same to @MoshiBin answer with some additions:</p> <p>Here is the form using cursor.execute() regular syntax, so the null variables is not supported while using this form:</p> <pre...
0
2015-10-14T18:22:40Z
[ "python", "sql", null ]
how to use french letters in a django template?
1,063,626
<p>I have some french letters (é, è, à...) in a django template but when it is loaded by django, an UnicodeDecodeError exception is raised.</p> <p>If I don't load the template but directly use a python string. It works ok.</p> <p>Is there something to do to use unicode with django template?</p>
5
2009-06-30T13:14:59Z
1,063,665
<p>You are probably storing the template in a non-unicode encoding, such as latin-1. I believe Django assumes that templates are in UTF-8 by default (though there is a setting to override this).</p> <p>Your editor should be capable of saving the template file in the UTF-8 encoding (probably via a dropdown on the save...
7
2009-06-30T13:23:52Z
[ "python", "django", "unicode" ]
how to use french letters in a django template?
1,063,626
<p>I have some french letters (é, è, à...) in a django template but when it is loaded by django, an UnicodeDecodeError exception is raised.</p> <p>If I don't load the template but directly use a python string. It works ok.</p> <p>Is there something to do to use unicode with django template?</p>
5
2009-06-30T13:14:59Z
1,063,676
<p>This is from the <a href="http://docs.djangoproject.com/en/dev/ref/unicode/#templates" rel="nofollow">Django unicode documentation</a> related to your problem:</p> <p>" But the common case is to read templates from the filesystem, and this creates a slight complication: not all filesystems store their data encoded ...
3
2009-06-30T13:25:31Z
[ "python", "django", "unicode" ]
PyQt: Consolidating signals to a single slot
1,063,734
<p>I am attempting to reduce the amount of signals I have to use in my contextmenus. The menu consists of actions which switches the operation mode of the program, so the operation carried out by the slots is very simple. Quoting the documentation on QMenu::triggered,</p> <blockquote> <p>Normally, you connect each m...
2
2009-06-30T13:36:18Z
1,063,789
<p>You can use <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qobject.html#sender" rel="nofollow">QObject::sender()</a> to figure out which QAction emitted the signal.</p> <p>So your slot might look like this:</p> <pre><code>def triggered(self): sender = QtCore.QObject.sender() if sender...
1
2009-06-30T13:48:34Z
[ "python", "qt" ]
PyQt: Consolidating signals to a single slot
1,063,734
<p>I am attempting to reduce the amount of signals I have to use in my contextmenus. The menu consists of actions which switches the operation mode of the program, so the operation carried out by the slots is very simple. Quoting the documentation on QMenu::triggered,</p> <blockquote> <p>Normally, you connect each m...
2
2009-06-30T13:36:18Z
1,063,960
<p>I use this approach:</p> <pre><code>from functools import partial def bind(self, action, *params): self.connect(action, QtCore.SIGNAL('triggered()'), partial(action, *params, self.onMenuAction)) def onMenuAction(self, *args): pass bind(self.actionOpMode1, 'action1') bind(self.actionOpM...
2
2009-06-30T14:22:14Z
[ "python", "qt" ]
PyQt: Consolidating signals to a single slot
1,063,734
<p>I am attempting to reduce the amount of signals I have to use in my contextmenus. The menu consists of actions which switches the operation mode of the program, so the operation carried out by the slots is very simple. Quoting the documentation on QMenu::triggered,</p> <blockquote> <p>Normally, you connect each m...
2
2009-06-30T13:36:18Z
1,063,969
<p>Using QObject.Sender is one of the solution, although not the cleanest one.</p> <p>Use <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qsignalmapper.html" rel="nofollow">QSignalMapper</a> to associate cleanly a value with the object that emitted the signal.</p>
3
2009-06-30T14:24:16Z
[ "python", "qt" ]
In Python, Using pyodbc, How Do You Perform Transactions?
1,063,770
<p>I have a username which I must change in numerous (up to ~25) tables. (Yeah, I know.) An atomic transaction seems to be the way to go for this sort of thing. However, I do not know how to do this with pyodbc. I've seen various tutorials on atomic transactions before, but have never used them.</p> <p>The setup: ...
1
2009-06-30T13:45:12Z
1,063,879
<p>I don't think pyodbc has any specific support for transactions. You need to send the SQL command to start/commit/rollback transactions.</p>
-2
2009-06-30T14:05:06Z
[ "python", "transactions", "pyodbc" ]
In Python, Using pyodbc, How Do You Perform Transactions?
1,063,770
<p>I have a username which I must change in numerous (up to ~25) tables. (Yeah, I know.) An atomic transaction seems to be the way to go for this sort of thing. However, I do not know how to do this with pyodbc. I've seen various tutorials on atomic transactions before, but have never used them.</p> <p>The setup: ...
1
2009-06-30T13:45:12Z
1,064,149
<p>By its <a href="http://code.google.com/p/pyodbc/wiki/FAQs#Connecting%5Ffails%5Fwith%5Fan%5Ferror%5Fabout%5FSQL%5FATTR%5FAUTOCOMMIT">documentation</a>, pyodbc does support transactions, but only if the odbc driver support it. Furthermore, as pyodbc is compliant with <a href="http://www.python.org/dev/peps/pep-0249/">...
6
2009-06-30T14:57:31Z
[ "python", "transactions", "pyodbc" ]
Hex data from socket, process and response
1,063,775
<p>Lets put it in parts.</p> <p>I got a socket receiving data OK and I got it in the <code>\x31\x31\x31</code> format.</p> <p>I know that I can get the same number, ripping the <code>\x</code> with something like </p> <pre><code>for i in data: print hex(ord(i)) </code></pre> <p>so I got <code>31</code> in each case...
0
2009-06-30T13:45:38Z
1,063,824
<p>use the struct module</p> <p>unpack and get the 3 values in abc</p> <p><code>(a, b, c) = struct.unpack("&gt;BBB", your_string)</code></p> <p>then </p> <p><code>a, b, c = a+1, b+1, c+1</code></p> <p>and pack into the response</p> <p><code>response = struct.pack("&gt;BBB", a, b, c)</code></p> <p>see the struct ...
4
2009-06-30T13:55:41Z
[ "python", "sockets", "hex" ]
Hex data from socket, process and response
1,063,775
<p>Lets put it in parts.</p> <p>I got a socket receiving data OK and I got it in the <code>\x31\x31\x31</code> format.</p> <p>I know that I can get the same number, ripping the <code>\x</code> with something like </p> <pre><code>for i in data: print hex(ord(i)) </code></pre> <p>so I got <code>31</code> in each case...
0
2009-06-30T13:45:38Z
1,063,840
<p>The opposite of ord() would be chr().</p> <p>So you could do this to add one to it:</p> <pre><code>newchar = chr(ord(i) + 1) </code></pre> <p>To use that in your example:</p> <pre><code>newdata = '' for i in data: newdata += chr(ord(i) + 1) print repr(newdata) </code></pre> <p>But if you really wanted to w...
0
2009-06-30T13:58:07Z
[ "python", "sockets", "hex" ]
Hex data from socket, process and response
1,063,775
<p>Lets put it in parts.</p> <p>I got a socket receiving data OK and I got it in the <code>\x31\x31\x31</code> format.</p> <p>I know that I can get the same number, ripping the <code>\x</code> with something like </p> <pre><code>for i in data: print hex(ord(i)) </code></pre> <p>so I got <code>31</code> in each case...
0
2009-06-30T13:45:38Z
1,063,862
<p>The "\x31" is not a format but the text representation of the binary data. As you mention ord() will convert one byte of binary data into an int, so you can do maths on it.</p> <p>To convert it back to binary data in a string, you can use chr() if it's on just one integer. If it's many, you can use the %c formatti...
4
2009-06-30T14:02:02Z
[ "python", "sockets", "hex" ]
Hex data from socket, process and response
1,063,775
<p>Lets put it in parts.</p> <p>I got a socket receiving data OK and I got it in the <code>\x31\x31\x31</code> format.</p> <p>I know that I can get the same number, ripping the <code>\x</code> with something like </p> <pre><code>for i in data: print hex(ord(i)) </code></pre> <p>so I got <code>31</code> in each case...
0
2009-06-30T13:45:38Z
1,063,928
<p>OMG, what a fast answering! :D</p> <p>I think that i was stuck on the ">B" parameter to struct, as i used "h" and that sample parameters (newbie on struct.pack talking!)</p> <p>Tried the encode/decode thing but socket on the other side receive them as numbers, not the "\x" representation it wanted.</p> <p>I reall...
0
2009-06-30T14:15:19Z
[ "python", "sockets", "hex" ]
Adding encoding alias to python
1,064,086
<p>Is there a way that I can add alias to python for encoding. There are sites on the web that are using the encoding 'windows-1251' but have their charset set to win-1251, so I would like to have win-1251 be an alias to windows-1251</p>
3
2009-06-30T14:47:20Z
1,064,191
<pre><code>&gt;&gt;&gt; import encodings &gt;&gt;&gt; encodings.aliases.aliases['win_1251'] = 'cp1251' &gt;&gt;&gt; print '\xcc\xce\xd1K\xc2\xc0'.decode('win-1251') MOCKBA </code></pre> <p>Although I personally would consider this monkey-patching, and use my own conversion table. But I can't give any good arguments fo...
3
2009-06-30T15:04:20Z
[ "python", "unicode", "character-encoding" ]
Adding encoding alias to python
1,064,086
<p>Is there a way that I can add alias to python for encoding. There are sites on the web that are using the encoding 'windows-1251' but have their charset set to win-1251, so I would like to have win-1251 be an alias to windows-1251</p>
3
2009-06-30T14:47:20Z
1,064,308
<p>The <code>encodings</code> module is not well documented so I'd instead use <code>codecs</code>, which <a href="http://docs.python.org/library/codecs.html">is</a>:</p> <pre><code>import codecs def encalias(oldname, newname): old = codecs.lookup(oldname) new = codecs.CodecInfo(old.encode, old.decode, ...
7
2009-06-30T15:24:13Z
[ "python", "unicode", "character-encoding" ]
Adding encoding alias to python
1,064,086
<p>Is there a way that I can add alias to python for encoding. There are sites on the web that are using the encoding 'windows-1251' but have their charset set to win-1251, so I would like to have win-1251 be an alias to windows-1251</p>
3
2009-06-30T14:47:20Z
31,154,573
<p>Encoding aliases can be added by editing aliases.py file.</p> <pre><code># euc_jp codec 'eucjp' : 'euc_jp', 'ujis' : 'euc_jp', 'u_jis' : 'euc_jp', 'euc_jp_linux' : 'euc_jp', 'euc-jp-linux' : 'euc_jp', </code></pre> <p>Above I have added two aliases <strong>euc_jp...
0
2015-07-01T07:02:11Z
[ "python", "unicode", "character-encoding" ]
How to debug the MySQL error message: Caught an exception while rendering
1,064,152
<p>I am building Django +MySQL on dreamhost, but met the error messages: <br> Caught an exception while rendering: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY <code>tag</code>.<code>used_count</code> DESC, <cod...
0
2009-06-30T14:57:58Z
1,064,179
<p>Is it possible that there are no questions, in which case the SQL will contain something like <code>"WHERE question_id IN ()"</code> which wouldn't be valid SQL.</p>
2
2009-06-30T15:02:53Z
[ "python", "mysql", "django", "dreamhost" ]
In Python 2.5, how do I kill a subprocess?
1,064,335
<p>I am using the subprocess package in Python to run a subprocess, which I later need to kill. However, the documentation of the subprocess package states that the terminate() function is only available from 2.6</p> <p>We are running Linux with 2.5 and for backwards compatibility reasons I cannot upgrade to 2.6, what...
26
2009-06-30T15:27:16Z
1,064,370
<p>You call os.kill on the process pid.</p> <pre><code>os.kill(process.pid, signal.SIGKILL) </code></pre> <p>You're OK because you're on on Linux. Windows users are out of luck.</p>
37
2009-06-30T15:32:06Z
[ "python", "subprocess" ]
In Python 2.5, how do I kill a subprocess?
1,064,335
<p>I am using the subprocess package in Python to run a subprocess, which I later need to kill. However, the documentation of the subprocess package states that the terminate() function is only available from 2.6</p> <p>We are running Linux with 2.5 and for backwards compatibility reasons I cannot upgrade to 2.6, what...
26
2009-06-30T15:27:16Z
1,064,430
<p>To complete @Gareth's answer, on Windows you do:</p> <pre><code>import ctypes PROCESS_TERMINATE = 1 handle = ctypes.windll.kernel32.OpenProcess(PROCESS_TERMINATE, False, theprocess.pid) ctypes.windll.kernel32.TerminateProcess(handle, -1) ctypes.windll.kernel32.CloseHandle(handle) </code></pre> <p>not quite as eleg...
40
2009-06-30T15:41:43Z
[ "python", "subprocess" ]
In Python 2.5, how do I kill a subprocess?
1,064,335
<p>I am using the subprocess package in Python to run a subprocess, which I later need to kill. However, the documentation of the subprocess package states that the terminate() function is only available from 2.6</p> <p>We are running Linux with 2.5 and for backwards compatibility reasons I cannot upgrade to 2.6, what...
26
2009-06-30T15:27:16Z
5,080,048
<p>In order to complete @Gareth's and @Alex answers, if you don't want to bother with the underlaying system, you can use <a href="http://code.google.com/p/psutil">psutil</a>.</p> <blockquote> <p>psutil is a module providing an interface for retrieving information on running processes and system utilization (C...
6
2011-02-22T15:22:36Z
[ "python", "subprocess" ]
In Python 2.5, how do I kill a subprocess?
1,064,335
<p>I am using the subprocess package in Python to run a subprocess, which I later need to kill. However, the documentation of the subprocess package states that the terminate() function is only available from 2.6</p> <p>We are running Linux with 2.5 and for backwards compatibility reasons I cannot upgrade to 2.6, what...
26
2009-06-30T15:27:16Z
8,536,476
<p>Thats a copy&amp;pase complete solution:</p> <pre><code>def terminate_process(pid): # all this shit is because we are stuck with Python 2.5 and \ we cannot use Popen.terminate() if sys.platform == 'win32': import ctypes PROCESS_TERMINATE = 1 handle = ctypes.windll.kernel32.Open...
4
2011-12-16T15:40:08Z
[ "python", "subprocess" ]
error while uploading project to Google App Engine(python)
1,064,422
<pre><code>2009-06-30 23:36:28,483 ERROR appcfg.py:1272 An unexpected error occurred. Aborting. Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1250, in DoUpload missing_files = self.Begin() File "C:\Program Files\Google\google_appengine\...
-2
2009-06-30T15:40:49Z
1,064,442
<p>I see a HTTP 403 Forbidden in there, which says to me that your authentications is probably not sorted out correctly.</p>
0
2009-06-30T15:43:38Z
[ "python", "google-app-engine", "uploading" ]
error while uploading project to Google App Engine(python)
1,064,422
<pre><code>2009-06-30 23:36:28,483 ERROR appcfg.py:1272 An unexpected error occurred. Aborting. Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1250, in DoUpload missing_files = self.Begin() File "C:\Program Files\Google\google_appengine\...
-2
2009-06-30T15:40:49Z
1,064,456
<p>You're trying to upload to a URL to which you lack access -- are you sure you're spelling your app name right, own its name on appspot, etc, etc?</p>
1
2009-06-30T15:45:37Z
[ "python", "google-app-engine", "uploading" ]
error while uploading project to Google App Engine(python)
1,064,422
<pre><code>2009-06-30 23:36:28,483 ERROR appcfg.py:1272 An unexpected error occurred. Aborting. Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1250, in DoUpload missing_files = self.Begin() File "C:\Program Files\Google\google_appengine\...
-2
2009-06-30T15:40:49Z
1,064,458
<p>HTTP Error 403: Forbidden... bad username/password for the given application (did you change app.yaml at all since the last successful update)?</p> <p>The requested URL could not be retrieved... Or maybe they had a service interruption. Try again after a bit.</p>
0
2009-06-30T15:45:53Z
[ "python", "google-app-engine", "uploading" ]
What is the best way to add an API to a Django application?
1,064,520
<p>I am adding MetaWeblog API support to a Django CMS, and am not quite sure how to layer the application.</p> <p>I am using django_xmlrpc, which allows me to map to parameterised functions for each request. It is just a case of what level do I hook in calls to the django application from the service functions (AddPag...
2
2009-06-30T15:56:17Z
1,064,563
<p>Web services API's are just more URL's.</p> <p>These WS API URL's map to view functions.</p> <p>The WS view functions handle GET and POST (and possibly PUT and DELETE).</p> <p>The WS view functions use Forms as well as the Models to make things happen.</p> <p>It is, in a way, like an admin interface. Except, th...
2
2009-06-30T16:04:08Z
[ "python", "django", "api", "django-models", "django-admin" ]
What is the best way to add an API to a Django application?
1,064,520
<p>I am adding MetaWeblog API support to a Django CMS, and am not quite sure how to layer the application.</p> <p>I am using django_xmlrpc, which allows me to map to parameterised functions for each request. It is just a case of what level do I hook in calls to the django application from the service functions (AddPag...
2
2009-06-30T15:56:17Z
13,488,192
<p>It seems python does not provide this out of the box. But there is something called abc module:</p> <p>I quote from <a href="http://www.doughellmann.com/PyMOTW/abc/" rel="nofollow">http://www.doughellmann.com/PyMOTW/abc/</a> "By defining an abstract base class, you can define a common API for a set of subclasses. T...
0
2012-11-21T07:19:27Z
[ "python", "django", "api", "django-models", "django-admin" ]
Are Python commands suitable in Vim's visual mode?
1,064,644
<p>I have found the following command in AWK useful in Vim</p> <pre><code>:'&lt;,'&gt;!awk '{ print $2 }' </code></pre> <p>Python may also be useful in Vim. However, I have not found an useful command in Python for Vim's visual mode.</p> <p><strong>Which Python commands do you use in Vim</strong>?</p>
0
2009-06-30T16:19:31Z
1,064,721
<p>It's hard to make useful one-liner filters in Python. You need to import <code>sys</code> to get <code>stdin</code>, and already you're starting to push it. This isn't to say anything bad about Python. My feeling is that Python is optimized for multi-line scripts, while the languages that do well at one-liners (awk,...
4
2009-06-30T16:38:27Z
[ "python", "vim" ]
Are Python commands suitable in Vim's visual mode?
1,064,644
<p>I have found the following command in AWK useful in Vim</p> <pre><code>:'&lt;,'&gt;!awk '{ print $2 }' </code></pre> <p>Python may also be useful in Vim. However, I have not found an useful command in Python for Vim's visual mode.</p> <p><strong>Which Python commands do you use in Vim</strong>?</p>
0
2009-06-30T16:19:31Z
1,064,951
<p>Python is most useful with vim when used to code vim "macros" (you need a vim compiled with <code>+python</code>, but many pre-built ones come that way). <a href="http://www.tummy.com/Community/Presentations/vimpython-20070225/vim.html" rel="nofollow">Here</a> is a nice presentation about some of the things you can ...
4
2009-06-30T17:30:44Z
[ "python", "vim" ]
Formatting a variable in Django and autofields
1,064,953
<p>I have this problem I've been trying to tackle for a while. I have a variable that is 17 characters long, and when displaying the variable on my form, I want it to display the last seven characters of this variable in bold...how do I go about this...I'd really appreciate anybody's insight on this.</p>
0
2009-06-30T17:31:18Z
1,065,003
<pre><code>{{ thevar|slice:":-7" }}&lt;b&gt;{{ thevar|slice:"-7:" }}&lt;/b&gt; </code></pre> <p>The <code>slice</code> built-in filter in Django templates acts like slicing does in Python, so that for example <code>s[:-7]</code> is the string excluding its last 7 characters and <code>s[-7:]</code> is the substring for...
2
2009-06-30T17:40:02Z
[ "python", "django", "string-formatting" ]
for statement in python
1,065,133
<p>When an exe file is run it prints out some stuff. I'm trying to run this on some numbers below and print out line 54 ( = blah ). It says process isn't defined and I'm really unsure how to fix this and get what I want printed to the screen. If anyone could post some code or ways to fix this thank you so very much!</p...
1
2009-06-30T18:10:46Z
1,065,146
<p>Are you sure this is right</p> <pre><code>cmd = ' -j ' + str(el) + ' -jk ' + str(az) + ' blah ' </code></pre> <p>Where's your executable?</p>
2
2009-06-30T18:13:00Z
[ "python" ]
for statement in python
1,065,133
<p>When an exe file is run it prints out some stuff. I'm trying to run this on some numbers below and print out line 54 ( = blah ). It says process isn't defined and I'm really unsure how to fix this and get what I want printed to the screen. If anyone could post some code or ways to fix this thank you so very much!</p...
1
2009-06-30T18:10:46Z
1,065,149
<p>The following line</p> <pre><code>outputstring = process.communicate()[0] </code></pre> <p>calls the <code>communicate()</code> method of the <code>process</code> variable, but <code>process</code> has not been defined yet. You define it later in the code. You need to move that definition higher up.</p> <p>Also, ...
2
2009-06-30T18:13:53Z
[ "python" ]
for statement in python
1,065,133
<p>When an exe file is run it prints out some stuff. I'm trying to run this on some numbers below and print out line 54 ( = blah ). It says process isn't defined and I'm really unsure how to fix this and get what I want printed to the screen. If anyone could post some code or ways to fix this thank you so very much!</p...
1
2009-06-30T18:10:46Z
1,065,254
<p><code>process</code> isn't defined because your statements are out of order.</p> <pre><code> outputstring = process.communicate()[0] outputlist = outputstring.splitlines() blah = outputlist[53] cmd = ' -j ' + str(j) + ' -b ' + str(b) + ' blah ' process = Popen(cmd, shell=True, stderr=STDOUT, s...
1
2009-06-30T18:36:15Z
[ "python" ]
for statement in python
1,065,133
<p>When an exe file is run it prints out some stuff. I'm trying to run this on some numbers below and print out line 54 ( = blah ). It says process isn't defined and I'm really unsure how to fix this and get what I want printed to the screen. If anyone could post some code or ways to fix this thank you so very much!</p...
1
2009-06-30T18:10:46Z
1,065,351
<p>I can't help but clean that up a little.</p> <pre><code># aesthetically (so YMMV), I think the code would be better if it were ... # (and I've asked some questions throughout) j_map = { 90: [0], # prefer lists [] to tuples (), I say... 52.62263: [0, 72, 144, 216, 288], 26.5651: [324, 36, 108, 180, 252], 1...
6
2009-06-30T18:53:43Z
[ "python" ]
What can you do with COM/ActiveX in Python?
1,065,844
<p>I'm thinking that I'm going to have to run monthly reports in Crystal Reports. I've read that you can automate this with COM/ActiveX but I'm not that advanced to understand what this is or what you can even do with it. </p> <p>I'm fairly familiar with Python and it looks like from what I've read, I might be able ...
23
2009-06-30T20:24:44Z
1,066,390
<p>You can basically do the equivalent of late binding. So whatever is exposed through IDispatch is able to be consumed. </p> <p>Here's some code I wrote this weekend to get an image from a twain device via Windows Image Acquisition 2.0 and put the data into something I can shove in a gtk based UI.</p> <pre><code>WIA...
3
2009-06-30T22:21:53Z
[ "python", "com", "crystal-reports", "activex", "pywin32" ]
What can you do with COM/ActiveX in Python?
1,065,844
<p>I'm thinking that I'm going to have to run monthly reports in Crystal Reports. I've read that you can automate this with COM/ActiveX but I'm not that advanced to understand what this is or what you can even do with it. </p> <p>I'm fairly familiar with Python and it looks like from what I've read, I might be able ...
23
2009-06-30T20:24:44Z
1,067,842
<p>First you have to install the wonderful <a href="http://sourceforge.net/projects/pywin32/" rel="nofollow">pywin32</a> module.</p> <p>It provides COM support. You need to run the makepy utility. It is located at C:...\Python26\Lib\site-packages\win32com\client. On Vista, it must be ran with admin rights.</p> <p>Thi...
25
2009-07-01T07:59:48Z
[ "python", "com", "crystal-reports", "activex", "pywin32" ]
What can you do with COM/ActiveX in Python?
1,065,844
<p>I'm thinking that I'm going to have to run monthly reports in Crystal Reports. I've read that you can automate this with COM/ActiveX but I'm not that advanced to understand what this is or what you can even do with it. </p> <p>I'm fairly familiar with Python and it looks like from what I've read, I might be able ...
23
2009-06-30T20:24:44Z
1,067,876
<p>You can also find useful tips here : <a href="http://timgolden.me.uk/python/win32_how_do_i.html">http://timgolden.me.uk/python/win32_how_do_i.html</a> it's easy to adapt to any kind of application.</p>
5
2009-07-01T08:08:18Z
[ "python", "com", "crystal-reports", "activex", "pywin32" ]