Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98903

Re: write data in Excel using python

From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: write data in Excel using python
Date 2015-11-16 17:22 -0700
Message-ID <mailman.373.1447720302.16136.python-list@python.org> (permalink)
References <3267f6a3-a047-4abf-80bf-8fdba3659223@googlegroups.com> <9559B3D4-FF2F-4CCA-8C52-BF0D1988755E@xs4all.nl>

Show all headers | View raw


On Mon, Nov 16, 2015 at 11:20 AM, Michiel Overtoom <motoom@xs4all.nl> wrote:
>
> Hi,
>
>> On 16 Nov 2015, at 18:14, syedmwaliullah@gmail.com wrote:
>> For some reason it doesn't save the file.
>
> Did you get an error message?
>
>> excel.activeWorkbook.SaveAs ("c:\TurnData.xlsx")
>
> When you use backslashes in strings, don't forget to escape them:
>
>> excel.activeWorkbook.SaveAs("c:\\TurnData.xlsx")
>
> or use raw strings:
>
>> excel.activeWorkbook.SaveAs(r"c:\TurnData.xlsx")

You can also just use a forward slash:

excel.activeWorkbook.SaveAs("c:/TurnData.xlsx")

Windows happily accepts this.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

write data in Excel using python syedmwaliullah@gmail.com - 2015-11-16 09:14 -0800
  Re: write data in Excel using python Michiel Overtoom <motoom@xs4all.nl> - 2015-11-16 19:20 +0100
  Re: write data in Excel using python Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-16 17:22 -0700
  Re: write data in Excel using python tdsperth@gmail.com - 2015-11-16 17:43 -0800

csiph-web