I would like to replicate this in python:
gvimdiff <(hg cat file.txt) file.txt
(hg cat file.txt outputs the most recently committed version of file.txt)
I know how to pipe the file to gvimdiff, but it won't accept another file:
$ hg cat file.txt | gvimdiff file.txt -
Too many edit arguments: "-"
Getting to the python part...
# hg...
I'm trying to use Python with ReportLab 2.2 to create a PDF report.
According to the user guide,
Special TableStyle Indeces [sic]
In any style command the first row index may be set to one of the special strings 'splitlast' or 'splitfirst' to indicate that the style should be used only for the last row of a split table, or the f...
Hi there, i'm begining on a new proyect that need to collect data from some VoIP network equiment, and i thinking to make a python app using some network library and need know some intersting Books or web resources about the netwoking library in python.
best regards.
...
So what i'm talking about here are nested classes. So essentially I have two classes that I'm modeling. I have a DownloadManager class and a DownloadThread class. The obvious OOP concept here is composition. However, composition doesn't necessarily mean nesting, right?
So I have code that looks something like this:
class DownloadThread...
I develop an extension module for Guile, written in C. This extension module embeds a Python interpreter.
Since this extension module invokes the Python interpreter, I need to verify that it properly manages the memory occupied by Python objects.
I found that the Python interpreter is well-behaved in its own memory handling, so that...
Recently I've been experimenting with TDD while developing a GUI application in Python. I find it very reassuring to have tests that verify the functionality of my code, but it's been tricky to follow some of the recommened practices of TDD. Namely, writing tests first has been hard. And I'm finding it difficult to make my tests readable...
I am writing a web application that requires user interaction via email. I'm curious if there is a best practice or recommended source for learning about processing email. I am writing my application in Python, but I'm not sure what mail server to use or how to format the message or subject line to account for automated processing. I'...
No matter what I do sys.exit() is called by unittest, even the most trivial examples. I can't tell if my install is messed up or what is going on.
IDLE 1.2.2 ==== No Subprocess ====
>>> import unittest
>>>
>>> class Test(unittest.TestCase):
def testA(self):
a = 1
self.assertEqual(a,1)
>>> unittest.main(...
How do I convert a datetime string in local time to a string in UTC time?
I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.
Clarification: For example, if I have "2008-09-17 14:02:00" in my local timezone (+10), I'd like to generate a string with the equivalent UTC time: "2...
Since the Google App Engine Datastore is based on Bigtable and we know that's not a relational database, how do you design a database schema/data model for applications that use this type of database system?
...
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are going to ask "what happens if there are quotes within the quotes, well, in my application, that will never...
Is there any library available to query Btrieve databases without buying something from Pervasive? I'm looking to code in C# or Python.
...
Is there a c# library which provides similar functionality to the Python PubSub library? I think it's kind of an Observer Pattern which allows me to subscribe for messages of a given topic instead of using events.
...
I'm having trouble developing a reverse proxy in Twisted. It works, but it seems overly complex and convoluted. So much of it feels like voodoo...
Are there any simple, solid examples of asynchronous program structure on the web or in books? A sort of best practices guide? When I complete my program I'd like to be able to still see the ...
As you can see, even after the program should have died it speaks from the grave. Is there a way to "deregister" the exitfunction in case of exceptions?
import atexit
def helloworld():
print "Hello World!"
atexit.register(helloworld)
raise Exception("Good bye cruel world!")
...
While answering http://stackoverflow.com/questions/68645/python-static-variable#81002
I noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice?
PythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (Intel)] on win32.
Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin' for furthe...
Asking as a Python beginner, what IDEs ("GUIs/editors") do others use for Python coding?
If you can just give the name (for example, Textpad, Eclipse ..) that will be enough. If it is already mentioned, you can just vote for it.
But if you can also give some more comparative information, that will be much appreciated.
Update: Result...
I know it's possible to place a PyCairo surface inside a Gtk Drawing Area. But I think Qt is a lot better to work with, so I've been wondering if there's anyway to place a PyCairo surface inside some Qt component?
...
I get DNS records from a Python program, using DNS
Python
I can get various DNSSEC-related records:
>>> import dns.resolver
>>> myresolver = dns.resolver.Resolver()
>>> myresolver.use_edns(1, 0, 1400)
>>> print myresolver.query('sources.org', 'DNSKEY')
<dns.resolver.Answer object at 0xb78ed78c>
>>> print myresolver.query('ripe.net', 'N...
Is there any list of blog engines, written in Django?
...