|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Writing output to Excel sheet
Hello,
I'm able to use a python script to write an output to an MS Excel sheet. But the second time I run the same script, it gives me permission error: Code:
output= open("C:\Documents and Settings\Sam\Desktop\L24.xls","w")
IOError: [Errno 13] Permission denied: 'C:\\Documents and Settings\\Sam\\Desktop\\L24.xls'
PS. Here I have used the # buttons as was mentioned in one of the "How to post messages" threads, but still when I use preview, the indentation is not conserved. Last edited by netytan : October 4th, 2004 at 03:01 PM. |
|
#2
|
||||
|
||||
|
This error indicates that something else already has the file open. I'm guessing that you have the spreadsheet already open in Excel or something, or perhaps it is a previous running instance of the program which hasn't been killed off yet. Check your Task Manager to be certain.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month |
|
#3
|
||||
|
||||
|
Thanks alot, yes the page was open and I was trying to write to it!
|
|
#4
|
||||
|
||||
|
Hey Sam,
Check out your post by clicking on the Edit button; you should be able to see what's changed, and what you need to do to preserve your indentation in future .Anyway, to explain your error. Usually if the file is in use by another program [locked], or you don't have write permission on the file, then Python shouldn't be able to write to the file. For example... Quote:
Maybe if you attach the script we could spot the problem. For more info on IOError's you can check out: http://docs.python.org/lib/module-exceptions.html Mark. Last edited by netytan : October 4th, 2004 at 03:37 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Writing output to Excel sheet |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|