User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 391,574 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,861 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser:
Views: 276 | Replies: 5
Reply
Join Date: Jul 2008
Posts: 3
Reputation: supriyav is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
supriyav supriyav is offline Offline
Newbie Poster

Creating EXCEL file using Python Script

  #1  
29 Days Ago
Hi,
I have to create *.xls (or *.csv) with multiple tabs.
The program is in the loop and every time the loop runs it should create a new tab. Can any one help me with this. (I want to code it with out using PYExcelerator - I tried using that function but it throws an error saying "ImportError: No module named pyExcelerator" can some body help me with this too... resolving the error.)

Thanks,
Supriya
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2008
Location: Durham, NC
Posts: 122
Reputation: jlm699 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 18
jlm699's Avatar
jlm699 jlm699 is offline Offline
Junior Poster

Re: Creating EXCEL file using Python Script

  #2  
29 Days Ago
You will need to download and install pyExcelerator as it is not distributed with the standard Python.
Link: Py Package

You cannot create a csv file with multiple sheets (tabs), as the format does not allow it.
Last edited by jlm699 : 29 Days Ago at 3:07 pm. Reason: Added link to pyExcelerator
Let's Go Pens!
Reply With Quote  
Join Date: Jul 2008
Posts: 3
Reputation: supriyav is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
supriyav supriyav is offline Offline
Newbie Poster

Re: Creating EXCEL file using Python Script

  #3  
29 Days Ago
Originally Posted by jlm699 View Post
You will need to download and install pyExcelerator as it is not distributed with the standard Python.
Link: Py Package

You cannot create a csv file with multiple sheets (tabs), as the format does not allow it.


Hi,
Thanks for the reply. Can u please tell me where to place the downloaded file?
Thanks
Reply With Quote  
Join Date: Jul 2008
Location: Durham, NC
Posts: 122
Reputation: jlm699 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 18
jlm699's Avatar
jlm699 jlm699 is offline Offline
Junior Poster

Re: Creating EXCEL file using Python Script

  #4  
29 Days Ago
If you don't know how to build python packages, simply extract the pyExcelerator directory and place it in your Python site-packages folder... on Windows it will be:
C:\PythonXX\Lib\site-packages .
Let's Go Pens!
Reply With Quote  
Join Date: Jul 2008
Posts: 3
Reputation: supriyav is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
supriyav supriyav is offline Offline
Newbie Poster

Re: Creating EXCEL file using Python Script

  #5  
29 Days Ago
Originally Posted by jlm699 View Post
If you don't know how to build python packages, simply extract the pyExcelerator directory and place it in your Python site-packages folder... on Windows it will be:
C:\PythonXX\Lib\site-packages .


Thanks. I tried what u said. It still gives me this error

Traceback (most recent call last):
File "C:\Documents and Settings\xlspyexcel", line 1, in ?
from pyExcelerator import *
ImportError: No module named pyExcelerator

and this is the program I am running

from pyExcelerator import *
wb = Workbook()
ws0 = wb.add_sheet('0')

for x in range(10):
for y in range(10):
# writing to a specific x,y
ws0.write(x,y,"this is cell %s, %s" % (x,y))

wb.save('output.xls')

Please let me know what is wrong (I copied this program from internet)
Reply With Quote  
Join Date: Jul 2008
Location: Durham, NC
Posts: 122
Reputation: jlm699 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 18
jlm699's Avatar
jlm699 jlm699 is offline Offline
Junior Poster

Re: Creating EXCEL file using Python Script

  #6  
29 Days Ago
First try opening an interpreter and just type in import pyExcelerator . That will tell you if you copied the directory to the right location.
Last edited by jlm699 : 29 Days Ago at 6:44 pm.
Let's Go Pens!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Python Marketplace
Thread Tools Display Modes

Other Threads in the Python Forum

All times are GMT -4. The time now is 10:27 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC