Hi All,
Please take a look at a new job opportunity for Python/Plone developers.
Patrick Waldo,
Project Manager
Decernis http://decernis.com/
*Job Description: Full Time Python/Plone Developer*
We are looking for a highly motivated and self-reliant developer to work on
systems built with Plone
Hi All,
The company I work for, Decernis, has two job opportunities that might be
of interest. Decernis provides global systems for regulatory compliance
management of foods and consumer products to world leaders in each sector.
The company has offices in Rockville, MD as well as Frankfurt,
Hi Everyone,
I am using Python 2.4 and I am converting an excel spreadsheet to a
pipe delimited text file and some of the cells contain utf-8
characters. I solved this problem in a very unintuitive way and I
wanted to ask why. If I do,
csvfile.write(cell.encode(utf-8))
I get a
Hi Everyone,
I had previously asked a similar question,
http://groups.google.com/group/comp.lang.python/browse_thread/thread/2953d6d5d8836c4b/9dc901da63d8d059?lnk=gstq=convert+doc+txt#9dc901da63d8d059
but at that point I was using Windows and now I am using Linux.
Basically, I have some .doc
Thank you very much. I did not know there was a python-excel group,
which I will certainly take note of in the future. The previous post
answered my question, but I wanted to clarify the difference between
xf.background.background_colour_index,
xf.background.pattern_colour_index, and
Hi all,
I am trying to figure out a way to read colors with xlrd, but I did
not understand the formatting.py module. Basically, I want to sort
rows that are red or green. My initial attempt discovered that
print cell
text:u'test1.txt' (XF:22)
text:u'test2.txt' (XF:15)
text:u'test3.txt' (XF:15)
Still no luck:
Traceback (most recent call last):
File C:\Python24\Lib\site-packages\pythonwin\pywin\framework
\scriptutils.py, line 310, in RunScript
exec codeObject in __main__.__dict__
File C:\text analysis\pickle_test2.py, line 13, in ?
cPickle.dump(Data_sheet, pickle_file, -1)
FWIW, it works here on 2.5.1 without errors or warnings. Ouput is:
2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]
0.6.1
I guess it's a version issue then...
I forgot about sorted! Yes, that would make sense!
Thanks for the input.
On Apr 2, 4:23 pm, [EMAIL PROTECTED]
Hi all,
Sorry for the repeat I needed to reform my question and had some
problems...silly me.
The xlrd documentation says:
Pickleable. Default is true. In Python 2.4 or earlier, setting to
false will cause use of array.array objects which save some memory but
can't be pickled. In Python 2.5,
How many megabytes is extremely large? How many seconds does it take
to open it with xlrd.open_workbook?
The document is 15mb ad 50,000+ rows (for test purposes I will use a
smaller sample), but my computer hangs (ie it takes a long time) when
I try to do simple manipulations and the
Hi all,
I have to work with a very large excel file and I have two questions.
First, the documentation says that cPickle.dump would be the best way
to work with it. However, I keep getting:
Traceback (most recent call last):
File C:\Python24\Lib\site-packages\pythonwin\pywin\framework
Hi all,
I have to work with a very large excel file and I have two questions.
First, the documentation says that cPickle.dump would be the best way
to work with it. However, I keep getting:
Traceback (most recent call last):
File C:\Python24\Lib\site-packages\pythonwin\pywin\framework
def category_iterator(source):
source = iter(source)
try:
while True:
item = source.next()
This gave me a lot of inspiration. After a couple of days of banging
my head against the wall, I finally figured out a code that could
attach headers, titles, numbers, and
I tried to make a simple abstraction of my problem, but it's probably
better to get down to it. For the funkiness of the data, I'm
relatively new to Python and I'm either not processing it well or it's
because of BeautifulSoup.
Basically, I'm using BeautifulSoup to strip the tables from the
Hi all,
I have some data with some categories, titles, subtitles, and a link
to their pdf and I need to join the title and the subtitle for every
file and divide them into their separate groups.
So the data comes in like this:
data = ['RULES', 'title','subtitle','pdf',
Hi all,
I was just curious if there was a built-in or a more efficient way to
do take multiple rows of information and write them into excel using
pyExcelerator. This is how I resolved the problem:
from pyExcelerator import *
data = [[1,2,3],[4,5,'a'],['','s'],[6,7,'g']]
Petr thanks so much for your input. I'll try to learn SQL, especially
if I'll do a lot of database work.
I tried to do it John's way as en exercise and I'm happy to say I
understand a lot more. Basically I didn't realize I could nest
dictionaries like db = {country:{genre:{sub_genre:3}}} and
Yes in the sense that the top part will have merged cells so that
Horror and Classics don't need to be repeated every time, but the
headers aren't the important part. At this point I'm more interested
in organizing the data itself and i can worry about putting it into a
new excel file later.
--
Sorry for the delay in my response. New Year's Eve and moving
apartment
- Where the data come from (I mean: are your data in Excel already
when you get them)?
- If your primary source of data is the Excel file, how do you read
data from the Excel file to Python (I mean did you solve this
On Dec 29, 3:00 pm, [EMAIL PROTECTED] wrote:
Patrick,
in your first posting you are writing ... I'm trying to learn how to
make pivot tables from some excel sheets Can you be more specific
please? AFIK Excel offers very good support for pivot tables. So why
to read tabular data from the
Wow, I did not realize it would be this complicated! I'm fairly new
to Python and somehow I thought I could find a simpler solution. I'll
have to mull over this to fully understand how it works for a bit.
Thanks a lot!
On Dec 28, 4:03 am, John Machin [EMAIL PROTECTED] wrote:
On Dec 28, 11:48
Petr, thanks for the SQL suggestion, but I'm having enough trouble in
Python.
John would you mind walking me through your class in normal speak? I
only have a vague idea of why it works and this would help me a lot to
get a grip on classes and this sort of particular problem. The next
step is to
Hi all,
I tried reading http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/334695
on the same subject, but it didn't work for me. I'm trying to learn
how to make pivot tables from some excel sheets and I am trying to
abstract this into a simple sort of example. Essentially I want to
take
On Dec 27, 10:59 pm, John Machin [EMAIL PROTECTED] wrote:
On Dec 28, 4:56 am, [EMAIL PROTECTED] wrote:
from itertools import groupby
You seem to have overlooked this important sentence in the
documentation: Generally, the iterable needs to already be sorted on
the same key function
Yes,
Hi all,
Fairly new Python guy here. I am having a lot of trouble trying to
figure this out. I have some data on some regulations in Excel and I
need to basically add up the total regulations for each country--a
statistical analysis thing that I'll copy to another Excel file.
Writing with
This is how I solved it last night in my inefficient sort of way and
after re-reading some of my Python books on dictionaries. So far this
gets the job done. However, I'd like to test if there are any
countries in the excel input that are not represented, ie the input is
all the information I
Hi all,
I'm analyzing some data that has a lot of country data. What I need
to do is sort through this data and output it into an excel doc with
summary information. The countries, though, need to be sorted by
region, but the way I thought I could do it isn't quite working out.
So far I can
Great, this is very helpful. I'm new to Python, so hence the
inefficient or nonsensical code!
2) I would suggest using countries.sort(...) or sorted(countries,...),
specifying cmp or key options too sort by region instead.
I don't understand how to do this. The countries.sort() lists
codeObject in __main__.__dict__
File C:\Documents and Settings\Patrick Waldo\My Documents\Python
\WORD\try5-2-file-1-all patterns.py, line 77, in ?
input = codecs.open(input_text, 'r','utf8')
File C:\Python24\lib\codecs.py, line 666, in open
file = __builtin__.open(filename, mode, buffering
Finally I solved the problem, with some really minor things to tweak.
I guess it's true that I had two problems working with regular
expressions.
Thank you all for your help. I really learned a lot on quite a
difficult problem.
Final Code:
#For text files in a directory...
#Analyzes a randomly
\scriptutils.py, line 310, in RunScript
exec codeObject in __main__.__dict__
File C:\Documents and Settings\Patrick Waldo\My Documents\Python
\WORD\try5-2-file-1-1.py, line 32, in ?
input = codecs.open(input_text, 'r','utf8')
File C:\Python24\lib\codecs.py, line 666, in open
file
This is related to my last post (see:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/c333cbbb5d496584/998af2bb2ca10e88#998af2bb2ca10e88)
I have a text file with an EINECS number, a CAS number, a Chemical
Name, and a Chemical Formula, always in this order. However, I
That KB document was really helpful, but the problem still isn't
solved. What's wierd now is that the unicode characters like
become รจ in some odd conversion. However, I noticed when I try to
open the word documents after I run the first for statement that Word
gives me a window that says
Hi,
I'm trying to learn regular expressions, but I am having trouble with
this. I want to search a document that has mixed data; however, the
last line of every entry has something like C5H4N4O3 or CH5N3.ClH.
All of the letters are upper case and there will always be numbers and
possibly one .
Hi all,
I'm trying to copy a bunch of microsoft word documents that have
unicode characters into utf-8 text files. Everything works fine at
the beginning. The word documents get converted and new utf-8 text
files with the same name get created. And then I try to copy the data
and I keep on
Indeed, the shutil.copyfile(doc,txt_doc) was causing the problem for
the reason you stated. So, I changed it to this:
for doc in glob.glob(input):
txt_split = os.path.splitext(doc)
txt_doc = txt_split[0] + '.txt'
txt_doc_dir = os.path.join(input_dir,txt_doc)
doc_dir =
And now for something completely different...
I see a lot of COM stuff with Python for excel...and I quickly made
the same program output to excel. What if the input file were a Word
document? Where is there information about manipulating word
documents, or what could I add to make the same
And now for something completely different...
I've been reading up a bit about Python and Excel and I quickly told
the program to output to Excel quite easily. However, what if the
input file were a Word document? I can't seem to find much
information about parsing Word files. What could I add
lines = open('your_file.txt').readlines()[:4]
print lines
print map(len, lines)
gave me:
['\xef\xbb\xbf200-720-769-93-2\n', 'kyselina mo\xc4\x8dov
\xc3\xa1 C5H4N4O3\n', '\n', '200-001-8\t50-00-0\n']
[28, 32, 1, 18]
I think it means that I'm still at option 3. I got
lines = open('your_file.txt').readlines()[:4]
print lines
print map(len, lines)
gave me:
['\xef\xbb\xbf200-720-769-93-2\n', 'kyselina mo\xc4\x8dov
\xc3\xa1 C5H4N4O3\n', '\n', '200-001-8\t50-00-0\n']
[28, 32, 1, 18]
I think it means that I'm still at option 3. I got
Wow, thank you all. All three work. To output correctly I needed to
add:
output.write(\r\n)
This is really a great help!!
Because of my limited Python knowledge, I will need to try to figure
out exactly how they work for future text manipulation and for my own
knowledge. Could you recommend
Hi all,
I started Python just a little while ago and I am stuck on something
that is really simple, but I just can't figure out.
Essentially I need to take a text document with some chemical
information in Czech and organize it into another text file. The
information is always EINECS number,
Thank you both for helping me out. I am still rather new to Python
and so I'm probably trying to reinvent the wheel here.
When I try to do Paul's response, I get
tokens = line.strip().split()
[]
So I am not quite sure how to read line by line.
tokens = input.read().split() gets me all the
43 matches
Mail list logo