473,386 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

pyXLWriter - simple example code ?

Hi - Anyone out there who has a simple example using pyXLWriter
(http://sourceforge.net/projects/pyxlwriter/) they are willing to
share with the group ?

I'm interested in creating a .XLS which has multiple sheets within the
workbook but I'm having real trouble getting started, I can create a
Worksheet but can't figure out how to save it.

thanks

richard shea.
Jul 18 '05 #1
2 4703

Richard Shea wrote:
Hi - Anyone out there who has a simple example using pyXLWriter
(http://sourceforge.net/projects/pyxlwriter/) they are willing to
share with the group ?

I'm interested in creating a .XLS which has multiple sheets within the
workbook but I'm having real trouble getting started, I can create a
Worksheet but can't figure out how to save it.

thanks

richard shea.


################################################## ######################

import pyXLWriter

wb = pyXLWriter.Workbook( 'test.xls' )
ws1 = wb.add_worksheet( 'First' )
ws2 = wb.add_worksheet( 'Second' )
ws1.write( "A1", "January" )
ws1.write( "A2", "February" )
ws1.write( "A3", "March" )
ws1.write( "B1", 1.25 )
ws1.write( "B2", 2.50 )
ws1.write( "B3", 1.80 )
wb.close()

################################################## ######################

Hope this helps

Aurelio
Jul 18 '05 #2
Aurelio Martin Massoni <am*****@wpsnetwork.com> wrote in message news:<2o************@uni-berlin.de>...
Richard Shea wrote:
Hi - Anyone out there who has a simple example using pyXLWriter
(http://sourceforge.net/projects/pyxlwriter/) they are willing to
share with the group ?

I'm interested in creating a .XLS which has multiple sheets within the
workbook but I'm having real trouble getting started, I can create a
Worksheet but can't figure out how to save it.

thanks

richard shea.


################################################## ######################

import pyXLWriter

wb = pyXLWriter.Workbook( 'test.xls' )
ws1 = wb.add_worksheet( 'First' )
ws2 = wb.add_worksheet( 'Second' )
ws1.write( "A1", "January" )
ws1.write( "A2", "February" )
ws1.write( "A3", "March" )
ws1.write( "B1", 1.25 )
ws1.write( "B2", 2.50 )
ws1.write( "B3", 1.80 )
wb.close()

################################################## ######################

Hope this helps


Hi Aurelio - Thanks for this I appreciate it, gave me a starting point
which I needed ! Just for other W32/Python people reading this the W32
style .EXE doesn't contain as much example material as the downloads
so it's worth using the .EXE to install the package but then taking a
peek inside the one of the others at the example directory. I used
Aurelio's code and then extended it based upon what I read in the
examples. An unexpected plus is that the XML files produced are able
to be read by Excel97 whereas I was assuming it was Excel2000 and
upwards.

Thanks again Aurelio.

regards

richard shea.
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jacek Generowicz | last post by:
:::Title::: A simple text markup utility :::/Title::: :::Section Introduction ::: I'm looking for something to help developers wirte documentation for bits of software they are writing. The...
0
by: Richard Shea | last post by:
Hi - After I posted "pyXLWriter - simple example code ?" I wrote to Evgeny Filatov (the writer of pyXLWriter) and he has very kindly pointed me in the right direction for examples etc (the...
0
by: elbertlev | last post by:
Hi! I was using pyXLwriter in C-python, but recently had to code in jython. Tried to port pyXLwriter to jython and it does not work. Did somebody uset this module with jython?
11
by: Beeeeeeeeeeeeves | last post by:
Hi I'm looking for some .net example code on encryption: I don't want anything fancy, no complex third party components with sophisticated algorithms, explanations of principle, or "public/private...
0
by: Tal Sharfi | last post by:
Hi everyone I recently had the need for StringGrid object same as the one that Delphi has. An object that helps show lists of other objects in a simple grid. I searched the news groups and...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
5
by: Luis P. Mendes | last post by:
Hi, I know that pyExelerator is the supported project now, but I can't use it because I'd need it to generate files from a web platform. Since I can not save a file to a file-like object, I have...
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
1
by: Robert Singer | last post by:
Platform: winXP, excel 2003 Python 2.5.2 XLWriter 0.4a3 (http://sourceforge.net/projects/pyxlwriter/) Is anyone here using this very nice package, for writing excel files? I'm using it on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.