First  |  Prev |  Next  |  Last
Pages: 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
Diff of Text
Hi All, I am looking for an algorithm that can compare to source code files line by line and find the minimum diff. I have looked at the difflib included in python. The problem is that it is designed to make the diff results easier for humans to read, instead of minimize the size of the output differencial. I wo... 6 Jun 2010 00:32
questions about how to parse a string and put it in a dictionary
I've got a string which (without any CR or LF) consists of 'attribute1=attribute_value;attribute2=attribute_value2; ...' and I want them to read in a dictionary so that the attribute name is the key and the attribute value is the data. Any ideas for an implementation? Greetings and thanks jb ... 4 Jun 2010 09:11
How to run a python script with a configuration file at command line ?
steph_awk <stephane.larochelle(a)gmail.com> writes: I have been searching for quite some times without success. Did you try the standard library? I have a python script that needs to start from command line and it should have a config file to fill out the detais (itis one program, and many possible con... 3 Jun 2010 22:19
Plain simple unix timestamp with an HTTP GET
I'd like to just quickly and with a minimum of parsing (ie no screen- scraping) get a unix epoch timestamp (or another format if necessary). I thought with a quick second search on Google I'd find a URL where I could do a simple urllib2 based HTTP GET and have a timestamp returned to me. I don't want to use N... 4 Jun 2010 10:18
getting MemoryError with dicts; suspect memory fragmentation
On Jun 3, 3:43 pm, "Emin.shopper Martinian.shopper" <emin.shop...(a)gmail.com> wrote: Dear Experts, I am getting a MemoryError when creating a dict in a long running process and suspect this is due to memory fragmentation. Any suggestions would be welcome. Full details of the problem are below. I ha... 10 Jun 2010 07:46
An empty object with dynamic attributes (expando)
How can I create an empty object with dynamic attributes? It should be something like: m = object() m.myattr = 1 But this doesn't work. And I have to resort to: class expando(object): pass m = expando() m.myattr = 1 Is there a one-liner that would do the thing? -- Cheers, Dmitry ... 10 Jun 2010 22:21
Issue with xml iterparse
I am using lxml iterparse and running into a very obscure error. When I run iterparse on a file, it will occasionally return an element that has a element.text == None when the element clearly has text in it. I copy and pasted the problem xml into a python string, used StringIO to create a file-like object out of... 13 Jun 2010 08:16
changing format of time duration.
Quick question. I have to time stamps (now and now2). now = datetime.datetime.now(); now2 = datetime.datetime.now(); now2-now1 yields me a result in 0:00:00.11221 (H:MM:SS.ssss) I wanted to know if there is a standard python method or a quick hack to add an extra zero in the beginning. So the result I am ... 5 Jun 2010 04:55
problems with CSV module
Hi all, I'm using csv to read text files, and its working fine, except in two cases: - when there is only one line of text (data) in the file - when there is a blank line after the last data line this is the kind of data: 45 67 89 23 45 06 12 34 67 .... and this is the function: def getData(paths)... 5 Jun 2010 20:12
sandboxing python code
On Thu, Jun 3, 2010 at 9:12 PM, Shashwat Anand <anand.shashwat(a)gmail.com> wrote: I have not much idea but Online Judges like SPOJ/codechef have regular programming-contests and python is one of allowed languages. So yes, it's I am trying to make an online test for Python . P.S Sorry ,I did not realize I sen... 3 Jun 2010 14:30
First  |  Prev |  Next  |  Last
Pages: 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109