First  |  Prev |  Next  |  Last
Pages: 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
Handling text lines from files with some (few) starnge chars
I need to read text files and process each line using string comparisions and regexp. I have a python2 program that uses <file object>.readline to read each line as a string. Then, processing it was a trivial job. With python3 I got error messagew like: File "./pp1.py", line 93, in RL line=inf.readline() ... 6 Jun 2010 00:32
modify XMP data (Python/Windows)
I want to modify XMP data for a bunch of JPEG files, using Python if possible, on Windows. I expected PIL would support this. But no? I found the Python XMP Toolkit http://www.spacetelescope.org/static/projects/python-xmp-toolkit/docs/installation.html#requirements but no reports of successful use on Windows. ... 5 Jun 2010 19:06
Where's the List?
Victor Subervi wrote: Where's the list? They're both tuples in that last line of code. for order in order_details: store = order[0] prodid = order[1] pkg = order[2] quantity = order[3] if 'PatientID' in order_fields: patientID = order[4] t... 5 Jun 2010 16:54
is there a way to warn about missing modules *without* runningpython?
On 6/5/2010 9:42 AM, lkcl wrote: if someone could perhaps explain this (in a different way from me), in the context of "python the programming language" and "python the http://python.org interpreter", i.e. having absolutely nothing to do with pyjamas, i would be most grateful, and it would benefit that ... 5 Jun 2010 15:48
error in importing numpy
On 12:26 pm, michelparker(a)live.com wrote: Hi, I am using ubuntu 9.10 . I just installed python 2.6.1 in /opt/python2.6 for using it with wingide for debugging symbols. I also installed numpy in python 2.6.1 using -- prefix method. but when i import numpy i get following error : ImportError: undefin... 5 Jun 2010 10:18
Python treats non-breaking space wrong?
It seems that Python treats non-breaking space (\xa0) as a normal whitespace character, e.g. when splitting a string. See below: s='hello\xa0there' s.split() ['hello', 'there'] Surely this is not intended behaviour? ... 5 Jun 2010 05:59
Replace in large text file ?
I am new to Python and am wanting to replace characters in a very large text file.....6 GB In plain language what I wish to do is: Remove all comma's Replace all @ with comma's Save as a new file. Any of you clever people know the best way to do this......idiot guide please. Thanks Steve ... 9 Jun 2010 07:30
Plotting in batch with no display
Admittedly not the strongest reason, but yet an important one, for switching from Matlab to python/numpy/scipy/matplotlib, is that Matlab is very cumbersome to run in batch. Now I discover that some of the matplotlib.pyplot functions (incl. plot and contour) insist on opening an X11 window (just like Matlab doe... 8 Jun 2010 05:49
bz2 module doesn't work properly with all bz2 files
I'm not sure what's causing this, but depending on the compression program used, the bz2 module sometimes exits earlier. I used pbzip2 to compress my bz2 files and read through the file using the bz2 module. The file descriptor always exits much earlier than where the actual EOF is. If I use bzip2 instead of pbzi... 4 Jun 2010 22:28
tallying occurrences in list
Task: given a list, produce a tally of all the distinct items in the list (for some suitable notion of "distinct"). Example: if the list is ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c', 'a'], then the desired tally would look something like this: [('a', 4), ('b', 3), ('c', 3)] I find myself needing... 5 Jun 2010 14:41
First  |  Prev |  Next  |  Last
Pages: 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107